| 1 |
@issue |
| 2 |
Feature: Issue #330: Skipped scenarios are included in junit reports when --no-skipped is used |
| 3 |
|
| 4 |
@setup |
| 5 |
Scenario: Feature Setup |
| 6 |
Given a new working directory |
| 7 |
And a file named "features/steps/steps.py" with: |
| 8 |
""" |
| 9 |
from behave import step |
| 10 |
|
| 11 |
@step('{word:w} step passes') |
| 12 |
def step_passes(context, word): |
| 13 |
pass |
| 14 |
""" |
| 15 |
And a file named "features/alice.feature" with: |
| 16 |
""" |
| 17 |
@tag1 |
| 18 |
Feature: Alice |
| 19 |
Scenario: Alice1 |
| 20 |
Given a step passes |
| 21 |
""" |
| 22 |
And a file named "features/bob.feature" with: |
| 23 |
""" |
| 24 |
Feature: Bob |
| 25 |
Scenario: Bob1 |
| 26 |
Given another step passes |
| 27 |
""" |
| 28 |
And a file named "features/charly.feature" with: |
| 29 |
""" |
| 30 |
Feature: Charly |
| 31 |
|
| 32 |
@tag1 |
| 33 |
Scenario: Charly1 |
| 34 |
Given some step passes |
| 35 |
|
| 36 |
Scenario: Charly2 |
| 37 |
When another step passes |
| 38 |
""" |
| 39 |
And a file named "alice_and_bob.featureset" with: |
| 40 |
""" |
| 41 |
features/alice.feature |
| 42 |
features/bob.feature |
| 43 |
""" |
| 44 |
And a file named "behave.ini" with: |
| 45 |
""" |
| 46 |
[behave] |
| 47 |
default_format = plain |
| 48 |
junit_directory = test_results |
| 49 |
|
| 50 |
[behave.userdata] |
| 51 |
behave.reporter.junit.show_timestamp = false |
| 52 |
behave.reporter.junit.show_hostname = false |
| 53 |
""" |
| 54 |
|
| 55 |
Scenario: Junit report for skipped feature is not created with --no-skipped |
| 56 |
When I run "behave --junit -t @tag1 --no-skipped @alice_and_bob.featureset" |
| 57 |
Then it should pass with: |
| 58 |
""" |
| 59 |
1 feature passed, 0 failed, 1 skipped |
| 60 |
""" |
| 61 |
And a file named "test_results/TESTS-alice.xml" exists |
| 62 |
And a file named "test_results/TESTS-bob.xml" does not exist |
| 63 |
And the command output should contain: |
| 64 |
""" |
| 65 |
Feature: Alice |
| 66 |
Scenario: Alice1 |
| 67 |
Given a step passes ... passed |
| 68 |
""" |
| 69 |
But the command output should not contain "Feature: Bob" |
| 70 |
And note that "bob.feature is skipped" |
| 71 |
|
| 72 |
|
| 73 |
Scenario: Junit report for skipped feature is created with --show-skipped |
| 74 |
When I run "behave --junit -t @tag1 --show-skipped @alice_and_bob.featureset" |
| 75 |
Then it should pass with: |
| 76 |
""" |
| 77 |
1 feature passed, 0 failed, 1 skipped |
| 78 |
""" |
| 79 |
And a file named "test_results/TESTS-alice.xml" exists |
| 80 |
And a file named "test_results/TESTS-bob.xml" exists |
| 81 |
And the file "test_results/TESTS-bob.xml" should contain: |
| 82 |
""" |
| 83 |
<testsuite errors="0" failures="0" name="bob.Bob" skipped="1" tests="1" time="0.0"> |
| 84 |
""" |
| 85 |
|
| 86 |
Scenario: Junit report for skipped scenario is neither shown nor counted with --no-skipped |
| 87 |
When I run "behave --junit -t @tag1 --no-skipped" |
| 88 |
Then it should pass with: |
| 89 |
""" |
| 90 |
2 features passed, 0 failed, 1 skipped |
| 91 |
2 scenarios passed, 0 failed, 2 skipped |
| 92 |
""" |
| 93 |
And a file named "test_results/TESTS-alice.xml" exists |
| 94 |
And a file named "test_results/TESTS-charly.xml" exists |
| 95 |
And the file "test_results/TESTS-charly.xml" should contain: |
| 96 |
""" |
| 97 |
<testsuite errors="0" failures="0" name="charly.Charly" skipped="0" tests="1" |
| 98 |
""" |
| 99 |
And the file "test_results/TESTS-charly.xml" should not contain: |
| 100 |
""" |
| 101 |
<testcase classname="charly.Charly" name="Charly2" |
| 102 |
""" |
| 103 |
And note that "Charly2 is the skipped scenarion in charly.feature" |
| 104 |
|
| 105 |
|
| 106 |
Scenario: Junit report for skipped scenario is shown and counted with --show-skipped |
| 107 |
When I run "behave --junit -t @tag1 --show-skipped" |
| 108 |
Then it should pass with: |
| 109 |
""" |
| 110 |
2 features passed, 0 failed, 1 skipped |
| 111 |
2 scenarios passed, 0 failed, 2 skipped |
| 112 |
""" |
| 113 |
And a file named "test_results/TESTS-alice.xml" exists |
| 114 |
And a file named "test_results/TESTS-charly.xml" exists |
| 115 |
And the file "test_results/TESTS-charly.xml" should contain: |
| 116 |
""" |
| 117 |
<testsuite errors="0" failures="0" name="charly.Charly" skipped="1" tests="2" |
| 118 |
""" |
| 119 |
And the file "test_results/TESTS-charly.xml" should contain: |
| 120 |
""" |
| 121 |
<testcase classname="charly.Charly" name="Charly2" status="skipped" |
| 122 |
""" |
| 123 |
And note that "Charly2 is the skipped scenarion in charly.feature" |
| 124 |
|