Skip to content
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

Verify that an item has never existed #30477

Open
NormalCrazy000 opened this issue Oct 28, 2024 · 2 comments
Open

Verify that an item has never existed #30477

NormalCrazy000 opened this issue Oct 28, 2024 · 2 comments
Labels
type: feature New feature that does not currently exist

Comments

@NormalCrazy000
Copy link

What would you like?

I would like there to be an option to verify that an element has never been on the page.
For example if I run:

cy.get('#buttonId').should('not.exists')

to verify that my page does not have the button with id = buttonId, I would like cypress to keep trying 'get' and at the end of the timeout, in the case of the element not being present, the test would be passed

Why is this needed?

I would like this because it would be interesting to have the ability to verify the nonexistence of an element and not just its elimination from the dom

Other

No response

@jennifer-shehane
Copy link
Member

@NormalCrazy000 I'd recommend reading this guide. https://docs.cypress.io/app/guides/conditional-testing

@jennifer-shehane jennifer-shehane added the type: feature New feature that does not currently exist label Oct 28, 2024
@NormalCrazy000
Copy link
Author

NormalCrazy000 commented Oct 28, 2024

@jennifer-shehane I 've read , but unfortunately the existence of an element is verifiable only in the case of synchronous and not asynchronous state changes. I am looking for something to be able to test non-existence in asynchronous pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

2 participants