Add tests for {url:pretty} variable
This commit is contained in:
parent
c7534bd4a3
commit
8550fb3401
10
tests/integration/data/title with spaces.html
Normal file
10
tests/integration/data/title with spaces.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
foo
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -275,10 +275,12 @@ def expect_message(quteproc, httpbin, category, message):
|
|||||||
|
|
||||||
@bdd.then(bdd.parsers.re(r'(?P<is_regex>regex )?"(?P<pattern>[^"]+)" should '
|
@bdd.then(bdd.parsers.re(r'(?P<is_regex>regex )?"(?P<pattern>[^"]+)" should '
|
||||||
r'be logged'))
|
r'be logged'))
|
||||||
def should_be_logged(quteproc, is_regex, pattern):
|
def should_be_logged(quteproc, httpbin, is_regex, pattern):
|
||||||
"""Expect the given pattern on regex in the log."""
|
"""Expect the given pattern on regex in the log."""
|
||||||
if is_regex:
|
if is_regex:
|
||||||
pattern = re.compile(pattern)
|
pattern = re.compile(pattern)
|
||||||
|
else:
|
||||||
|
pattern = pattern.replace('(port)', str(httpbin.port))
|
||||||
line = quteproc.wait_for(message=pattern)
|
line = quteproc.wait_for(message=pattern)
|
||||||
line.expected = True
|
line.expected = True
|
||||||
|
|
||||||
|
@ -16,9 +16,20 @@ Feature: :spawn
|
|||||||
When I run :spawn echo {url}
|
When I run :spawn echo {url}
|
||||||
Then "Executing echo with args ['about:blank'], userscript=False" should be logged
|
Then "Executing echo with args ['about:blank'], userscript=False" should be logged
|
||||||
|
|
||||||
|
Scenario: Running :spawn with url variable in fully encoded format
|
||||||
|
When I open data/title with spaces.html
|
||||||
|
And I run :spawn echo {url}
|
||||||
|
Then "Executing echo with args ['http://localhost:(port)/data/title%20with%20spaces.html'], userscript=False" should be logged
|
||||||
|
|
||||||
|
Scenario: Running :spawn with url variable in pretty decoded format
|
||||||
|
When I open data/title with spaces.html
|
||||||
|
And I run :spawn echo {url:pretty}
|
||||||
|
Then "Executing echo with args ['http://localhost:(port)/data/title with spaces.html'], userscript=False" should be logged
|
||||||
|
|
||||||
@posix
|
@posix
|
||||||
Scenario: Running :spawn with userscript
|
Scenario: Running :spawn with userscript
|
||||||
When I execute the userscript open_current_url
|
When I open about:blank
|
||||||
|
And I execute the userscript open_current_url
|
||||||
And I wait until about:blank is loaded
|
And I wait until about:blank is loaded
|
||||||
Then the following tabs should be open:
|
Then the following tabs should be open:
|
||||||
- about:blank
|
- about:blank
|
||||||
|
Loading…
Reference in New Issue
Block a user