Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wait for modal 'please wait' to close

What is the standard Cypress-way to wait for a 'please wait' modal to close?

Easy to check it is there, but without using cy.wait(ms), how can I cause Cypress to keep checking for a period of time, to see if the element has been removed from the DOM, or made invisible?

like image 409
Lee Goddard Avatar asked Mar 08 '18 11:03

Lee Goddard


2 Answers

You can simply use should to assert it doesn't exist, and Cypress will wait for the element until it's removed from DOM. If you need to override the default 4s timeout, you can pass it to the previous command:

cy.get( selector, { timeout: 10000 }).should("not.exist");
like image 177
dwelle Avatar answered Nov 01 '22 09:11

dwelle


try using cy.get(selector).should("not.be.visible"); it worked for me

like image 2
Katzura Avatar answered Nov 01 '22 09:11

Katzura