Skip to content

Commit

Permalink
Fix notebook tests (#630)
Browse files Browse the repository at this point in the history
* Update test deps
  • Loading branch information
danielhollas authored Aug 23, 2024
1 parent 771dae1 commit 0c9f6fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ dev =
bumpver>=2023.1129
pgtest~=1.3
pre-commit>=3.5
pytest~=8.2.0
pytest~=8.3.0
pytest-cov~=5.0
pytest-docker~=3.0
pytest-selenium~=4.1
pytest-timeout~=2.2
selenium==4.20.0
pytest-docker~=3.1.0
pytest-selenium~=4.1.0
pytest-timeout~=2.3.0
selenium~=4.23.0
optimade =
ipyoptimade~=0.1
eln =
Expand Down
8 changes: 6 additions & 2 deletions tests_notebooks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,20 @@ def _selenium_driver(nb_path):
url, f"apps/apps/aiidalab-widgets-base/{nb_path}?token={token}"
)
selenium.get(f"{url_with_token}")
# By default, let's allow selenium functions to retry for 10s
# By default, let's allow selenium functions to retry for 60s
# till a given element is loaded, see:
# https://selenium-python.readthedocs.io/waits.html#implicit-waits
selenium.implicitly_wait(30)
selenium.implicitly_wait(60)
window_width = 800
window_height = 600
selenium.set_window_size(window_width, window_height)

selenium.find_element(By.ID, "ipython-main-app")
selenium.find_element(By.ID, "notebook-container")
selenium.find_element(By.ID, "appmode-busy")
# We wait until the appmode spinner disappears. However,
# this does not seem to be fully robust, as the spinner might flash
# while the page is still loading. So we add explicit sleep here as well.
WebDriverWait(selenium, 240).until(
ec.invisibility_of_element((By.ID, "appmode-busy"))
)
Expand Down

0 comments on commit 0c9f6fb

Please sign in to comment.