summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2024-04-27 15:19:34 +1200
committertoofar <toofar@spalge.com>2024-04-27 15:20:00 +1200
commitd47d247941c4b1fe3adac0dae8be301b36aec85b (patch)
tree58155e5a89b9f943fa238f1ddb73681ce3f5a01b
parent9f050c7460c42f317ceaa20b320e97d371a2c0a0 (diff)
downloadqutebrowser-d47d247941c4b1fe3adac0dae8be301b36aec85b.tar.gz
qutebrowser-d47d247941c4b1fe3adac0dae8be301b36aec85b.zip
Wait for evidence of Tab key press in tests before proceeding
In the previous commit 9f050c7460c4 "Delay fake-key events by 10ms" I delayed events for fake-key by 10ms to deal with a timing issue with sending events right after a navigation not being processed. Just like last time that's caused a few tests with tight timing constraints to break because they proceed to the next command before the fake-key events have taken effect. Maybe it would have been better to just put the waits in the e2e tests in the first case instead of in the production code? Well, we'll see. Maybe I'll never have to deal with this again.
-rw-r--r--tests/end2end/features/caret.feature4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/end2end/features/caret.feature b/tests/end2end/features/caret.feature
index d6e65440c..44df60c03 100644
--- a/tests/end2end/features/caret.feature
+++ b/tests/end2end/features/caret.feature
@@ -74,6 +74,7 @@ Feature: Caret mode
And I run :mode-leave
And I run :jseval document.activeElement.blur();
And I run :fake-key <tab>
+ And I wait for "* Got key: <qutebrowser.keyinput.keyutils.KeyInfo key='Key_Tab' modifiers='NoModifier' text='<Tab>'> (dry_run True)" in the log
And I run :selection-follow
Then data/hello.txt should be loaded
@@ -83,6 +84,7 @@ Feature: Caret mode
And I run :mode-leave
And I run :jseval document.activeElement.blur();
And I run :fake-key <tab>
+ And I wait for "* Got key: <qutebrowser.keyinput.keyutils.KeyInfo key='Key_Tab' modifiers='NoModifier' text='<Tab>'> (dry_run True)" in the log
And I run :selection-follow
Then data/hello.txt should be loaded
@@ -92,6 +94,7 @@ Feature: Caret mode
And I run :mode-leave
And I run :jseval document.activeElement.blur();
And I run :fake-key <tab>
+ And I wait for "* Got key: <qutebrowser.keyinput.keyutils.KeyInfo key='Key_Tab' modifiers='NoModifier' text='<Tab>'> (dry_run True)" in the log
And I run :selection-follow --tab
Then data/hello.txt should be loaded
@@ -101,5 +104,6 @@ Feature: Caret mode
And I run :mode-leave
And I run :jseval document.activeElement.blur();
And I run :fake-key <tab>
+ And I wait for "* Got key: <qutebrowser.keyinput.keyutils.KeyInfo key='Key_Tab' modifiers='NoModifier' text='<Tab>'> (dry_run True)" in the log
And I run :selection-follow --tab
Then data/hello.txt should be loaded