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

161
Vistas
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
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