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

164
Views
Why can't you intercept a future API call in Cypress.on('url:changed')
Cypress.on('url:changed', (url) => {
    if (!url.includes('something')) return;
    cy.intercept({
        method: 'GET',
        url,
    }).as('endpoint');
});

The above gives error

Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.

The command that returned the promise was:

cy.visit()

The cy command you invoked inside the promise was:

cy.intercept()

And fails. The code is run in support/index.js before everything else runs. I want to prepare the interceptor for future calls which will happen once a particular page opens. Anyone ever ran promises inside Cypress events?

about 4 years ago · Santiago Trujillo
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!