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

202
Views
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 answers
Answer question

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 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!