summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-06-24 10:11:56 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-06-24 10:11:56 +0200
commit6c63b5876259d8bc7c184409d79c3ab3c2924178 (patch)
tree664378e579cffe6fed363d8c0fc4044849c19829
parent3a3f7786ada9fee9d04a39337c5b26bfe08a4844 (diff)
downloadqutebrowser-6c63b5876259d8bc7c184409d79c3ab3c2924178.tar.gz
qutebrowser-6c63b5876259d8bc7c184409d79c3ab3c2924178.zip
tests: Fix flakyness in editor bdd tests
There likely was a race condition between JS processing the input and us clicking the button there. Log the text async from JS via oninput= to avoid having to click a button. See https://github.com/qutebrowser/qutebrowser/issues/5390#issuecomment-625179233
-rw-r--r--tests/end2end/data/editor.html3
-rw-r--r--tests/end2end/features/editor.feature5
2 files changed, 1 insertions, 7 deletions
diff --git a/tests/end2end/data/editor.html b/tests/end2end/data/editor.html
index 9f5f9c067..eda6d51f0 100644
--- a/tests/end2end/data/editor.html
+++ b/tests/end2end/data/editor.html
@@ -11,7 +11,6 @@
</script>
</head>
<body>
- <textarea id="qute-textarea"></textarea>
- <input type="button" id="qute-button" onclick="log_text()" value="Log text">
+ <textarea id="qute-textarea" oninput="log_text()"></textarea>
</body>
</html>
diff --git a/tests/end2end/features/editor.feature b/tests/end2end/features/editor.feature
index 59f7fdf4e..db80c89ba 100644
--- a/tests/end2end/features/editor.feature
+++ b/tests/end2end/features/editor.feature
@@ -101,7 +101,6 @@ Feature: Opening external editors
And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log
And I run :open-editor
And I wait for "Read back: foobar" in the log
- And I run :click-element id qute-button
Then the javascript message "text: foobar" should be logged
Scenario: Spawning an editor in normal mode
@@ -113,7 +112,6 @@ Feature: Opening external editors
And I wait for "Leaving mode KeyMode.insert (reason: leave current)" in the log
And I run :open-editor
And I wait for "Read back: foobar" in the log
- And I run :click-element id qute-button
Then the javascript message "text: foobar" should be logged
# Could not get signals working on Windows
@@ -143,7 +141,6 @@ Feature: Opening external editors
And I wait until the editor has started
And I save without exiting the editor
And I wait for "Read back: foobar" in the log
- And I run :click-element id qute-button
Then the javascript message "text: foobar" should be logged
Scenario: Spawning an editor in caret mode
@@ -157,7 +154,6 @@ Feature: Opening external editors
And I wait for "Entering mode KeyMode.caret (reason: command)" in the log
And I run :open-editor
And I wait for "Read back: foobar" in the log
- And I run :click-element id qute-button
Then the javascript message "text: foobar" should be logged
Scenario: Spawning an editor with existing text
@@ -169,7 +165,6 @@ Feature: Opening external editors
And I wait for "Inserting text into element *" in the log
And I run :open-editor
And I wait for "Read back: bar" in the log
- And I run :click-element id qute-button
Then the javascript message "text: bar" should be logged
## :edit-command