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 import pytest_bdd as bdd
bdd.scenarios('prompts.feature') bdd.scenarios('prompts.feature')
from qutebrowser.utils import qtutils
@bdd.when("I load an SSL page") @bdd.when("I load an SSL page")
def load_ssl_page(quteproc, ssl_server): def load_ssl_page(quteproc, ssl_server):
@ -46,6 +48,11 @@ def no_prompt_shown(quteproc):
@bdd.then("a SSL error page should be shown") @bdd.then("a SSL error page should be shown")
def ssl_error_page(request, quteproc): def ssl_error_page(request, quteproc):
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: if not request.config.webengine:
line = quteproc.wait_for(message='Error while loading *: SSL ' line = quteproc.wait_for(message='Error while loading *: SSL '
'handshake failed') 'handshake failed')