Skip to content

Commit 0efda3f

Browse files
jsa34youtux
authored andcommitted
Add test for json correctly populating the description from a feature
1 parent be83407 commit 0efda3f

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

tests/feature/test_cucumber_json.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def test_step_trace(pytester):
5151
"""
5252
@feature-tag
5353
Feature: One passing scenario, one failing scenario
54+
This is a feature description
5455
5556
@scenario-passing-tag
5657
Scenario: Passing
@@ -116,108 +117,108 @@ def test_passing_outline():
116117
assert result.ret
117118
expected = [
118119
{
119-
"description": "",
120+
"description": "This is a feature description",
120121
"elements": [
121122
{
122123
"description": "",
123124
"id": "test_passing",
124125
"keyword": "Scenario",
125-
"line": 5,
126+
"line": 6,
126127
"name": "Passing",
127128
"steps": [
128129
{
129130
"keyword": "Given",
130-
"line": 6,
131+
"line": 7,
131132
"match": {"location": ""},
132133
"name": "a passing step",
133134
"result": {"status": "passed", "duration": OfType(int)},
134135
},
135136
{
136137
"keyword": "And",
137-
"line": 7,
138+
"line": 8,
138139
"match": {"location": ""},
139140
"name": "some other passing step",
140141
"result": {"status": "passed", "duration": OfType(int)},
141142
},
142143
],
143-
"tags": [{"name": "scenario-passing-tag", "line": 4}],
144+
"tags": [{"name": "scenario-passing-tag", "line": 5}],
144145
"type": "scenario",
145146
},
146147
{
147148
"description": "",
148149
"id": "test_failing",
149150
"keyword": "Scenario",
150-
"line": 10,
151+
"line": 11,
151152
"name": "Failing",
152153
"steps": [
153154
{
154155
"keyword": "Given",
155-
"line": 11,
156+
"line": 12,
156157
"match": {"location": ""},
157158
"name": "a passing step",
158159
"result": {"status": "passed", "duration": OfType(int)},
159160
},
160161
{
161162
"keyword": "And",
162-
"line": 12,
163+
"line": 13,
163164
"match": {"location": ""},
164165
"name": "a failing step",
165166
"result": {"error_message": OfType(str), "status": "failed", "duration": OfType(int)},
166167
},
167168
],
168-
"tags": [{"name": "scenario-failing-tag", "line": 9}],
169+
"tags": [{"name": "scenario-failing-tag", "line": 10}],
169170
"type": "scenario",
170171
},
171172
{
172173
"description": "",
173174
"keyword": "Scenario Outline",
174-
"tags": [{"line": 14, "name": "scenario-outline-passing-tag"}],
175+
"tags": [{"line": 15, "name": "scenario-outline-passing-tag"}],
175176
"steps": [
176177
{
177-
"line": 16,
178+
"line": 17,
178179
"match": {"location": ""},
179180
"result": {"status": "passed", "duration": OfType(int)},
180181
"keyword": "Given",
181182
"name": "type str and value hello",
182183
}
183184
],
184-
"line": 15,
185+
"line": 16,
185186
"type": "scenario",
186187
"id": "test_passing_outline[str-hello]",
187188
"name": "Passing outline",
188189
},
189190
{
190191
"description": "",
191192
"keyword": "Scenario Outline",
192-
"tags": [{"line": 14, "name": "scenario-outline-passing-tag"}],
193+
"tags": [{"line": 15, "name": "scenario-outline-passing-tag"}],
193194
"steps": [
194195
{
195-
"line": 16,
196+
"line": 17,
196197
"match": {"location": ""},
197198
"result": {"status": "passed", "duration": OfType(int)},
198199
"keyword": "Given",
199200
"name": "type int and value 42",
200201
}
201202
],
202-
"line": 15,
203+
"line": 16,
203204
"type": "scenario",
204205
"id": "test_passing_outline[int-42]",
205206
"name": "Passing outline",
206207
},
207208
{
208209
"description": "",
209210
"keyword": "Scenario Outline",
210-
"tags": [{"line": 14, "name": "scenario-outline-passing-tag"}],
211+
"tags": [{"line": 15, "name": "scenario-outline-passing-tag"}],
211212
"steps": [
212213
{
213-
"line": 16,
214+
"line": 17,
214215
"match": {"location": ""},
215216
"result": {"status": "passed", "duration": OfType(int)},
216217
"keyword": "Given",
217218
"name": "type float and value 1.0",
218219
}
219220
],
220-
"line": 15,
221+
"line": 16,
221222
"type": "scenario",
222223
"id": "test_passing_outline[float-1.0]",
223224
"name": "Passing outline",

0 commit comments

Comments
 (0)