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
|
||||
|
||||
|
||||
@bdd.then(bdd.parsers.parse("the page source should look like {filename}"))
|
||||
def check_contents(quteproc, filename):
|
||||
"""Check the current page's content.
|
||||
|
||||
The filename is interpreted relative to tests/end2end/data.
|
||||
"""
|
||||
@bdd.then(bdd.parsers.parse('the page should contain the html "{text}"'))
|
||||
def check_contents_html(quteproc, text):
|
||||
"""Check the current page's content based on a substring."""
|
||||
content = quteproc.get_content(plain=False)
|
||||
path = os.path.join(utils.abs_datapath(),
|
||||
os.path.join(*filename.split('/')))
|
||||
with open(path, 'r', encoding='utf-8') as f:
|
||||
file_content = f.read()
|
||||
assert content == file_content
|
||||
assert text in content
|
||||
|
||||
|
||||
@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
|
||||
- active: true
|
||||
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
|
||||
Scenario: :view-source on source page.
|
||||
|
Loading…
Reference in New Issue
Block a user