-
-
Notifications
You must be signed in to change notification settings - Fork 695
/
cucumber_cli.feature
478 lines (366 loc) · 10.6 KB
/
cucumber_cli.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
Feature: Cucumber command line
In order to write better software
Developers should be able to execute requirements as tests
Scenario: Run single scenario with missing step definition
When I run cucumber -q features/sample.feature:5
Then it should pass with
"""
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
1 scenario
1 undefined step
"""
Scenario: Fail with --strict
When I run cucumber -q features/sample.feature:5 --strict
Then it should fail with
"""
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
Undefined step: "missing" (Cucumber::Undefined)
features/sample.feature:6:in `Given missing'
1 scenario
1 undefined step
"""
Scenario: Succeed with --strict
When I run cucumber -q features/sample.feature:9 --strict
Then it should pass with
"""
@one
Feature: Sample
@three
Scenario: Passing
Given passing
| a | b |
| c | d |
1 scenario
1 passed step
"""
Scenario: Specify 2 line numbers where one is a tag
When I run cucumber -q features/sample.feature:5:14
Then it should fail with
"""
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
@four
Scenario: Failing
Given failing
\"\"\"
hello
\"\"\"
FAIL (RuntimeError)
./features/step_definitions/sample_steps.rb:2:in `flunker'
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
features/sample.feature:16:in `Given failing'
2 scenarios
1 failed step
1 undefined step
"""
Scenario: Require missing step definition from elsewhere
When I run cucumber -q -r ../../features/step_definitions/extra_steps.rb features/sample.feature:5
Then it should pass with
"""
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
1 scenario
1 passed step
"""
Scenario: Specify the line number of a row
When I run cucumber -q features/sample.feature:12
Then it should pass with
"""
@one
Feature: Sample
@three
Scenario: Passing
Given passing
| a | b |
| c | d |
1 scenario
1 passed step
"""
Scenario: Run all with progress formatter
When I run cucumber -q --format progress features/sample.feature
Then it should fail with
"""
U.F
(::) failed steps (::)
FAIL (RuntimeError)
./features/step_definitions/sample_steps.rb:2:in `flunker'
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
features/sample.feature:16:in `Given failing'
3 scenarios
1 failed step
1 undefined step
1 passed step
"""
Scenario: Run Norwegian
Given I am in i18n/no
When I run cucumber -q --language no features
Then it should pass with
"""
Egenskap: Summering
For å slippe å gjøre dumme feil
Som en regnskapsfører
Vil jeg kunne legge sammen
Scenario: to tall
Gitt at jeg har tastet inn 5
Og at jeg har tastet inn 7
Når jeg summerer
Så skal resultatet være 12
@iterasjon3
Scenario: tre tall
Gitt at jeg har tastet inn 5
Og at jeg har tastet inn 7
Og at jeg har tastet inn 1
Når jeg summerer
Så skal resultatet være 13
2 scenarios
9 passed steps
"""
Scenario: --dry-run
When I run cucumber --dry-run --no-snippets features/*.feature --tags ~@lots
Then it should pass with
"""
Feature: Calling undefined step
Scenario: Call directly
Given a step definition that calls an undefined step
Scenario: Call via another
Given call step "a step definition that calls an undefined step"
Feature: Failing expectation
Scenario: Failing expectation
Given failing expectation
Feature: Lots of undefined
Scenario: Implement me
Given it snows in Sahara
Given it's 40 degrees in Norway
And it's 40 degrees in Norway
When I stop procrastinating
And there is world peace
Feature: multiline
Background: I'm a multiline name
which goes on and on and on for three lines
yawn
Given passing without a table
Scenario: I'm a multiline name
which goes on and on and on for three lines
yawn
Given passing without a table
Scenario Outline: I'm a multiline name
which goes on and on and on for three lines
yawn
Given <state> without a table
Examples:
| state |
| passing |
Scenario Outline: name
Given <state> without a table
Examples: I'm a multiline name
which goes on and on and on for three lines
yawn
| state |
| passing |
Feature: Outline Sample
Scenario: I have no steps
Scenario Outline: Test state
Given <state> without a table
Given <other_state> without a table
Examples: Rainbow colours
| state | other_state |
| missing | passing |
| passing | passing |
| failing | passing |
Examples: Only passing
| state | other_state |
| passing | passing |
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
@three
Scenario: Passing
Given passing
| a | b |
| c | d |
@four
Scenario: Failing
Given failing
\"\"\"
hello
\"\"\"
Feature: search examples
Background: Hantu Pisang background match
Given passing without a table
Scenario: should match Hantu Pisang
Given passing without a table
Scenario: Ignore me
Given failing without a table
Scenario Outline: Ignore me
Given <state> without a table
Examples:
| state |
| failing |
Scenario Outline: Hantu Pisang match
Given <state> without a table
Examples:
| state |
| passing |
Feature: undefined multiline args
Scenario: pystring
Given a pystring
\"\"\"
example
\"\"\"
Scenario: table
Given a table
| table |
| example |
21 scenarios
26 skipped steps
9 undefined steps
"""
Scenario: Multiple formatters and outputs
When I run cucumber --format progress --out tmp/progress.txt --format pretty --out tmp/pretty.txt --dry-run features/lots_of_undefined.feature
And "examples/self_test/tmp/progress.txt" should contain
"""
UUUUU
1 scenario
5 undefined steps
"""
And "examples/self_test/tmp/pretty.txt" should match
"""
Feature: Lots of undefined
Scenario: Implement me
Given it snows in Sahara
Given it's 40 degrees in Norway
And it's 40 degrees in Norway
When I stop procrastinating
And there is world peace
1 scenario
5 undefined steps
"""
Scenario: Run feature elements which matches a name using --name
When I run cucumber --name Pisang -q features/
Then it should pass with
"""
Feature: search examples
Background: Hantu Pisang background match
Given passing without a table
Scenario: should match Hantu Pisang
Given passing without a table
Scenario Outline: Hantu Pisang match
Given <state> without a table
Examples:
| state |
| passing |
2 scenarios
4 passed steps
"""
Scenario: Run a single background which matches a name using --name
When I run cucumber --name 'Hantu Pisang background' -q features/
Then it should pass with
"""
Feature: search examples
Background: Hantu Pisang background match
Given passing without a table
0 scenarios
1 passed step
"""
Scenario: Run with a tag that exists on 2 scenarios
When I run cucumber -q features --tags three
Then it should pass with
"""
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
@three
Scenario: Passing
Given passing
| a | b |
| c | d |
2 scenarios
1 undefined step
1 passed step
"""
Scenario: Run with a tag that exists on 1 feature
When I run cucumber -q features --tags one
Then it should fail with
"""
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
@three
Scenario: Passing
Given passing
| a | b |
| c | d |
@four
Scenario: Failing
Given failing
\"\"\"
hello
\"\"\"
FAIL (RuntimeError)
./features/step_definitions/sample_steps.rb:2:in `flunker'
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
features/sample.feature:16:in `Given failing'
3 scenarios
1 failed step
1 undefined step
1 passed step
"""
Scenario: Run with a negative tag
When I run cucumber -q features/sample.feature --dry-run -t ~four
Then it should pass with
"""
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
@three
Scenario: Passing
Given passing
| a | b |
| c | d |
2 scenarios
1 skipped step
1 undefined step
"""
Scenario: Reformat files with --autoformat
When I run cucumber --autoformat tmp/formatted features
Then "examples/self_test/tmp/formatted/features/sample.feature" should contain
"""
@one
Feature: Sample
@two @three
Scenario: Missing
Given missing
@three
Scenario: Passing
Given passing
| a | b |
| c | d |
@four
Scenario: Failing
Given failing
\"\"\"
hello
\"\"\"
"""