Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

161
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda