Skip to content

Commit

Permalink
Programatically open filters modal
Browse files Browse the repository at this point in the history
[run percy]
  • Loading branch information
blms committed Jul 31, 2024
1 parent 79b6c4c commit 303559b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions geniza/common/management/commands/visual_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ def take_snapshots(self, browser, dark_mode=False):
browser.get(
"http://localhost:8000/en/documents/?per_page=2&sort=scholarship_desc"
)
# click the filters button to expand filters
browser.find_element(By.CSS_SELECTOR, "a#filters-button").click()
# expand filters
filter_button = browser.find_element(By.CSS_SELECTOR, "a#filters-button")
browser.execute_script("arguments[0].classList.add('open')", filter_button)
filters = browser.find_element(By.CSS_SELECTOR, "fieldset#filters")
browser.execute_script("arguments[0].ariaExpanded = true", filters)
# click the first doctype filter option
browser.find_element(
By.CSS_SELECTOR, "#id_doctype li:nth-child(1) label"
Expand Down

0 comments on commit 303559b

Please sign in to comment.