-
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
Get is not retrying itself #904
Comments
The state of your application that Cypress is looking for if the example you provided is that there are any elements that exist on the page matching If you want the tests to not continue until 5 elements are found in the Something like: cy.wait(['@getRoles'])
cy.get(".myClass1 .myClass2").should("have.length", 5)
.contains("Something") Let me know if I understood your question correctly and if this solves it. |
Thx for your answer. Yeah I understand. I thought 'contains' was an assertion and so it will work like a have length |
Contains has a default assertion that it will retry until it finds an element with the matching content. However it is independently run from the That's different than an assertion - an assertion acts as a "guard" on whatever it is chained to, preventing it from resolving until all of the associated assertions pass. Have you read our guides? Specifically this one: https://docs.cypress.io/guides/core-concepts/introduction-to-cypress.html |
10.12.6
1.0.3
62.0.3202.89 64 bits
Is this a Feature or Bug?
It is a bug. Or I didn't get the documentation
get will automatically retry itself until assertions you've chained all pass.
Current behavior:
Little tricky but when my apps mount the 'get' will target 3 element and after the request that I wait (and the rerender of react) the number of element will be 5.
Maybe my app rerender is too slow but it seems like the get will always target those 3 elements. (if i put a wait of 100ms before it the get it will target the 5)
will automatically retry itself until assertions you've chained all pass.
seems to not workingDesired behavior:
Check if the selector change state when its direct chainer is not successfull
How to reproduce:
add an element after a timeout.
Test code:
The text was updated successfully, but these errors were encountered: