Relax the checking in :view-source test
This commit is contained in:
parent
003952748b
commit
dec0f0753d
@ -458,18 +458,11 @@ def check_header(quteproc, header, value):
|
|||||||
assert data['headers'][header] == value
|
assert data['headers'][header] == value
|
||||||
|
|
||||||
|
|
||||||
@bdd.then(bdd.parsers.parse("the page source should look like {filename}"))
|
@bdd.then(bdd.parsers.parse('the page should contain the html "{text}"'))
|
||||||
def check_contents(quteproc, filename):
|
def check_contents_html(quteproc, text):
|
||||||
"""Check the current page's content.
|
"""Check the current page's content based on a substring."""
|
||||||
|
|
||||||
The filename is interpreted relative to tests/end2end/data.
|
|
||||||
"""
|
|
||||||
content = quteproc.get_content(plain=False)
|
content = quteproc.get_content(plain=False)
|
||||||
path = os.path.join(utils.abs_datapath(),
|
assert text in content
|
||||||
os.path.join(*filename.split('/')))
|
|
||||||
with open(path, 'r', encoding='utf-8') as f:
|
|
||||||
file_content = f.read()
|
|
||||||
assert content == file_content
|
|
||||||
|
|
||||||
|
|
||||||
@bdd.then(bdd.parsers.parse('the page should contain the plaintext "{text}"'))
|
@bdd.then(bdd.parsers.parse('the page should contain the plaintext "{text}"'))
|
||||||
|
@ -203,7 +203,7 @@ Feature: Various utility commands.
|
|||||||
url: http://localhost:*/data/hello.txt
|
url: http://localhost:*/data/hello.txt
|
||||||
- active: true
|
- active: true
|
||||||
history: []
|
history: []
|
||||||
And the page source should look like misc/hello.txt.html
|
And the page should contain the html "/* Literal.Number.Integer */"
|
||||||
|
|
||||||
@qtwebengine_skip: Flaky due to :view-source being async
|
@qtwebengine_skip: Flaky due to :view-source being async
|
||||||
Scenario: :view-source on source page.
|
Scenario: :view-source on source page.
|
||||||
|
Loading…
Reference in New Issue
Block a user