From a92f37b0d6673b12def3a3dfd9c6cf01e8c28b45 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 2 May 2020 18:54:39 +0200 Subject: Add test for remembered ignored certificate errors This is a continuation of the previous commit for #5403. The tests are split up from the commit itself so that the fix can be backported with less conflicts. See #5403 (cherry picked from commit 45a2be3f9f32f900c0b567998433d43055f722e2) --- tests/end2end/features/test_prompts_bdd.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/end2end/features/test_prompts_bdd.py b/tests/end2end/features/test_prompts_bdd.py index 0d74700b4..21574ae3e 100644 --- a/tests/end2end/features/test_prompts_bdd.py +++ b/tests/end2end/features/test_prompts_bdd.py @@ -18,6 +18,7 @@ # along with qutebrowser. If not, see . import time +import logging import pytest_bdd as bdd bdd.scenarios('prompts.feature') @@ -67,6 +68,22 @@ def ssl_error_page(request, quteproc): assert "Unable to load page" in content +def test_certificate_error_load_status(request, quteproc, ssl_server): + """If we load the same page twice, we should get a 'warn' status twice.""" + quteproc.set_setting('content.ssl_strict', 'false') + + for i in range(2): + quteproc.open_path('/', port=ssl_server.port, https=True, wait=False, + new_tab=True) + if i == 0 or not request.config.webengine: + # Error is only logged on the first error with QtWebEngine + quteproc.mark_expected(category='message', + loglevel=logging.ERROR, + message="Certificate error: *") + quteproc.wait_for_load_finished('/', port=ssl_server.port, https=True, + load_status='warn') + + class AbstractCertificateErrorWrapper: """A wrapper over an SSL/certificate error.""" -- cgit v1.2.3-54-g00ecf