diff --git a/tests/end2end/data/paste_primary.html b/tests/end2end/data/paste_primary.html
index 4f803aedf..f5a27650f 100644
--- a/tests/end2end/data/paste_primary.html
+++ b/tests/end2end/data/paste_primary.html
@@ -3,8 +3,22 @@
Paste primary selection
+
-
+
diff --git a/tests/end2end/features/test_yankpaste_bdd.py b/tests/end2end/features/test_yankpaste_bdd.py
index 72c19830c..a07315df8 100644
--- a/tests/end2end/features/test_yankpaste_bdd.py
+++ b/tests/end2end/features/test_yankpaste_bdd.py
@@ -33,12 +33,5 @@ def init_fake_clipboard(quteproc):
@bdd.when(bdd.parsers.parse('I set the text field to "{value}"'))
def set_text_field(quteproc, value):
- quteproc.send_cmd(":jseval document.getElementById('qute-textarea').value "
- "= '{}';".format(value))
-
-
-@bdd.then(bdd.parsers.parse('the text field should contain "{value}"'))
-def check_text_field(quteproc, value):
- quteproc.send_cmd(":jseval console.log('text: ' + "
- "document.getElementById('qute-textarea').value);")
- quteproc.wait_for_js('text: ' + value)
+ quteproc.send_cmd(":jseval set_text('{}')".format(value))
+ quteproc.wait_for_js('textarea set to: ' + value)
diff --git a/tests/end2end/features/yankpaste.feature b/tests/end2end/features/yankpaste.feature
index 667905100..abb59ad47 100644
--- a/tests/end2end/features/yankpaste.feature
+++ b/tests/end2end/features/yankpaste.feature
@@ -230,15 +230,17 @@ Feature: Yanking and pasting.
#### :insert-text
Scenario: Inserting text into an empty text field
- When I open data/paste_primary.html
+ When I set general -> log-javascript-console to info
+ And I open data/paste_primary.html
And I run :click-element id qute-textarea
And I wait for "Clicked editable element!" in the log
And I run :insert-text Hello world
# Compare
- Then the text field should contain "Hello world"
+ Then the javascript message "textarea contents: Hello world" should be logged
Scenario: Inserting text into a text field at specific position
- When I open data/paste_primary.html
+ When I set general -> log-javascript-console to info
+ And I open data/paste_primary.html
And I set the text field to "one two three four"
And I run :click-element id qute-textarea
And I wait for "Clicked editable element!" in the log
@@ -248,20 +250,22 @@ Feature: Yanking and pasting.
And I press the key ""
And I run :insert-text Hello world
# Compare
- Then the text field should contain "onHello worlde two three four"
+ Then the javascript message "textarea contents: onHello worlde two three four" should be logged
@qtwebengine_osx_xfail
Scenario: Inserting text into a text field with undo
- When I open data/paste_primary.html
+ When I set general -> log-javascript-console to info
+ And I open data/paste_primary.html
And I run :click-element id qute-textarea
And I wait for "Clicked editable element!" in the log
# Paste and undo
And I run :insert-text This text should be undone
+ And I wait for the javascript message "textarea contents: This text should be undone"
And I press the key ""
# Paste final text
And I run :insert-text This text should stay
# Compare
- Then the text field should contain "This text should stay"
+ Then the javascript message "textarea contents: This text should stay" should be logged
Scenario: Inserting text without a focused field
When I open data/paste_primary.html