@@ -27,7 +27,7 @@ Feature: Retry flaky tests
27
27
Scenario: Failing
28
28
Given a failing step
29
29
"""
30
- Given a file named "features/step_definitions/cucumber_steps.js" with:
30
+ And a file named "features/step_definitions/cucumber_steps.js" with:
31
31
"""
32
32
const {Given} = require('@cucumber/cucumber')
33
33
@@ -47,7 +47,7 @@ Feature: Retry flaky tests
47
47
Scenario: Failing
48
48
Given a failing step
49
49
"""
50
- Given a file named "features/step_definitions/cucumber_steps.js" with:
50
+ And a file named "features/step_definitions/cucumber_steps.js" with:
51
51
"""
52
52
const {Given} = require('@cucumber/cucumber')
53
53
@@ -67,7 +67,7 @@ Feature: Retry flaky tests
67
67
Scenario: Flaky
68
68
Given a flaky step
69
69
"""
70
- Given a file named "features/step_definitions/cucumber_steps.js" with:
70
+ And a file named "features/step_definitions/cucumber_steps.js" with:
71
71
"""
72
72
const {Given} = require('@cucumber/cucumber')
73
73
@@ -107,7 +107,7 @@ Feature: Retry flaky tests
107
107
Scenario: Flaky
108
108
Given a flaky step
109
109
"""
110
- Given a file named "features/step_definitions/cucumber_steps.js" with:
110
+ And a file named "features/step_definitions/cucumber_steps.js" with:
111
111
"""
112
112
const {Given} = require('@cucumber/cucumber')
113
113
@@ -149,7 +149,7 @@ Feature: Retry flaky tests
149
149
Scenario: Good
150
150
Given a good step
151
151
"""
152
- Given a file named "features/step_definitions/cucumber_steps.js" with:
152
+ And a file named "features/step_definitions/cucumber_steps.js" with:
153
153
"""
154
154
const {Given} = require('@cucumber/cucumber')
155
155
@@ -197,7 +197,7 @@ Feature: Retry flaky tests
197
197
Scenario: Good
198
198
Given a good step
199
199
"""
200
- Given a file named "features/step_definitions/cucumber_steps.js" with:
200
+ And a file named "features/step_definitions/cucumber_steps.js" with:
201
201
"""
202
202
const {Given} = require('@cucumber/cucumber')
203
203
@@ -246,7 +246,7 @@ Feature: Retry flaky tests
246
246
Scenario: Bad
247
247
Given a bad step
248
248
"""
249
- Given a file named "features/step_definitions/cucumber_steps.js" with:
249
+ And a file named "features/step_definitions/cucumber_steps.js" with:
250
250
"""
251
251
const {Given} = require('@cucumber/cucumber')
252
252
@@ -305,7 +305,7 @@ Feature: Retry flaky tests
305
305
Scenario: Failing
306
306
Given a failing step
307
307
"""
308
- Given a file named "features/step_definitions/cucumber_steps.js" with:
308
+ And a file named "features/step_definitions/cucumber_steps.js" with:
309
309
"""
310
310
const {Given} = require('@cucumber/cucumber')
311
311
@@ -330,7 +330,7 @@ Feature: Retry flaky tests
330
330
Scenario: Flaky
331
331
Given a flaky step
332
332
"""
333
- Given a file named "features/step_definitions/cucumber_steps.js" with:
333
+ And a file named "features/step_definitions/cucumber_steps.js" with:
334
334
"""
335
335
const {Given} = require('@cucumber/cucumber')
336
336
@@ -357,7 +357,7 @@ Feature: Retry flaky tests
357
357
Scenario: Flaky
358
358
Given a flaky step
359
359
"""
360
- Given a file named "features/step_definitions/cucumber_steps.js" with:
360
+ And a file named "features/step_definitions/cucumber_steps.js" with:
361
361
"""
362
362
const {Given} = require('@cucumber/cucumber')
363
363
@@ -386,7 +386,7 @@ Feature: Retry flaky tests
386
386
Scenario: Also Flaky
387
387
Given an other flaky step
388
388
"""
389
- Given a file named "features/step_definitions/cucumber_steps.js" with:
389
+ And a file named "features/step_definitions/cucumber_steps.js" with:
390
390
"""
391
391
const {Given} = require('@cucumber/cucumber')
392
392
@@ -430,7 +430,7 @@ Feature: Retry flaky tests
430
430
Scenario: Third Flaky
431
431
Given one more flaky step
432
432
"""
433
- Given a file named "features/step_definitions/cucumber_steps.js" with:
433
+ And a file named "features/step_definitions/cucumber_steps.js" with:
434
434
"""
435
435
const {Given} = require('@cucumber/cucumber')
436
436
@@ -479,7 +479,7 @@ Feature: Retry flaky tests
479
479
Scenario: Flaky
480
480
Given a flaky step
481
481
"""
482
- Given a file named "features/step_definitions/cucumber_steps.js" with:
482
+ And a file named "features/step_definitions/cucumber_steps.js" with:
483
483
"""
484
484
const {Before, After, Given, setWorldConstructor} = require('@cucumber/cucumber')
485
485
@@ -526,7 +526,7 @@ Feature: Retry flaky tests
526
526
Scenario: Passing
527
527
Given a passing step
528
528
"""
529
- Given a file named "features/step_definitions/cucumber_steps.js" with:
529
+ And a file named "features/step_definitions/cucumber_steps.js" with:
530
530
"""
531
531
const {Given} = require('@cucumber/cucumber')
532
532
@@ -558,7 +558,7 @@ Feature: Retry flaky tests
558
558
Scenario: Passing
559
559
Given a passing step
560
560
"""
561
- Given a file named "features/step_definitions/cucumber_steps.js" with:
561
+ And a file named "features/step_definitions/cucumber_steps.js" with:
562
562
"""
563
563
const {Given} = require('@cucumber/cucumber')
564
564
@@ -570,3 +570,31 @@ Feature: Retry flaky tests
570
570
And scenario "Failing" attempt 0 step "Given a failing step" has status "failed"
571
571
And scenario "Failing" attempt 1 step "Given a failing step" has status "failed"
572
572
And scenario "Passing" step "Given a passing step" has status "skipped"
573
+
574
+ Scenario : RerunFormatter does not report attempts that are retried
575
+ Given a file named "features/a.feature" with:
576
+ """
577
+ Feature:
578
+ Scenario: Flaky
579
+ Given a flaky step
580
+ """
581
+ And a file named "features/step_definitions/cucumber_steps.js" with:
582
+ """
583
+ const {Given} = require('@cucumber/cucumber')
584
+
585
+ let attemptCountdown = 2
586
+
587
+ Given(/^a flaky step$/, function() {
588
+ if (attemptCountdown == 0) {
589
+ return
590
+ }
591
+ attemptCountdown = attemptCountdown - 1
592
+ throw 'fail'
593
+ })
594
+ """
595
+ When I run cucumber-js with `--retry 1 --format rerun`
596
+ Then it outputs the text:
597
+ """
598
+ features/a.feature:2
599
+ """
600
+ And it fails
0 commit comments