| 1 |
@issue |
| 2 |
Feature: Issue #40 Test Summary Scenario/Step Counts are incorrect for Scenario Outline |
| 3 |
|
| 4 |
As I user |
| 5 |
I want that each passed and each failed scenario is counted |
| 6 |
And I want that each passed and failed step in a ScenarioOutline is counted |
| 7 |
|
| 8 |
Background: Test Setup |
| 9 |
Given a new working directory |
| 10 |
And a file named "features/steps/steps.py" with: |
| 11 |
""" |
| 12 |
from behave import given, when, then |
| 13 |
|
| 14 |
@given(u'a step {outcome} with "{name}"') |
| 15 |
def step(context, outcome, name): |
| 16 |
context.name = name |
| 17 |
assert outcome == "passes" |
| 18 |
|
| 19 |
@when(u'a step {outcome} with "{name}"') |
| 20 |
def step(context, outcome, name): |
| 21 |
assert outcome == "passes" |
| 22 |
assert context.name == name |
| 23 |
|
| 24 |
@then(u'a step {outcome} with "{name}"') |
| 25 |
def step(context, outcome, name): |
| 26 |
assert outcome == "passes" |
| 27 |
assert context.name == name |
| 28 |
""" |
| 29 |
|
| 30 |
Scenario: ScenarioOutline with Passing Steps |
| 31 |
Given a file named "features/issue40_1.feature" with: |
| 32 |
""" |
| 33 |
Feature: Verify Scenario/Step Summary Pass Count with ScenarioOutline |
| 34 |
Scenario Outline: |
| 35 |
Given a step passes with "<name>" |
| 36 |
When a step passes with "<name>" |
| 37 |
Then a step passes with "<name>" |
| 38 |
|
| 39 |
Examples: |
| 40 |
|name | |
| 41 |
|Alice| |
| 42 |
|Bob | |
| 43 |
""" |
| 44 |
When I run "behave -c -f plain features/issue40_1.feature" |
| 45 |
Then it should pass with: |
| 46 |
""" |
| 47 |
2 scenarios passed, 0 failed, 0 skipped |
| 48 |
6 steps passed, 0 failed, 0 skipped, 0 undefined |
| 49 |
""" |
| 50 |
|
| 51 |
Scenario: ScenarioOutline with Failing Given-Steps |
| 52 |
Given a file named "features/issue40_2G.feature" with: |
| 53 |
""" |
| 54 |
Feature: Scenario/Step Summary Pass/Fail Count with ScenarioOutline |
| 55 |
Scenario Outline: |
| 56 |
Given a step fails with "<name>" |
| 57 |
When a step passes with "<name>" |
| 58 |
Then a step passes with "<name>" |
| 59 |
|
| 60 |
Examples: |
| 61 |
|name | |
| 62 |
|Alice| |
| 63 |
|Bob | |
| 64 |
""" |
| 65 |
When I run "behave -c -f plain features/issue40_2G.feature" |
| 66 |
Then it should fail with: |
| 67 |
""" |
| 68 |
0 scenarios passed, 2 failed, 0 skipped |
| 69 |
0 steps passed, 2 failed, 4 skipped, 0 undefined |
| 70 |
""" |
| 71 |
|
| 72 |
Scenario: ScenarioOutline with Failing When-Steps |
| 73 |
Given a file named "features/issue40_2W.feature" with: |
| 74 |
""" |
| 75 |
Feature: Scenario/Step Summary Pass/Fail Count with ScenarioOutline |
| 76 |
Scenario Outline: |
| 77 |
Given a step passes with "<name>" |
| 78 |
When a step fails with "<name>" |
| 79 |
Then a step passes with "<name>" |
| 80 |
|
| 81 |
Examples: |
| 82 |
|name | |
| 83 |
|Alice| |
| 84 |
|Bob | |
| 85 |
""" |
| 86 |
When I run "behave -c -f plain features/issue40_2W.feature" |
| 87 |
Then it should fail with: |
| 88 |
""" |
| 89 |
0 scenarios passed, 2 failed, 0 skipped |
| 90 |
2 steps passed, 2 failed, 2 skipped, 0 undefined |
| 91 |
""" |
| 92 |
|
| 93 |
Scenario: ScenarioOutline with Failing Then-Steps |
| 94 |
Given a file named "features/issue40_2T.feature" with: |
| 95 |
""" |
| 96 |
Feature: Scenario/Step Summary Pass/Fail Count with ScenarioOutline |
| 97 |
Scenario Outline: |
| 98 |
Given a step passes with "<name>" |
| 99 |
When a step passes with "<name>" |
| 100 |
Then a step fails with "<name>" |
| 101 |
|
| 102 |
Examples: |
| 103 |
|name | |
| 104 |
|Alice| |
| 105 |
|Bob | |
| 106 |
""" |
| 107 |
When I run "behave -c -f plain features/issue40_2T.feature" |
| 108 |
Then it should fail with: |
| 109 |
""" |
| 110 |
0 scenarios passed, 2 failed, 0 skipped |
| 111 |
4 steps passed, 2 failed, 0 skipped, 0 undefined |
| 112 |
""" |
| 113 |
|
| 114 |
Scenario: ScenarioOutline with Mismatched When-Step Example Row |
| 115 |
Given a file named "features/issue40_3W.feature" with: |
| 116 |
""" |
| 117 |
Feature: Scenario/Step Summary Pass/Fail Count with ScenarioOutline |
| 118 |
Scenario Outline: |
| 119 |
Given a step passes with "<name>" |
| 120 |
When a step passes with "Alice" |
| 121 |
Then a step passes with "<name>" |
| 122 |
|
| 123 |
Examples: |
| 124 |
|name | |
| 125 |
|Alice| |
| 126 |
|Bob | |
| 127 |
""" |
| 128 |
When I run "behave -c -f plain features/issue40_3W.feature" |
| 129 |
Then it should fail with: |
| 130 |
""" |
| 131 |
1 scenario passed, 1 failed, 0 skipped |
| 132 |
4 steps passed, 1 failed, 1 skipped, 0 undefined |
| 133 |
""" |
| 134 |
|
| 135 |
Scenario: ScenarioOutline with Mismatched Then-Step Example Row |
| 136 |
Given a file named "features/issue40_3W.feature" with: |
| 137 |
""" |
| 138 |
Feature: Scenario/Step Summary Pass/Fail Count with ScenarioOutline |
| 139 |
Scenario Outline: |
| 140 |
Given a step passes with "<name>" |
| 141 |
When a step passes with "<name>" |
| 142 |
Then a step passes with "Alice" |
| 143 |
|
| 144 |
Examples: |
| 145 |
|name | |
| 146 |
|Alice| |
| 147 |
|Bob | |
| 148 |
""" |
| 149 |
When I run "behave -c -f plain features/issue40_3W.feature" |
| 150 |
Then it should fail with: |
| 151 |
""" |
| 152 |
1 scenario passed, 1 failed, 0 skipped |
| 153 |
5 steps passed, 1 failed, 0 skipped, 0 undefined |
| 154 |
""" |