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

154
Vistas
Testcafe - Wait for an HTTP call to respond without waiting for an arbitrary period of time

In my project, I have a suite of end-to-end tests created using testcafe.

Context

In some scenarios, the user/script has to do some operations on the page, like clicking on a button, that triggers an HTTP call to the BE to fetch some result.
Since it's an async operation (that can take a bit of time) I'm forced to put a wait(X) to be sure that the HTTP call has responded.

For example:

test("should render result with ascending order when lowerPrice option got selected", async (t) => {
  const sortButton = Selector(".sortsortButton");
  const lowerPriceSortSelector = Selector(".lowerPriceSortSelector");
  const gridResult = Selector(".gridResult");

  await t
    .click(sortButton)
    .click(lowerPriceSortSelector)
    .wait(5000) //<--- I want to avoid this!
    .expect(gridResult.exists).ok();
});

I've checked but in the documentation, I haven't found any utility that allows waiting until a given route has replied.

How Cypress handle it

In the past, I've played with Cypress and there was this awesome feature: https://docs.cypress.io/api/commands/wait#Alias

// Wait for the route aliased as 'getAccount' to respond
// without changing or stubbing its response
cy.intercept('/accounts/*').as('getAccount')
cy.visit('/accounts/123')
cy.wait('@getAccount').then((interception) => {
  // we can now access the low level interception
  // that contains the request body,
  // response body, status, etc
})

Questions

There is anything similar in Testcafe?
If not, how can I do to avoid waiting an arbitrary period of time?

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