| 1 |
@issue |
| 2 |
@feature_request |
| 3 |
Feature: Issue #238 Skip a Scenario in a Scenario Outline |
| 4 |
|
| 5 |
Scenario: |
| 6 |
Given a new working directory |
| 7 |
And a file named "features/issue238_1.feature" with: |
| 8 |
""" |
| 9 |
Feature: Testing Scenario skipping |
| 10 |
Scenario Outline: |
| 11 |
Given a set of "<thing>" |
| 12 |
When I ensure that "<thing>" != invalid |
| 13 |
Then it should pass |
| 14 |
|
| 15 |
Examples: |
| 16 |
| thing | |
| 17 |
| valid | |
| 18 |
| invalid | |
| 19 |
""" |
| 20 |
And a file named "features/steps/steps.py" with: |
| 21 |
""" |
| 22 |
@given('a set of "{thing}"') |
| 23 |
def step_check_thing_assumption(ctx, thing): |
| 24 |
if thing == "invalid": |
| 25 |
ctx.scenario.skip("ASSUMPTION-MISMATCH: INVALID-THING") |
| 26 |
|
| 27 |
@when('I ensure that "{thing}" != invalid') |
| 28 |
def step_ensure_that_thing_is_valid(ctx, thing): |
| 29 |
assert thing != "invalid" |
| 30 |
|
| 31 |
@then('it should pass') |
| 32 |
def step_passes(context): |
| 33 |
pass |
| 34 |
""" |
| 35 |
When I run "behave -f plain --show-skipped --no-timings" |
| 36 |
Then it should pass with: |
| 37 |
""" |
| 38 |
1 feature passed, 0 failed, 0 skipped |
| 39 |
1 scenario passed, 0 failed, 1 skipped |
| 40 |
3 steps passed, 0 failed, 3 skipped, 0 undefined |
| 41 |
""" |
| 42 |
And the command output should contain: |
| 43 |
""" |
| 44 |
Scenario Outline: -- @1.1 |
| 45 |
Given a set of "valid" ... passed |
| 46 |
When I ensure that "valid" != invalid ... passed |
| 47 |
Then it should pass ... passed |
| 48 |
|
| 49 |
Scenario Outline: -- @1.2 |
| 50 |
Given a set of "invalid" ... skipped |
| 51 |
""" |
| 52 |
But note that "the step that skipped the scenario is also marked as skipped" |