-
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
Cypress passes a test when it finds 0 elements #8317
Comments
There may be some async situation where it does quickly find this element but then updates the UI to show 0 after there are no elements? We'd need a reproducible example in order to track it down, but it is likely some kind of timing issue. With the code provided, I'm not able to reproduce it - the test correctly fails. Can you provide a repro? For the second test - you are asserting that all 10 anchor links should have an |
Ahh ok thanks @jennifer-shehane I'll have a look at adding in a longer wait of some sort or catch of a possible re-render and see if that catches it, unfortunately I cannot provide the repo or access to the platform I'm testing For the second test ok that's my stupidity, sorry to have troubled you there, am still fairly new to testing, will dive into that a bit more. Can I leave this open for a day or so and come back to you if i can find a way of reproducing this outside of the current platform? |
I'm closing this as I cannot get permissions to open up a project or a repo for this to be tested on. Will look further into @jennifer-shehane thought about the re-render. |
Current behavior:
When using
.get()
the test passes when it finds 0 elements, came about this after mistakingly writing a test and deleting some of the selectors, because tests failing due to issue #8189Desired behavior:
The test should fail
Test code to reproduce
Unfortunately cannot give a full repo to test but here is the test code and the html element in question that creates the dropdown menu
This test should fail
Code being tested against
Versions
Cypress: 4.12.1
Chrome 84 & Electron 80
Also when the test is written correctly it also fails not iterating through the elements to find the assertions, not sure if this is related
This test should pass
The text was updated successfully, but these errors were encountered: