Add bdd test for page not containing plaintext.

You can now use 'the page should not contain the plaintext ...' in a
feature test.
This commit is contained in:
Ryan Roden-Corrent 2016-05-12 07:45:48 -04:00
parent 800c1c3cf8
commit c36f760114

View File

@ -366,6 +366,14 @@ def check_contents_plain(quteproc, text):
assert text in content
@bdd.then(bdd.parsers.parse('the page should not contain the plaintext '
'"{text}"'))
def check_contents_plain(quteproc, text):
"""Check the current page's content based on a substring."""
content = quteproc.get_content().strip()
assert text not in content
@bdd.then(bdd.parsers.parse('the json on the page should be:\n{text}'))
def check_contents_json(quteproc, text):
"""Check the current page's content as json."""