jeudi 8 avril 2021

Change Cypress to wait more than 20s in a response

I'm trying to prepare a test that's capable to wait more than 20s for a response. But even if i try to set timeout on wait() function, it doesn't respect the option.

cy.visit('http:site')
cy.intercept('GET', '**/slowEndpoint**').as('slow')

cy.get('[data-qa-id="btnCallsEndpoint"]').click()
cy.wait('@slow', {timeout: 60000}) // should do the magic

//This button is in another page, so for that, i CANT put the timeout option in here
cy.get('[data-qa-id="btnAvailableAfterResponseOK"]').click()

Am i doing something wrong?

Aucun commentaire:

Enregistrer un commentaire