-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assert element NEVER exists ? #3355
Comments
Can you spy on JavaScript method that opens the modal? It would be a lot more reliable than "catching" flash of the popup in the DOM |
This is tricky to test. I think that reviewing our doc on conditional testing may help you think of some strategies for testing this situation though. I will be closing this since issues in our GitHub repo are reserved for potential bugs or feature requests. We recommend questions relating to how to use Cypress be asked in our community chat. Also try searching our existing GitHub issues, reading through our documentation, or searching Stack Overflow for relevant answers. Alternatively, signing up for any of you paid plans gives you access to our team for support via email. If you would like something higher touch, we also offer screen sharing and workshops with our premium support options. |
I'm trying to assert that an element doesn't exist on the page.
Normally I'd just do
cy.get(myEl).should("not.exist")
In this case however I'm looking for a toast message that leaves the page rather quickly.
doesn't work in this case because the test passes either before the toast is on the page, or the toast leaves the page too quickly.
I want to assert that it NEVER shows up, even if very briefly but am struggling to figure out how to make that assertion.. any ideas?
Thanks!
Here's the actual code in my test just to give a more concrete example:
The text was updated successfully, but these errors were encountered: