1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
@issue
Feature: Issue #35 Plain Formatter shows wrong steps when tag-selection is used
Background: Test Setup
Given a new working directory
And a file named "features/steps/steps.py" with:
"""
from behave import given, when, then
@given(u'the ninja has a third level black-belt')
def step(context):
pass
@when(u'attacked by {opponent}')
def step(context, opponent):
pass
@then(u'the ninja should {reaction}')
def step(context, reaction):
pass
"""
And a file named "features/issue35_1.feature" with:
"""
Feature: Using Tags with Features and Scenarios
@one
Scenario: Weaker opponent
Given the ninja has a third level black-belt
When attacked by a samurai
Then the ninja should engage the opponent
@two
Scenario: Stronger opponent
Given the ninja has a third level black-belt
When attacked by Chuck Norris
Then the ninja should run for his life
"""
Scenario: Select First Scenario with Tag
When I run "behave --no-timings -f plain --tags=@one features/issue35_1.feature"
Then it should pass with:
"""
1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 1 skipped
3 steps passed, 0 failed, 3 skipped, 0 undefined
"""
And the command output should contain:
"""
Feature: Using Tags with Features and Scenarios
Scenario: Weaker opponent
Given the ninja has a third level black-belt ... passed
When attacked by a samurai ... passed
Then the ninja should engage the opponent ... passed
Scenario: Stronger opponent
"""
Scenario: Select Second Scenario with Tag
When I run "behave --no-timings -f plain --tags=@two features/issue35_1.feature"
Then it should pass with:
"""
1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 1 skipped
3 steps passed, 0 failed, 3 skipped, 0 undefined
"""
And the command output should contain:
"""
Feature: Using Tags with Features and Scenarios
Scenario: Weaker opponent
Scenario: Stronger opponent
Given the ninja has a third level black-belt ... passed
When attacked by Chuck Norris ... passed
Then the ninja should run for his life ... passed
"""
|