Skip to content

Commit 89c67d6

Browse files
committed
Correctly handle retrying
This fixes #749.
1 parent 0101533 commit 89c67d6

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

features/issues/749.feature

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# https://github.com/badeball/cypress-cucumber-preprocessor/issues/749
2+
3+
Feature: retried steps
4+
Scenario: forever failing
5+
Given additional Cypress configuration
6+
"""
7+
{
8+
"retries": 2
9+
}
10+
"""
11+
And a file named "cypress/e2e/a.feature" with:
12+
"""
13+
Feature: a feature
14+
Scenario: a scenario
15+
Given a failing step
16+
"""
17+
And a file named "cypress/support/step_definitions/steps.js" with:
18+
"""
19+
const { Given } = require("@badeball/cypress-cucumber-preprocessor");
20+
Given("a failing step", function() {
21+
throw "some error"
22+
})
23+
"""
24+
When I run cypress
25+
Then it fails

lib/create-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ export default function createTests(
735735
* Repopulate internal properties in case previous test is retried.
736736
*/
737737
properties.testCaseStartedId = uuid();
738-
properties.remainingSteps = properties.allSteps;
738+
properties.remainingSteps = [...properties.allSteps];
739739
});
740740

741741
after(function () {

0 commit comments

Comments
 (0)