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