Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

112
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda