From 725ed95d8af99b522e5b7c2669e92742a345e41a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 24 Nov 2022 14:56:52 +0100 Subject: 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? --- tests/end2end/features/conftest.py | 1 + tests/end2end/features/downloads.feature | 1 + 2 files changed, 2 insertions(+) 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 -- cgit v1.2.3-54-g00ecf