-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Callback form of should chained off cy.window receives null when retried #22587
Comments
Possibly related to #8346 ? |
@david-sabata The issue you have logged is indeed a duplicate of #8346 (thank you for linking!) The With the example you linked out, because the I assume your example is a rough high-level example of the behavior you are trying to accomplish? For the |
I don't mind logging twice :) The unexpected part is that It does seem to be connected with Here's a simplified example and screenshot. Notice how the error isn't about the missing property, but about
|
Very interesting, thanks for the precise repro. I'm currently working in this area - how subjects are determined and how commands are retried - in relation to #7306. The short version is that A temporary workaround would be to ensure that you don't have any cypress commands inside your
This passes; it's only when the should callback contains other cypress commands that cy gets confused over what the subject should be during retries. |
For anyone following along, this will be "fixed" in 11.0.0. Fixed is in quotes because it'll be fixed by completely disallowing Cypress commands from inside |
|
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
My goal is to have a retriable check of a
window
property that my app exposes. To achieve that, I'm using the callback form ofshould
.The window object is correctly passed into the callback only for the first time. If the assertions fail and trigger a retry, the callback argument is
null
. (See the repro code)Maybe I missed something, but I went through the docs and I don't think this is expected behavior.
Desired behavior
The callback of
should
always receives thewindow
objectTest code to reproduce
Cypress Version
10.3.0
Other
No response
The text was updated successfully, but these errors were encountered: