summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-11-24 14:56:52 +0100
committerFlorian Bruhin <me@the-compiler.org>2022-11-24 14:56:52 +0100
commit725ed95d8af99b522e5b7c2669e92742a345e41a (patch)
treeb14515fbd0cd882d395b03c95a73ec5ef1a4cebc
parente11f899b419b5f56c7d6f4677228d8a07d70cfc4 (diff)
downloadqutebrowser-725ed95d8af99b522e5b7c2669e92742a345e41a.tar.gz
qutebrowser-725ed95d8af99b522e5b7c2669e92742a345e41a.zip
tests: Fix downloads.feature flakiness
The "Answering a question for a cancelled download" test was flaky, due to the preceding PDF.js test sometimes not waiting properly for its download to finish: "I wait until the download is finished" waited for the initial PDF download above (which causes PDF.js to open), but not for the real download after clicking the save button. See #5390 TODO: Cherry-pick to master?
-rw-r--r--tests/end2end/features/conftest.py1
-rw-r--r--tests/end2end/features/downloads.feature1
2 files changed, 2 insertions, 0 deletions
diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py
index c1089ecff..43d953b26 100644
--- a/tests/end2end/features/conftest.py
+++ b/tests/end2end/features/conftest.py
@@ -195,6 +195,7 @@ def pdfjs_available(data_tmpdir):
@bdd.given('I clear the log')
+@bdd.when('I clear the log')
def clear_log_lines(quteproc):
quteproc.clear_data()
diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature
index 6969f50dc..47835fd79 100644
--- a/tests/end2end/features/downloads.feature
+++ b/tests/end2end/features/downloads.feature
@@ -648,6 +648,7 @@ Feature: Downloading things from a website.
And I open data/misc/test.pdf without waiting
And I wait until PDF.js is ready
And I run :click-element id download
+ And I clear the log
And I wait until the download is finished
# We get viewer.html as name on QtWebKit...
# Then the downloaded file test.pdf should exist