| 1 |
@issue |
| 2 |
@change_request |
| 3 |
Feature: Issue #116: SummaryReporter shows failed scenarios list |
| 4 |
|
| 5 |
Scenario: Test Setup |
| 6 |
Given a new working directory |
| 7 |
And a file named "features/steps/passing_failing_steps.py" with: |
| 8 |
""" |
| 9 |
from behave import step |
| 10 |
|
| 11 |
@step(u'a step passes') |
| 12 |
def step_passes(context): |
| 13 |
pass |
| 14 |
|
| 15 |
@step(u'a step fails') |
| 16 |
def step_fails(context): |
| 17 |
assert False, "FAILS" |
| 18 |
""" |
| 19 |
And a file named "features/e1.feature" with: |
| 20 |
""" |
| 21 |
Feature: E1 |
| 22 |
|
| 23 |
Scenario: E1.1 |
| 24 |
Given a step passes |
| 25 |
|
| 26 |
@xfail |
| 27 |
Scenario: E1.2 (XFAIL) |
| 28 |
Given a step fails |
| 29 |
|
| 30 |
Scenario: E1.3 |
| 31 |
Given a step passes |
| 32 |
""" |
| 33 |
And a file named "features/e2.feature" with: |
| 34 |
""" |
| 35 |
@example2 |
| 36 |
Feature: E2 |
| 37 |
|
| 38 |
@xfail |
| 39 |
Scenario: E2.1 (XFAIL) |
| 40 |
Given a step fails |
| 41 |
|
| 42 |
Scenario: E2.2 |
| 43 |
Given a step passes |
| 44 |
""" |
| 45 |
|
| 46 |
Scenario: Summary shows list of failed scenarios when at least one fails |
| 47 |
When I run "behave -f plain features/" |
| 48 |
Then it should fail |
| 49 |
And the command output should contain: |
| 50 |
""" |
| 51 |
Failing scenarios: |
| 52 |
features/e1.feature:7 E1.2 (XFAIL) |
| 53 |
features/e2.feature:5 E2.1 (XFAIL) |
| 54 |
|
| 55 |
0 features passed, 2 failed, 0 skipped |
| 56 |
3 scenarios passed, 2 failed, 0 skipped |
| 57 |
3 steps passed, 2 failed, 0 skipped, 0 undefined |
| 58 |
""" |
| 59 |
|
| 60 |
Scenario: Summary hides list of failed scenarios when all scenarios pass |
| 61 |
When I run "behave -f plain --tags=~@xfail features/" |
| 62 |
Then it should pass with: |
| 63 |
""" |
| 64 |
2 features passed, 0 failed, 0 skipped |
| 65 |
3 scenarios passed, 0 failed, 2 skipped |
| 66 |
3 steps passed, 0 failed, 2 skipped, 0 undefined |
| 67 |
""" |
| 68 |
But the command output should not contain: |
| 69 |
""" |
| 70 |
Failing scenarios: |
| 71 |
""" |