Fix SSL error page tests

This commit is contained in:
Florian Bruhin 2018-06-25 22:51:48 +02:00
parent 81b3ef937e
commit 87778277e0

View File

@ -20,6 +20,8 @@
import pytest_bdd as bdd
bdd.scenarios('prompts.feature')
from qutebrowser.utils import qtutils
@bdd.when("I load an SSL page")
def load_ssl_page(quteproc, ssl_server):
@ -46,14 +48,19 @@ def no_prompt_shown(quteproc):
@bdd.then("a SSL error page should be shown")
def ssl_error_page(request, quteproc):
if not request.config.webengine:
line = quteproc.wait_for(message='Error while loading *: SSL '
'handshake failed')
line.expected = True
quteproc.wait_for(message="Changing title for idx * to 'Error "
"loading page: *'")
content = quteproc.get_content().strip()
assert "Unable to load page" in content
if request.config.webengine and qtutils.version_check('5.9'):
quteproc.wait_for(message="Certificate error: *")
content = quteproc.get_content().strip()
assert "ERR_INSECURE_RESPONSE" in content
else:
if not request.config.webengine:
line = quteproc.wait_for(message='Error while loading *: SSL '
'handshake failed')
line.expected = True
quteproc.wait_for(message="Changing title for idx * to 'Error "
"loading page: *'")
content = quteproc.get_content().strip()
assert "Unable to load page" in content
class AbstractCertificateErrorWrapper: