Skip to content

Commit 6b8e554

Browse files
authored
fix scenario status reporting (#226)
1 parent 7d55f22 commit 6b8e554

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

allure-behave/features/scenario.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,30 @@ Feature: Scenario
2222
| undefined | broken |
2323

2424

25+
Scenario: Skip steps after fail step
26+
Given feature definition
27+
"""
28+
Feature: Scenario
29+
30+
Scenario: Scenario with failed step in chain
31+
Given passed step
32+
Given failed step
33+
Given broken step
34+
"""
35+
When I run behave with allure formatter
36+
Then allure report has a scenario with name "Scenario with failed step in chain"
37+
And this scenario has "failed" status
38+
39+
And this scenario contains step "Given passed step"
40+
And this step has "passed" status
41+
42+
And this scenario contains step "Given failed step"
43+
And this step has "failed" status
44+
45+
And this scenario contains step "Given broken step"
46+
And this step has "skipped" status
47+
48+
2549
Scenario: Scenario without name
2650
Given feature definition
2751
"""

allure-behave/src/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ def scenario_tags(scenario):
5454

5555
def scenario_status(scenario):
5656
for step in scenario.all_steps:
57-
if step.status != 'passed':
57+
if step_status(step) != 'passed':
5858
return step_status(step)
5959
return Status.PASSED
6060

6161

6262
def scenario_status_details(scenario):
6363
for step in scenario.all_steps:
64-
if step.status != 'passed':
64+
if step_status(step) != 'passed':
6565
return step_status_details(step)
6666

6767

0 commit comments

Comments
 (0)