From ae0e391c047bd9e28448a884de4ee0af2ada38fc Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 9 Nov 2015 07:37:23 +0100 Subject: [PATCH] bdd: Add a "When I wait for the message ..." step. --- tests/integration/features/conftest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index 08c1e56b7..5b2489df8 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -78,6 +78,12 @@ def wait_in_log(quteproc, is_regex, pattern): quteproc.wait_for(message=pattern) +@bdd.when(bdd.parsers.re(r'I wait for the (?Perror|message|warning) ' + r'"(?P.*)"')) +def wait_for_message(quteproc, httpbin, category, message): + expect_error(quteproc, httpbin, category, message) + + @bdd.then(bdd.parsers.parse("{path} should be loaded")) def path_should_be_loaded(httpbin, path): requests = httpbin.get_requests()