| 1 |
@issue |
| 2 |
Feature: Issue #92: Output from --format=plain shows skipped steps in next scenario |
| 3 |
|
| 4 |
. DUPLICATED, FIXED-BY: issue #35 solution. |
| 5 |
. |
| 6 |
. Given a feature has more than one scenario |
| 7 |
. When the --format=plain option is used |
| 8 |
. and a middle step of a scenario fails |
| 9 |
. Then the skipped steps appear under the next scenario |
| 10 |
|
| 11 |
|
| 12 |
Scenario: |
| 13 |
Given a new working directory |
| 14 |
And a file named "features/issue92_syndrome.feature" with: |
| 15 |
""" |
| 16 |
Feature: Testing Plain Output |
| 17 |
Reproduces bug where output from previous scenario appears before current. |
| 18 |
|
| 19 |
Scenario: First example |
| 20 |
Given this step works |
| 21 |
When this step fails |
| 22 |
Then this step appears in the wrong place |
| 23 |
|
| 24 |
Scenario: Second example |
| 25 |
Given this step works |
| 26 |
When this step fails |
| 27 |
Then this step appears in the wrong place |
| 28 |
""" |
| 29 |
And a file named "features/steps/steps.py" with: |
| 30 |
""" |
| 31 |
from behave import step |
| 32 |
|
| 33 |
@step(u'this step works') |
| 34 |
def working(context): |
| 35 |
pass |
| 36 |
|
| 37 |
|
| 38 |
@step(u'this step fails') |
| 39 |
def failing(context): |
| 40 |
assert False, 'step failed' |
| 41 |
|
| 42 |
|
| 43 |
@step(u'this step appears in the wrong place') |
| 44 |
def missing(context): |
| 45 |
pass |
| 46 |
""" |
| 47 |
When I run "behave --no-timings --format=plain features/issue92_syndrome.feature" |
| 48 |
Then it should fail with: |
| 49 |
""" |
| 50 |
0 features passed, 1 failed, 0 skipped |
| 51 |
0 scenarios passed, 2 failed, 0 skipped |
| 52 |
2 steps passed, 2 failed, 2 skipped, 0 undefined |
| 53 |
""" |
| 54 |
And the command output should contain: |
| 55 |
""" |
| 56 |
Feature: Testing Plain Output |
| 57 |
Scenario: First example |
| 58 |
Given this step works ... passed |
| 59 |
When this step fails ... failed |
| 60 |
Assertion Failed: step failed |
| 61 |
|
| 62 |
Scenario: Second example |
| 63 |
Given this step works ... passed |
| 64 |
When this step fails ... failed |
| 65 |
Assertion Failed: step failed |
| 66 |
""" |