bdd: Get rid of "I execute the userscript" step

Since we now have a (testdata) substitution this is much easier.
This commit is contained in:
Florian Bruhin 2016-05-30 16:21:32 +02:00
parent 9695828608
commit 3e5994cff6
2 changed files with 1 additions and 15 deletions

View File

@ -129,20 +129,6 @@ def run_command(quteproc, httpbin, command):
quteproc.send_cmd(command, count=count)
@bdd.when(bdd.parsers.parse("I execute the userscript {userscript}"))
def run_userscript(quteproc, userscript):
"""Run a userscript located in tests/end2end/data/userscripts.
Wrapper around :spawn --userscript {userscript} that uses an absolute
path.
"""
abs_userscript_path = os.path.join(utils.abs_datapath(),
'userscripts', userscript)
cmd = ':spawn --userscript {abs_userscript_path}'
quteproc.send_cmd(cmd.format(abs_userscript_path=abs_userscript_path))
@bdd.when(bdd.parsers.parse("I reload"))
def reload(qtbot, httpbin, quteproc, command):
"""Reload and wait until a new request is received."""

View File

@ -33,7 +33,7 @@ Feature: :spawn
@posix
Scenario: Running :spawn with userscript
When I open about:blank
And I execute the userscript open_current_url
And I run :spawn -u (testdata)/userscripts/open_current_url
And I wait until about:blank is loaded
Then the following tabs should be open:
- about:blank