try to fix string error

This commit is contained in:
Jordan Blasenhauer 2024-02-28 17:08:24 +01:00
parent e5dc06544f
commit 1e3de2fbf2

View file

@ -171,13 +171,13 @@ def verify_select_filters(driver, page_name: str, filter_items: list):
# Get a select filter, change value and click to get no match
# Verify that elements are all hidden
# If not return false, else reset and send true
set_el = driver.execute_script(f"""const select{item['id']} = document.querySelector("[data-{page_name}-setting-select-dropdown-btn='{item["id"]}'][value='{item["value"]}']');""")
log_info("Create variable")
update_el_val = driver.execute_script(f"""if(!select{item['id']}){{ return false }};select{item['id']}.setAttribute('value', '{item["update_value"]}');select{item['id']}.click();""")
set_el = driver.execute_script(f"""const select{item["id"]} = document.querySelector('[data-{page_name}-setting-select-dropdown-btn="{item["id"]}"][value="{item["value"]}"]');""")
log_info("Create variable")
update_el_val = driver.execute_script(f"""if(!select{item["id"]}){{ return false }};select{item["id"]}.setAttribute('value', '{item["update_value"]}');select{item["id"]}.click();""")
log_info("Update value")
check_el = driver.execute_script(f"""const select{item['id']}Match = document.querySelectorAll("[data-{page_name}-list-item][class*='hidden']");if (select{item['id']}Match.length === 0){{ return false }};""")
check_el = driver.execute_script(f"""const select{item["id"]}Match = document.querySelectorAll('[data-{page_name}-list-item][class*="hidden"]');if (select{item["id"]}Match.length === 0){{ return false }};""")
log_info("Check if elements are hidden")
reset_el = driver.execute_script(f"""select{item['id']}.setAttribute('value', '{item["value"]}');select{item['id']}.click();""")
reset_el = driver.execute_script(f"""select{item["id"]}.setAttribute('value', '{item["value"]}');select{item["id"]}.click();""")
log_info("Reset value")
sleep(0.1)