|
1 |
| -Feature: Gherkin features autoload |
2 |
| -'''''''''''''''''''''''''''''''''' |
3 |
| -
|
4 |
| -By default gherkin features are autoloaded and treated as usual pytest |
5 |
| -tests if are placed in the tests hierarchy proposed by pytest. This |
6 |
| -behavior could be disabled |
7 |
| -
|
8 |
| -Rule: Feature autoload |
9 |
| - |
10 |
| -
|
11 |
| -Background: |
12 |
| - |
13 |
| -
|
14 |
| -- Given File "Passing.feature" with content: |
15 |
| -
|
16 |
| - .. code:: gherkin |
17 |
| -
|
18 |
| - Feature: Passing feature |
19 |
| - Scenario: Passing scenario |
20 |
| - * Passing step |
21 |
| -
|
22 |
| -- Given File "Another.passing.feature.md" with content: |
23 |
| -
|
24 |
| - .. code:: markdown |
25 |
| -
|
26 |
| - # Feature: Passing feature |
27 |
| - ## Scenario: Passing scenario |
28 |
| - * Given Passing step |
29 |
| -
|
30 |
| -- Given Install npm packages |
31 |
| -
|
32 |
| - ======== ================= |
33 |
| - packages @cucumber/gherkin |
34 |
| - ======== ================= |
35 |
| - ======== ================= |
36 |
| -
|
37 |
| -- Given File "conftest.py" with content: |
38 |
| -
|
39 |
| - .. code:: python |
40 |
| -
|
41 |
| - from pytest_bdd import step |
42 |
| -
|
43 |
| - @step('Passing step') |
44 |
| -
|
45 |
| - def _(): |
46 |
| - ... |
47 |
| -
|
48 |
| -Scenario: Feature is loaded by default |
49 |
| - |
50 |
| -
|
51 |
| -- When run pytest |
52 |
| -- Then pytest outcome must contain tests with statuses: |
53 |
| -
|
54 |
| - +--------+ |
55 |
| - | passed | |
56 |
| - +========+ |
57 |
| - | 2 | |
58 |
| - +--------+ |
59 |
| -
|
60 |
| -Scenario: Feature autoload could be disabled via command line |
61 |
| - |
62 |
| -
|
63 |
| -- When run pytest |
64 |
| -
|
65 |
| - ======== ========================== |
66 |
| - cli_args --disable-feature-autoload |
67 |
| - ======== ========================== |
68 |
| - ======== ========================== |
69 |
| -
|
70 |
| -- Then pytest outcome must contain tests with statuses: |
71 |
| -
|
72 |
| - +--------+ |
73 |
| - | passed | |
74 |
| - +========+ |
75 |
| - | 0 | |
76 |
| - +--------+ |
77 |
| -
|
78 |
| -Scenario: Feature autoload could be disabled via pytest.ini |
79 |
| - |
80 |
| -
|
81 |
| -- Given Set pytest.ini content to: |
82 |
| -
|
83 |
| - .. code:: ini |
84 |
| -
|
85 |
| - [pytest] |
86 |
| - disable_feature_autoload=true |
87 |
| -
|
88 |
| -- When run pytest |
89 |
| -
|
90 |
| -- Then pytest outcome must contain tests with statuses: |
91 |
| -
|
92 |
| - +--------+ |
93 |
| - | passed | |
94 |
| - +========+ |
95 |
| - | 0 | |
96 |
| - +--------+ |
| 1 | +Feature: Gherkin features autoload |
| 2 | +'''''''''''''''''''''''''''''''''' |
| 3 | + |
| 4 | +By default gherkin features are autoloaded and treated as usual pytest |
| 5 | +tests if are placed in the tests hierarchy proposed by pytest. This |
| 6 | +behavior could be disabled |
| 7 | + |
| 8 | +Rule: Feature autoload |
| 9 | + |
| 10 | + |
| 11 | +Background: |
| 12 | + |
| 13 | + |
| 14 | +- Given File "Passing.feature" with content: |
| 15 | + |
| 16 | + .. code:: gherkin |
| 17 | +
|
| 18 | + Feature: Passing feature |
| 19 | + Scenario: Passing scenario |
| 20 | + * Passing step |
| 21 | +
|
| 22 | +- Given File "Another.passing.feature.md" with content: |
| 23 | + |
| 24 | + .. code:: markdown |
| 25 | +
|
| 26 | + # Feature: Passing feature |
| 27 | + ## Scenario: Passing scenario |
| 28 | + * Given Passing step |
| 29 | +
|
| 30 | +- Given Install npm packages |
| 31 | + |
| 32 | + ======== ================= |
| 33 | + packages @cucumber/gherkin |
| 34 | + ======== ================= |
| 35 | + ======== ================= |
| 36 | + |
| 37 | +- Given File "conftest.py" with content: |
| 38 | + |
| 39 | + .. code:: python |
| 40 | +
|
| 41 | + from pytest_bdd import step |
| 42 | +
|
| 43 | + @step('Passing step') |
| 44 | +
|
| 45 | + def _(): |
| 46 | + ... |
| 47 | +
|
| 48 | +Scenario: Feature is loaded by default |
| 49 | + |
| 50 | + |
| 51 | +- When run pytest |
| 52 | +- Then pytest outcome must contain tests with statuses: |
| 53 | + |
| 54 | + +--------+ |
| 55 | + | passed | |
| 56 | + +========+ |
| 57 | + | 2 | |
| 58 | + +--------+ |
| 59 | + |
| 60 | +Scenario: Feature autoload could be disabled via command line |
| 61 | + |
| 62 | + |
| 63 | +- When run pytest |
| 64 | + |
| 65 | + ======== ========================== |
| 66 | + cli_args --disable-feature-autoload |
| 67 | + ======== ========================== |
| 68 | + ======== ========================== |
| 69 | + |
| 70 | +- Then pytest outcome must contain tests with statuses: |
| 71 | + |
| 72 | + +--------+ |
| 73 | + | passed | |
| 74 | + +========+ |
| 75 | + | 0 | |
| 76 | + +--------+ |
| 77 | + |
| 78 | +Scenario: Feature autoload could be disabled via pytest.ini |
| 79 | + |
| 80 | + |
| 81 | +- Given Set pytest.ini content to: |
| 82 | + |
| 83 | + .. code:: ini |
| 84 | +
|
| 85 | + [pytest] |
| 86 | + disable_feature_autoload=true |
| 87 | +
|
| 88 | +- When run pytest |
| 89 | + |
| 90 | +- Then pytest outcome must contain tests with statuses: |
| 91 | + |
| 92 | + +--------+ |
| 93 | + | passed | |
| 94 | + +========+ |
| 95 | + | 0 | |
| 96 | + +--------+ |
0 commit comments