From b55a9f794bee9e8296e81c02e8d16de9dc6a7698 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 15 Aug 2023 19:28:50 +0200 Subject: Rewrite cross-origin navigation test to use scrolling Hopefully makes it more reliable --- tests/end2end/data/insert_mode_settings/html/autofocus.html | 3 --- tests/end2end/features/misc.feature | 13 ++++++------- tests/end2end/features/test_misc_bdd.py | 5 +++++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/end2end/data/insert_mode_settings/html/autofocus.html b/tests/end2end/data/insert_mode_settings/html/autofocus.html index 6ce8c6e6f..366f436f6 100644 --- a/tests/end2end/data/insert_mode_settings/html/autofocus.html +++ b/tests/end2end/data/insert_mode_settings/html/autofocus.html @@ -7,9 +7,6 @@ function setup_event_listener() { var elem = document.getElementById('qute-input-autofocus'); console.log(elem); - elem.addEventListener('focus', function() { - console.log("focused"); - }); elem.addEventListener('input', function() { console.log("contents: " + elem.value); }); diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index f7013cfae..c3d9a3003 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -623,11 +623,10 @@ Feature: Various utility commands. Then "Ignoring invalid * URL: Invalid hostname (contains invalid characters); *" should be logged And no crash should happen - @flaky @qtwebkit_skip Scenario: Keyboard focus after cross-origin navigation - When I open qute://gpl - And I open data/insert_mode_settings/html/autofocus.html - And I run :mode-enter insert - And I wait for the javascript message "focused" - And I run :fake-key -g "testing" - Then the javascript message "contents: testing" should be logged + When I turn on scroll logging + And I open qute://gpl in a new tab + And I run :tab-only + And I open data/scroll/simple.html + And I run :fake-key "" + Then the page should be scrolled vertically diff --git a/tests/end2end/features/test_misc_bdd.py b/tests/end2end/features/test_misc_bdd.py index 7f899b6de..570afee64 100644 --- a/tests/end2end/features/test_misc_bdd.py +++ b/tests/end2end/features/test_misc_bdd.py @@ -16,6 +16,11 @@ def load_iframe(quteproc, server, ssl_server): msg.expected = True +@bdd.when("I turn on scroll logging") +def turn_on_scroll_logging(quteproc): + quteproc.turn_on_scroll_logging(no_scroll_filtering=True) + + @bdd.then(bdd.parsers.parse('the PDF {filename} should exist in the tmpdir')) def pdf_exists(quteproc, tmpdir, filename): path = tmpdir / filename -- cgit v1.2.3-54-g00ecf