From f6e4ba3d6f86de17f18a01383f7e830fab90197d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 24 Nov 2022 10:56:07 +0100 Subject: Make skipping broken PDF.js work properly Fixup for c7ea2f705f22cfb677ef1b32ce3ec7101cede137 See #7135 --- tests/end2end/features/conftest.py | 4 ++-- tests/end2end/features/downloads.feature | 2 +- tests/end2end/features/qutescheme.feature | 4 ++-- tests/end2end/fixtures/quteprocess.py | 2 +- tests/end2end/fixtures/test_quteprocess.py | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py index 96e04a9fb..c1089ecff 100644 --- a/tests/end2end/features/conftest.py +++ b/tests/end2end/features/conftest.py @@ -437,12 +437,12 @@ def update_documentation(): subprocess.run([sys.executable, update_script], check=True) -@bdd.when("I wait until PDF.js is loaded") +@bdd.when("I wait until PDF.js is ready") def wait_pdfjs(quteproc): quteproc.wait_for(message="load status for : LoadStatus.success") try: - quteproc.wait_for(message="[qute://pdfjs/web/viewer.html?*] Uncaught TypeError: Cannot read property 'set' of undefined", timeout=100) + quteproc.wait_for(message="JS: [qute://pdfjs/web/viewer.html?*] Uncaught TypeError: Cannot read property 'set' of undefined", timeout=100) except testprocess.WaitForTimeout: pass else: diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index 9ed77f317..6969f50dc 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -646,7 +646,7 @@ Feature: Downloading things from a website. When I set downloads.location.prompt to false And I set content.pdfjs to true And I open data/misc/test.pdf without waiting - And I wait until PDF.js is loaded + And I wait until PDF.js is ready And I run :click-element id download And I wait until the download is finished # We get viewer.html as name on QtWebKit... diff --git a/tests/end2end/features/qutescheme.feature b/tests/end2end/features/qutescheme.feature index 1753aa264..c5285b221 100644 --- a/tests/end2end/features/qutescheme.feature +++ b/tests/end2end/features/qutescheme.feature @@ -176,7 +176,7 @@ Feature: Special qute:// pages Given pdfjs is available When I set content.pdfjs to true And I open data/misc/test.pdf without waiting - And I wait until PDF.js is loaded + And I wait until PDF.js is ready # No "Then" @qtwebkit_pdf_imageformat_skip @@ -191,7 +191,7 @@ Feature: Special qute:// pages When I set content.pdfjs to true And I set downloads.location.prompt to true And I open data/misc/test.pdf without waiting - And I wait until PDF.js is loaded + And I wait until PDF.js is ready And I run :jseval document.getElementById("download").click() And I wait for "Asking question option=None text=* title='Save file to:'>, *" in the log And I run :mode-leave diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 21389edca..fd0dd8708 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -438,7 +438,7 @@ class QuteProc(testprocess.Process): except AttributeError: pass else: - if call.failed or hasattr(call, 'wasxfail'): + if call.failed or hasattr(call, 'wasxfail') or call.skipped: super().after_test() return diff --git a/tests/end2end/fixtures/test_quteprocess.py b/tests/end2end/fixtures/test_quteprocess.py index 0620dbf6d..7199bf015 100644 --- a/tests/end2end/fixtures/test_quteprocess.py +++ b/tests/end2end/fixtures/test_quteprocess.py @@ -35,6 +35,7 @@ class FakeRepCall: def __init__(self): self.failed = False + self.skipped = False class FakeConfig: -- cgit v1.2.3-54-g00ecf