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

113
Vistas
Test freezes after applying bypass for browser tab issue

Due to Cypress' inability to access browser tab, I have to use one of recommended bypasses: my test changes target attribute of the link from target: "_blank" to target: "_self". After clicking the link the target page is open in the same tab as expected, but the test freezes without any notification and stops working. The browser window can't be closed by clicking "X" button. The test can be interrupted with Stop button of the Test runner only. Is there any solution for this issue?

I need to add something important to this question: it looks like the reason is that after the page is open and verified by the test, the next test following it tries to navigate back to the page from where the previous test was redirected to the target page and this cy.visit() command freezes this test. Visually there is no any navigation occurred.

Actually I have 2 tests and each of them works fine (e.g. if you use "only" flag for any of them), but if you run the both does not matter in which order, the second test freezes:

it('The first test', () => {
        cy.visit(startPageUrl);
        // Redirect to page 1
        cy.get(linkSelector1).invoke('removeAttr', 'target').click()
        cy.get(selectorOfTheElementToBeAssertedOnThePage1).should('be.visible');
})

it('The second test', () => {
        cy.visit(startPageUrl); // The test freezes here
        // Redirect to page 2
        cy.get(linkSelector1).invoke('removeAttr', 'target').click()
        cy.get(selectorOfTheElementToBeAssertedOnThePage2).should('be.visible');
})
about 4 years ago · Juan Pablo Isaza
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