CypressError: Timed out retrying after 60000ms: `cy.wait()` timed out waiting `60000ms` for the 1st response to the route:

1k Views Asked by At

I'm practicing documentation example of intercept and then used wait alias of intercept but it's giving this error:

CypressError: Timed out retrying after 60000ms: `cy.wait()` timed out waiting `60000ms` for the 1st response to the route: `login`. No response ever occurred.

Mine code:

it("Should redirect to '/school-admin' if School Admin is authenticated", () => {
    cy.intercept('POST', `**/auth/local`).as('login')
    cy.visit('/')
    cy.get(textboxSelector).click()
    cy.wait('@login').then(interceptions => {
     expect(interceptions.response.statusCode).to.equal(200)
    })
  })

Also, tried following code but it the same result:

it("Should redirect to '/school-admin' if School Admin is authenticated", () => {
    cy.intercept('POST', `**/auth/local`).as('login')
    cy.visit('/')
    cy.get(textboxSelector)
      .click()
      .wait('@login').then(interceptions => {
         expect(interceptions.response.statusCode).to.equal(200)
    })
  })

Locally works perfect, but when GH actions starting work - tests were failing randomly but the error remains the same.

Cypress v9.6.0 but also tried with v10 as well

0

There are 0 best solutions below