Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selenium but only partially #136

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web_ext/sseq_gui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ lint-selenium:
black --diff --check tests

selenium:
python3 -m pytest tests --driver firefox
python3 -m pytest tests --driver chrome
python3 -m pytest -s tests --driver firefox
python3 -m pytest -s tests --driver chrome

selenium-update:
python3 -m pytest tests --driver firefox --update
8 changes: 7 additions & 1 deletion web_ext/sseq_gui/tests/test_s_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,17 @@ def test_history(driver):

timeout = 0.1
while True:
print(f"Waiting for {timeout} seconds")
time.sleep(timeout)

try:
with open(f"{driver.tempdir}/s_2.save") as f:
driver.check_file("s_2.save", f.read())
file_contents = f.read()
if file_contents == "":
# The driver hasn't finished saving the file yet, wait a bit longer
print("Waiting for driver to finish")
raise FileNotFoundError
driver.check_file("s_2.save", file_contents)
hoodmane marked this conversation as resolved.
Show resolved Hide resolved
break
except FileNotFoundError:
timeout *= 2
Expand Down