Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Retry only if specific error happens? #54

Open
Jacek-fstack opened this issue Mar 12, 2020 · 1 comment
Open

Retry only if specific error happens? #54

Jacek-fstack opened this issue Mar 12, 2020 · 1 comment

Comments

@Jacek-fstack
Copy link

Hello!
I have a case in which tests fail once every 100-300 runs because the "load" event was not fired. This is some cypress bug that's not going to be fixed any time soon as there is no 'reliable way to reproduce it'.
So - is there an option with retries plugin that I would wrap only the initial cy.visit to be retried if it fails?
I don't want to retry all tests, because we need to see 'flakes', but there's nothing we can do about that bug for now.
Thank you!

@kuceb
Copy link
Owner

kuceb commented Mar 13, 2020

you might be able to listen on the 'fail' event and if the error matches your criteria, set Cypress.currentTest.retries(1)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants