Debian Codegraph @

features/directory_layout.basic2.feature

raw
1 Feature: Basic directory layout (Variant 1B)
2
3 As a story/test writer
4 I want a simple, non-deep directory structure
5 So that I can easily get an overview which stories/tests exist
6
7 . BASIC DIRECTORY LAYOUT STRUCTURE:
8 . testing/features/
9 . +-- steps/*.py # Step definitions or step-library imports.
10 . +-- *.feature # Feature files.
11 . +-- environment.py # OPTIONAL: environment setup/hooks.
12 .
13 . SEE ALSO:
14 . * http://pythonhosted.org/behave/gherkin.html#layout-variations
15
16
17 @setup
18 Scenario: Setup directory structure
19 Given a new working directory
20 And a file named "testing/features/steps/steps.py" with:
21 """
22 from behave import step
23
24 @step('{word:w} step passes')
25 def step_passes(context, word):
26 pass
27
28 @step('{word:w} step fails')
29 def step_fails(context, word):
30 assert False, "XFAIL-STEP"
31 """
32 And a file named "testing/features/alice.feature" with:
33 """
34 Feature: Alice
35 Scenario: A1
36 Given a step passes
37 When another step passes
38 Then a step passes
39 """
40 And a file named "testing/features/bob.feature" with:
41 """
42 Feature: Bob
43 Scenario: B1
44 When a step passes
45 Then another step passes
46 """
47
48
49 Scenario: Run behave with testing directory
50 When I run "behave -f progress testing/"
51 Then it should fail with:
52 """
53 ConfigError: No steps directory in '{__WORKDIR__}/testing'
54 """
55
56 Scenario: Run behave with feature subdirectory
57 When I run "behave -f progress testing/features/"
58 Then it should pass with:
59 """
60 2 features passed, 0 failed, 0 skipped
61 2 scenarios passed, 0 failed, 0 skipped
62 5 steps passed, 0 failed, 0 skipped, 0 undefined
63 """
64
65 Scenario: Run behave with one feature file
66 When I run "behave -f progress testing/features/alice.feature"
67 Then it should pass with:
68 """
69 1 feature passed, 0 failed, 0 skipped
70 1 scenario passed, 0 failed, 0 skipped
71 3 steps passed, 0 failed, 0 skipped, 0 undefined
72 """
73
74
75 Scenario: Run behave with two feature files
76 Given a file named "one.featureset" with:
77 """
78 testing/features/alice.feature
79 testing/features/bob.feature
80 """
81 When I run "behave -f progress @one.featureset"
82 Then it should pass with:
83 """
84 2 features passed, 0 failed, 0 skipped
85 2 scenarios passed, 0 failed, 0 skipped
86 5 steps passed, 0 failed, 0 skipped, 0 undefined
87 """