Cypress: Alternative for command 'wait' #19996
JanniChi
started this conversation in
Cypress Cloud
Replies: 1 comment
-
This kind of wait (the element should exist) is built into the So you example is better written as Tip: look at the timeouts, you can control how long each commands "waits" internally for the element https://on.cypress.io/retry-ability |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am looking for an alternative to the wait command.
As we all know, a page/component/etc. does not take the same time to load or simply be available every time it is called.
For this reason, I cannot rely on the 'wait' command with constant time specification.
So I am looking for an alternative.
Some people on the internet write that the command 'then' helps to wait until the condition is fulfilled.
Unfortunately, the following alternative does not work in my case:
cy.get(#element).should('exist').then(() =>{ cy.get(#element).click(); });
I am looking forward to your messages and alternatives to 'wait'.
Many greetings Janni
Beta Was this translation helpful? Give feedback.
All reactions