/
multistep.feature
163 lines (147 loc) · 4.17 KB
/
multistep.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
Feature: run features with nested steps
In order to test multisteps
As a test suite
I need to be able to execute multisteps
Scenario: should run passing multistep successfully
Given a feature "normal.feature" file:
"""
Feature: normal feature
Scenario: run passing multistep
Given passing step
Then passing multistep
"""
When I run feature suite
Then the suite should have passed
And the following steps should be passed:
"""
passing step
passing multistep
"""
Scenario: should fail multistep
Given a feature "failed.feature" file:
"""
Feature: failed feature
Scenario: run failing multistep
Given passing step
When failing multistep
Then I should have 1 scenario registered
"""
When I run feature suite
Then the suite should have failed
And the following step should be failed:
"""
failing multistep
"""
And the following steps should be skipped:
"""
I should have 1 scenario registered
"""
And the following steps should be passed:
"""
passing step
"""
Scenario: should fail nested multistep
Given a feature "failed.feature" file:
"""
Feature: failed feature
Scenario: run failing nested multistep
Given failing nested multistep
When passing step
"""
When I run feature suite
Then the suite should have failed
And the following step should be failed:
"""
failing nested multistep
"""
And the following steps should be skipped:
"""
passing step
"""
Scenario: should skip steps after undefined multistep
Given a feature "undefined.feature" file:
"""
Feature: run undefined multistep
Scenario: run undefined multistep
Given passing step
When undefined multistep
Then passing multistep
"""
When I run feature suite
Then the suite should have passed
And the following step should be passed:
"""
passing step
"""
And the following step should be undefined:
"""
undefined multistep
"""
And the following step should be skipped:
"""
passing multistep
"""
Scenario: should match undefined steps in a row
Given a feature "undefined.feature" file:
"""
Feature: undefined feature
Scenario: parse a scenario
Given undefined step
When undefined multistep
Then I should have 1 scenario registered
"""
When I run feature suite
Then the suite should have passed
And the following steps should be undefined:
"""
undefined step
undefined multistep
"""
And the following step should be skipped:
"""
I should have 1 scenario registered
"""
Scenario: should mark undefined steps after pending
Given a feature "pending.feature" file:
"""
Feature: pending feature
Scenario: parse a scenario
Given pending step
When undefined step
Then undefined multistep
And I should have 1 scenario registered
"""
When I run feature suite
Then the suite should have passed
And the following steps should be undefined:
"""
undefined step
undefined multistep
"""
And the following step should be pending:
"""
pending step
"""
And the following step should be skipped:
"""
I should have 1 scenario registered
"""
Scenario: context passed between steps
Given a feature "normal.feature" file:
"""
Feature: normal feature
Scenario: run passing multistep
Given I return a context from a step
Then I should see the context in the next step
"""
When I run feature suite
Then the suite should have passed
Scenario: context passed between steps
Given a feature "normal.feature" file:
"""
Feature: normal feature
Scenario: run passing multistep
Given I can see contexts passed in multisteps
"""
When I run feature suite
Then the suite should have passed