| 1 |
@issue |
| 2 |
Feature: Issue #99: Layout variation "a directory containing your feature files" is broken for running single features |
| 3 |
|
| 4 |
. When I use a layout as described in the 1.2.2 documentation, |
| 5 |
. I can only specify a whole directory of feature files to run. |
| 6 |
. Specifying a single feature file results in an error from behave: |
| 7 |
. |
| 8 |
. $ behave -v tests/feature/webui/features/feature_under_test.feature |
| 9 |
. ... |
| 10 |
. Supplied path: "tests/feature/webui/features/feature_under_test.feature" |
| 11 |
. Primary path is to a file so using its directory |
| 12 |
. Trying base directory: .../tests/feature/webui/features |
| 13 |
. Trying base directory: .../tests/feature/webui |
| 14 |
. ERROR: Could not find "steps" directory in your specified path '.../tests/feature/webui/features' |
| 15 |
. No steps directory in '.../tests/feature/webui/features' |
| 16 |
. |
| 17 |
. My directory layout is as follows: |
| 18 |
. |
| 19 |
. .../tests/feature/webui/ |
| 20 |
. +-- features/ |
| 21 |
. +-- steps/ |
| 22 |
. +-- environment.py |
| 23 |
. |
| 24 |
. SEE ALSO: |
| 25 |
. * http://packages.python.org/behave/gherkin.html#layout-variations |
| 26 |
|
| 27 |
|
| 28 |
Background: |
| 29 |
Given a new working directory |
| 30 |
And a file named "root/steps/steps.py" with: |
| 31 |
""" |
| 32 |
from behave import step |
| 33 |
|
| 34 |
@step(u'a step passes') |
| 35 |
def step_passes(context): |
| 36 |
pass |
| 37 |
""" |
| 38 |
And a file named "root/features/alice.feature" with: |
| 39 |
""" |
| 40 |
Feature: Alice |
| 41 |
Scenario: |
| 42 |
Given a step passes |
| 43 |
""" |
| 44 |
And a file named "root/features/bob.feature" with: |
| 45 |
""" |
| 46 |
Feature: Bob |
| 47 |
Scenario: |
| 48 |
Given a step passes |
| 49 |
""" |
| 50 |
And a file named "root/features2/charly.feature" with: |
| 51 |
""" |
| 52 |
Feature: Charly |
| 53 |
Scenario: |
| 54 |
When a step passes |
| 55 |
""" |
| 56 |
|
| 57 |
Scenario: Run features with root directory |
| 58 |
When I run "behave -f plain --no-timings root" |
| 59 |
Then it should pass with: |
| 60 |
""" |
| 61 |
3 features passed, 0 failed, 0 skipped |
| 62 |
3 scenarios passed, 0 failed, 0 skipped |
| 63 |
3 steps passed, 0 failed, 0 skipped, 0 undefined |
| 64 |
""" |
| 65 |
And the command output should contain: |
| 66 |
""" |
| 67 |
Feature: Alice |
| 68 |
Scenario: |
| 69 |
Given a step passes ... passed |
| 70 |
Feature: Bob |
| 71 |
Scenario: |
| 72 |
Given a step passes ... passed |
| 73 |
Feature: Charly |
| 74 |
Scenario: |
| 75 |
When a step passes ... passed |
| 76 |
""" |
| 77 |
|
| 78 |
Scenario: Run features with root/features directory |
| 79 |
When I run "behave -f plain --no-timings root/features" |
| 80 |
Then it should pass with: |
| 81 |
""" |
| 82 |
2 features passed, 0 failed, 0 skipped |
| 83 |
2 scenarios passed, 0 failed, 0 skipped |
| 84 |
2 steps passed, 0 failed, 0 skipped, 0 undefined |
| 85 |
""" |
| 86 |
And the command output should contain: |
| 87 |
""" |
| 88 |
Feature: Alice |
| 89 |
Scenario: |
| 90 |
Given a step passes ... passed |
| 91 |
Feature: Bob |
| 92 |
Scenario: |
| 93 |
Given a step passes ... passed |
| 94 |
""" |
| 95 |
|
| 96 |
Scenario: Run features with feature files |
| 97 |
When I run "behave -f plain --no-timings root/features/alice.feature root/features2/charly.feature" |
| 98 |
Then it should pass with: |
| 99 |
""" |
| 100 |
2 features passed, 0 failed, 0 skipped |
| 101 |
2 scenarios passed, 0 failed, 0 skipped |
| 102 |
2 steps passed, 0 failed, 0 skipped, 0 undefined |
| 103 |
""" |
| 104 |
And the command output should contain: |
| 105 |
""" |
| 106 |
Feature: Alice |
| 107 |
Scenario: |
| 108 |
Given a step passes ... passed |
| 109 |
Feature: Charly |
| 110 |
Scenario: |
| 111 |
When a step passes ... passed |
| 112 |
""" |
| 113 |
|
| 114 |
Scenario: Run features with feature dir and feature files (other ordering) |
| 115 |
When I run "behave -f plain --no-timings root/features2 root/features/alice.feature" |
| 116 |
Then it should pass with: |
| 117 |
""" |
| 118 |
2 features passed, 0 failed, 0 skipped |
| 119 |
2 scenarios passed, 0 failed, 0 skipped |
| 120 |
2 steps passed, 0 failed, 0 skipped, 0 undefined |
| 121 |
""" |
| 122 |
And the command output should contain: |
| 123 |
""" |
| 124 |
Feature: Charly |
| 125 |
Scenario: |
| 126 |
When a step passes ... passed |
| 127 |
Feature: Alice |
| 128 |
Scenario: |
| 129 |
Given a step passes ... passed |
| 130 |
""" |