Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scenario status reporting (fixes #224) #226

Merged
merged 1 commit into from
May 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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