Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retries with Cypress Cucumber

Could you advice how to retry Scenario in Cypress Cucumber if it fails? If I use for ex. retries:2 in cypress.json, and two test scenarios, when the first scenario fails it retries only the second scenario.

like image 738
JohnPix Avatar asked Oct 28 '25 01:10

JohnPix


2 Answers

cypress-cucumber-preprocessor doesn't have that feature till now. However, you can try Cytorus in this case. This is the example to make a scenario retriable.

#> retries: 2
Scenario: This is a scenario
    Given I access a site on slow network
    Then it opens

Ref: cytorus docs

like image 192
Aman Garg Avatar answered Oct 29 '25 16:10

Aman Garg


This is now allowed in the latest @Badeball/cypress-cucumber-preprocessor using a standard tag for a Scenario: @retries(5)

https://github.com/badeball/cypress-cucumber-preprocessor

https://github.com/badeball/cypress-cucumber-preprocessor/commit/760342adcefee8deae07f37e637cab4b27045464#diff-eb46c03cad007b07552d9f839954807d38a5a9227c3cd156f55a076afee58250R18

like image 38
Phillip Patton Avatar answered Oct 29 '25 15:10

Phillip Patton