summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-05-02 18:54:39 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-05-02 19:25:29 +0200
commit556fe81b3146e5cd2e77df9d8ce57aebbbd72eac (patch)
tree08b20d6a6783df141a74e612652c34e7382c537e
parent6821c236f9ae23adf21d46ce0d56768ac8d0c467 (diff)
downloadqutebrowser-556fe81b3146e5cd2e77df9d8ce57aebbbd72eac.tar.gz
qutebrowser-556fe81b3146e5cd2e77df9d8ce57aebbbd72eac.zip
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)
-rw-r--r--tests/end2end/features/test_prompts_bdd.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/end2end/features/test_prompts_bdd.py b/tests/end2end/features/test_prompts_bdd.py
index e7602c5b4..83f1da553 100644
--- a/tests/end2end/features/test_prompts_bdd.py
+++ b/tests/end2end/features/test_prompts_bdd.py
@@ -17,6 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
+import logging
+
import pytest_bdd as bdd
bdd.scenarios('prompts.feature')
@@ -71,6 +73,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."""