From 388cc7ae29c974c769826953acae426bf8f1ac57 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 25 Nov 2015 17:19:49 +0100 Subject: [PATCH] bdd: Add "Then ... should be logged" step. --- tests/integration/features/conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index 2291a503c..8526cfdd1 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -182,6 +182,14 @@ def javascript_message_logged(quteproc, message): message='[*] {}'.format(message)) +@bdd.then(bdd.parsers.re(r'(?Pregex )?"(?P[^"]+)" should ' + r'be logged')) +def should_be_logged(quteproc, is_regex, pattern): + if is_regex: + pattern = re.compile(pattern) + quteproc.wait_for(message=pattern) + + @bdd.then("no crash should happen") def no_crash(): """Don't do anything.