Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress retries on specific target #6931

Closed
ghost opened this issue Apr 3, 2020 · 1 comment
Closed

Cypress retries on specific target #6931

ghost opened this issue Apr 3, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 3, 2020

Current behavior:

I want a test to be retried if another fails, but with the steps left from the one that failed, so, to be more specific :

describe('Something', () => {
  Cypress.env('RETRIES', 3)

  it('x', () => {
    login()
   // Do something here that is necessary for the next test
  })

  it('y', () => {
    loginAsAnotherUser()
    //Test fails because of flakyness in CI, on different steps here, the retry will then come, after a timeout, but it will only retry this second test called 'y'
  })
})

Desired behavior:

describe('Something', () => {
  Cypress.env('RETRIES', 3)

  it('x', () => {
    login()
   // Do something here that is necceserary for the next test
  })

  it('y', () => {
    loginAsAnotherUser()
    //Test steps execute here, because the fleakyness of CI while running in parallel sometimes this test fails, random reassons, for different method calls. What I want is if anything from this 'y' test will fail, I want the test called 'x' test to execute again and then 'y' again. In this 'y' IT, so i won t have failing tests on my dashboard and I will manage a green pipeline if there are not any bugs,
  })
})

In short, because how my app is built, i always need to log in with different users at the beginning of each test (it). But the second test is dependent on the first one, if the second test fails, the retry will intervene , but with no actual impact, because retrying is redundant if prior test is not executed again. So if the second test fails, I want to point for the first test to retry ( I want to extrapolate this thinking to test suits that have over 10 tests, but for example purpose only I want an idea for this case with only 2 tests ). The main idea behind is that I will have more stability for my CI/CD.
Thank you very much guys

Cypress 4.2.0, MacOS->Catalina, Chrome

@jennifer-shehane
Copy link
Member

Test retries is not currently supported in Cypress (you're using cypress-plugin-retries to achieve this), but we are working on it as part of #1313 - I suggest you voice your wants for this implementation in that issue.

Duplicate of #1313

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

No branches or pull requests

1 participant