Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
How to reload the first test case if it fails in cypress

Every feature test case starts with landing page testing in cypress.

We are witnessing failures here because of network connectivity issues.

it('should load home page', () => {
    cy.waitUntil(() =>
      cy.contains('Home', { timeout: 500000 }).should('exist')
    );
  });

So, is there a way to reload this test case if it fails once or twice and avoid recursion?

I suspect retries will work here, if so how can we configure it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use Test Retries. You can add it to Test Suite Level, Test Case level or globally as well. The test will be re-triggered in case of failures.

runMode works for headless. openMode for test runner. You can add both of them followed by how many times you want to retry them. So 2 means, once after the test failed, the test will be re-executed 2 times until the test passes, So if the test passes in the first re-execution, the second re-execution will not happen.

it(
  'should load home page',
  {
    retries: {
      runMode: 2,
      openMode: 1,
    },
  },
  () => {
    cy.waitUntil(() => cy.contains('Home', {timeout: 500000}).should('exist'))
  }
)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!