|
1 | 1 | from functools import partial |
2 | | -from hamcrest import assert_that |
| 2 | +from hamcrest import assert_that, contains_string |
3 | 3 | from hamcrest import not_ |
4 | 4 | from allure_commons_test.report import has_test_case |
5 | 5 | from allure_commons_test.result import with_status |
|
9 | 9 | from allure_commons_test.result import has_status_details |
10 | 10 | from allure_commons_test.result import with_message_contains |
11 | 11 | from allure_commons_test.result import has_link |
| 12 | +from allure_commons_test.result import has_description |
12 | 13 | from allure_commons_test.container import has_container |
13 | 14 | from allure_commons_test.container import has_before, has_after |
14 | 15 | from allure_commons_test.label import has_severity |
@@ -149,3 +150,10 @@ def step_attachment(context, item): |
149 | 150 | context_matcher = getattr(context, item) |
150 | 151 | matcher = partial(context_matcher, has_attachment) |
151 | 152 | assert_that(context.allure_report, matcher()) |
| 153 | + |
| 154 | + |
| 155 | +@then(u'scenario has description "{description}"') |
| 156 | +def step_description(context, description): |
| 157 | + context_matcher = context.scenario |
| 158 | + matcher = partial(context_matcher, has_description, contains_string(description)) |
| 159 | + assert_that(context.allure_report, matcher()) |
0 commit comments