| 1 |
@issue |
| 2 |
Feature: Issue #84: behave.runner behave does not reliably detected failed test runs |
| 3 |
|
| 4 |
. Behave does currently not reliably detected failed test runs and |
| 5 |
. therefore returns not sys.exit(1) at end of main(). |
| 6 |
. |
| 7 |
. 1. behave.runner:Runner.run_with_paths() returns failed==True |
| 8 |
. if last feature was successful and test runner does not stop |
| 9 |
. after first failing feature. |
| 10 |
. |
| 11 |
. 2. Issue #64: Same problem in behave.model.Feature.run() with scenarios |
| 12 |
|
| 13 |
Scenario: Test Setup |
| 14 |
Given a new working directory |
| 15 |
And a file named "features/passing.feature" with: |
| 16 |
""" |
| 17 |
Feature: Passing |
| 18 |
Scenario: |
| 19 |
Given a step passes |
| 20 |
When a step passes |
| 21 |
Then a step passes |
| 22 |
""" |
| 23 |
And a file named "features/failing.feature" with: |
| 24 |
""" |
| 25 |
Feature: Failing |
| 26 |
Scenario: |
| 27 |
Given a step fails |
| 28 |
When a step fails |
| 29 |
Then a step fails |
| 30 |
""" |
| 31 |
And a file named "features/steps/steps.py" with: |
| 32 |
""" |
| 33 |
from behave import step |
| 34 |
|
| 35 |
@step(u'a step passes') |
| 36 |
def step_passes(context): |
| 37 |
pass |
| 38 |
|
| 39 |
@step(u'a step fails') |
| 40 |
def step_fails(context): |
| 41 |
assert False, "step: a step fails" |
| 42 |
""" |
| 43 |
|
| 44 |
Scenario: First feature fails, second feature passes |
| 45 |
When I run "behave -f plain features/failing.feature features/passing.feature" |
| 46 |
Then it should fail with: |
| 47 |
""" |
| 48 |
1 feature passed, 1 failed, 0 skipped |
| 49 |
1 scenario passed, 1 failed, 0 skipped |
| 50 |
3 steps passed, 1 failed, 2 skipped, 0 undefined |
| 51 |
""" |
| 52 |
|
| 53 |
Scenario: First feature passes, second feature fails |
| 54 |
When I run "behave -f plain features/passing.feature features/failing.feature" |
| 55 |
Then it should fail with: |
| 56 |
""" |
| 57 |
1 feature passed, 1 failed, 0 skipped |
| 58 |
1 scenario passed, 1 failed, 0 skipped |
| 59 |
3 steps passed, 1 failed, 2 skipped, 0 undefined |
| 60 |
""" |
| 61 |
|
| 62 |
Scenario: First feature passes, second fails, last passes |
| 63 |
When I run "behave -f plain features/passing.feature features/failing.feature features/passing.feature" |
| 64 |
Then it should fail with: |
| 65 |
""" |
| 66 |
2 features passed, 1 failed, 0 skipped |
| 67 |
2 scenarios passed, 1 failed, 0 skipped |
| 68 |
6 steps passed, 1 failed, 2 skipped, 0 undefined |
| 69 |
""" |