I have sometimes problems, that the line cy.wrap… break, when the IDTest element load to long.
I am looking for a way, that this line jump back with an return to the function when this line failed.
Cypress.Commands.add(
'test',
(timeout: number = 10000) => {
cy.wrap(Cypress.$('#IDTest'), {log: false}).should('not.be.visible');
})
I tryed different way, but it break sometimes at this line.
New contributor
StackDos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
That’s the wrong way to wait for an element, because it will not retry when it fails to find it.
Instead change the cy.wrap()
to the cy.get()
command
cy.get('#IDTest', {timeout: 10_000, log: false})