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

206
Visualizações
Cypress - Waiting on canceled XHR Request

I have the intended functionality of canceling a pending XHR request in the application. I want to verify that the request is canceled after invoking the cancel action.

Right now I have this:

cy.intercept('GET', '**/request/**').as('Request');
invokeRequest();
invokeCancel();
cy.wait('@Request');

However, cypress is timing out on the cy.wait(). Is there a way to verify the request has been canceled?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use should and validate

it('should use wait value', () => {
  cy.intercept('/todos').as('todos')
  cy.visit('/')
  cy.wait('@todos').should('include.all.keys', ['request', 'response'])
})

else you can use cy.route() instead of cy.intercept(). Refer this Has lot of examples: https://glebbahmutov.com/blog/cypress-intercept-problems/

about 4 years ago · Juan Pablo Isaza Relatório
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