update test utils

This commit is contained in:
Jordan Blasenhauer 2024-02-28 11:24:00 +01:00
parent 83f425ddfe
commit 149cffe0bd

View file

@ -169,7 +169,7 @@ def wait_for_service(service: str = "www.example.com"):
def verify_select_filters(driver, page_name: str, filter_items: list):
for item in filter_items:
# Update in order to get no match
driver.execute_script(f"""document.querySelector("[data-{page_name}-setting-select-dropdown-btn='{item["id"]}'][value='{item["value"]}']').setAttribute('value', '{item["update_value"]}")""")
driver.execute_script(f"""document.querySelector("[data-{page_name}-setting-select-dropdown-btn='{item["id"]}'][value='{item["value"]}']').setAttribute('value', '{item["update_value"]}'")""")
select_btn = safe_get_element(driver, "js", f"""document.querySelector("[data-{page_name}-setting-select-dropdown-btn='{item["id"]}'][value='{item["update_value"]}']")""")
select_btn.click()
sleep(0.1)
@ -181,7 +181,7 @@ def verify_select_filters(driver, page_name: str, filter_items: list):
exit(1)
# Reset
driver.execute_script(f"""document.querySelector("[data-{page_name}-setting-select-dropdown-btn='{item["id"]}'][value='{item["update_value"]}']').setAttribute('value', '{item["value"]}")""")
driver.execute_script(f"""document.querySelector("[data-{page_name}-setting-select-dropdown-btn='{item["id"]}'][value='{item["update_value"]}']').setAttribute('value', '{item["value"]}'")""")
select_btn_reset = safe_get_element(driver, "js", f"""document.querySelector("[data-{page_name}-setting-select-dropdown-btn='{item["id"]}'][value='{item["value"]}']")""")
select_btn_reset.click()
sleep(0.1)