summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-08-15 19:28:50 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-08-15 19:29:45 +0200
commitb55a9f794bee9e8296e81c02e8d16de9dc6a7698 (patch)
tree2f9c05e980bb92f179e2a9e02019176667befb14
parentaea803cffad6817d86c10f9322474e914ee73fcd (diff)
downloadqutebrowser-b55a9f794bee9e8296e81c02e8d16de9dc6a7698.tar.gz
qutebrowser-b55a9f794bee9e8296e81c02e8d16de9dc6a7698.zip
Rewrite cross-origin navigation test to use scrolling
Hopefully makes it more reliable
-rw-r--r--tests/end2end/data/insert_mode_settings/html/autofocus.html3
-rw-r--r--tests/end2end/features/misc.feature13
-rw-r--r--tests/end2end/features/test_misc_bdd.py5
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 "<Space>"
+ 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