Skip to content

Commit

Permalink
fix scenario status reporting (allure-framework#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
sseliverstov authored and GilBecker-Anaplan committed Apr 10, 2023
1 parent b892f69 commit 5deb0f1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions allure-behave/features/scenario.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ Feature: Scenario
| undefined | broken |


Scenario: Skip steps after fail step
Given feature definition
"""
Feature: Scenario
Scenario: Scenario with failed step in chain
Given passed step
Given failed step
Given broken step
"""
When I run behave with allure formatter
Then allure report has a scenario with name "Scenario with failed step in chain"
And this scenario has "failed" status

And this scenario contains step "Given passed step"
And this step has "passed" status

And this scenario contains step "Given failed step"
And this step has "failed" status

And this scenario contains step "Given broken step"
And this step has "skipped" status


Scenario: Scenario without name
Given feature definition
"""
Expand Down
4 changes: 2 additions & 2 deletions allure-behave/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def scenario_tags(scenario):

def scenario_status(scenario):
for step in scenario.all_steps:
if step.status != 'passed':
if step_status(step) != 'passed':
return step_status(step)
return Status.PASSED


def scenario_status_details(scenario):
for step in scenario.all_steps:
if step.status != 'passed':
if step_status(step) != 'passed':
return step_status_details(step)


Expand Down

0 comments on commit 5deb0f1

Please sign in to comment.