From abcb366c129005850bb0c5c3da51d2cd206f6f1f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 13 Jan 2016 22:36:27 +0100 Subject: [PATCH] bdd: Add some more SSL tests. --- tests/integration/features/prompts.feature | 25 ++++++++++++++++++++++ tests/integration/features/test_prompts.py | 5 +++++ 2 files changed, 30 insertions(+) diff --git a/tests/integration/features/prompts.feature b/tests/integration/features/prompts.feature index 63115fa83..b87b57f54 100644 --- a/tests/integration/features/prompts.feature +++ b/tests/integration/features/prompts.feature @@ -72,3 +72,28 @@ Feature: Prompts And I wait until the SSL page finished loading Then the error "SSL error: *" should be shown And the page should contain the plaintext "Hello World via SSL!" + + Scenario: SSL error with ssl-strict = true + When I run :debug-clear-ssl-errors + And I set network -> ssl-strict to true + And I load a SSL page + Then "Error while loading *: SSL handshake failed" should be logged + And the page should contain the plaintext "Unable to load page" + + Scenario: SSL error with ssl-strict = ask -> yes + When I run :debug-clear-ssl-errors + And I set network -> ssl-strict to ask + And I load a SSL page + And I wait for a prompt + And I run :prompt-yes + And I wait until the SSL page finished loading + Then the page should contain the plaintext "Hello World via SSL!" + + Scenario: SSL error with ssl-strict = ask -> no + When I run :debug-clear-ssl-errors + And I set network -> ssl-strict to ask + And I load a SSL page + And I wait for a prompt + And I run :prompt-no + Then "Error while loading *: SSL handshake failed" should be logged + And the page should contain the plaintext "Unable to load page" diff --git a/tests/integration/features/test_prompts.py b/tests/integration/features/test_prompts.py index 4dc8d1211..39bd58c43 100644 --- a/tests/integration/features/test_prompts.py +++ b/tests/integration/features/test_prompts.py @@ -44,3 +44,8 @@ def click_button(quteproc): def wait_for_prompt(quteproc): quteproc.wait_for(message='Entering mode KeyMode.* (reason: question ' 'asked)') + +@bdd.then("no prompt should be shown") +def no_prompt_shown(quteproc): + quteproc.ensure_not_logged(message='Entering mode KeyMode.* (reason: ' + 'question asked)')