bdd: Add "I wait for the javascript message" step

This commit is contained in:
Florian Bruhin 2016-09-10 15:50:00 +02:00
parent 9f1aacc4f0
commit 17caf80f2a
2 changed files with 8 additions and 2 deletions

View File

@ -329,6 +329,12 @@ def wait_scroll_position_arg(quteproc, x, y):
quteproc.wait_scroll_pos_changed(x, y)
@bdd.when(bdd.parsers.parse('I wait for the javascript message "{message}"'))
def javascript_message_when(quteproc, message):
"""Make sure the given message was logged via javascript."""
quteproc.wait_for_js(message)
## Then

View File

@ -64,7 +64,7 @@ Feature: Various utility commands.
Scenario: :jseval
When I set general -> log-javascript-console to info
And I run :jseval console.log("Hello from JS!");
And I wait for "[:*] Hello from JS!" in the log
And I wait for the javascript message "Hello from JS!"
Then the message "No output or error" should be shown
Scenario: :jseval without logging
@ -76,7 +76,7 @@ Feature: Various utility commands.
Scenario: :jseval with --quiet
When I set general -> log-javascript-console to info
And I run :jseval --quiet console.log("Hello from JS!");
And I wait for "[:*] Hello from JS!" in the log
And I wait for the javascript message "Hello from JS!"
Then "No output or error" should not be logged
Scenario: :jseval with a value