From 9393d8e67ef0bde71c2efe5cb9c571e454ecfc7a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 12 Oct 2024 22:18:24 +0200 Subject: [PATCH] Fix pdf.js downloading tests See https://github.com/mozilla/pdf.js/commit/ee89bd1c39c39327df0a4837728d5a9e30734ad9 which was part of PDF.js v4.7.76 (2024-10-06). This should work both with the old and new version. (cherry picked from commit 4d2aa13db3e55e908ebd3951a499f337cb317d7e) --- tests/end2end/features/downloads.feature | 2 +- tests/end2end/features/qutescheme.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index a1bbee870..58a1e498a 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -645,7 +645,7 @@ Feature: Downloading things from a website. And I set content.pdfjs to true 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 run :jseval (document.getElementById("downloadButton") || document.getElementById("download")).click() And I clear the log 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 e99b9af9d..f05e58eb8 100644 --- a/tests/end2end/features/qutescheme.feature +++ b/tests/end2end/features/qutescheme.feature @@ -190,7 +190,7 @@ Feature: Special qute:// pages And I set downloads.location.prompt to true And I open data/misc/test.pdf without waiting And I wait until PDF.js is ready - And I run :jseval document.getElementById("download").click() + And I run :jseval (document.getElementById("downloadButton") || 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 Then no crash should happen