-
Notifications
You must be signed in to change notification settings - Fork 25
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
WaitUntill works only with Cypress methods #241
Comments
Hi @JonahKK |
Nested |
@JonahKK, up 😉 |
@NoriSte Sorry about the delay, had a lot on my mind recently. I will try to prepare the example this week. |
Perfect, thanks!!! I appreciate it 😊 |
Thanks for the feedback @JonahKK!! 😊
Could you share a repo with this example, please? I didn't notice it in my tests 🤔 |
Please check the https://github.com/JonahKK/cypress-test-tiny/tree/wait-until. Just open the Cypress runner and launch the spec. The test should timeout after 70 seconds (unless you will be lucky and have a match in the wait 😉) |
You're right, I hadn't realized it until now... well, how
Then, what happens when two
so the parent I'm going to add this note to the README, thanks a lot for the dedication @JonahKK!!!!!! ❤️ |
It is more like a question, or a request for clarification. I was not able to find an answer in docs.
So in my case I have a class with method that is responsible for fetching some data from API. This method uses
waitUntil
and returns a Cypress' promise.So now in test I want to fetch this data till the returned json will have certain value. In order to do it I wrote:
cy.waitUntil(() => apiClient.get(item.id).then(i => i.items[0].Name === item.items[1].Name));
What happened during execution was Cypress waited indefinitely long for this wait. Timeout was never raised (although time passed).
So in my second attempt I wrapped the whole expression in
cy.wrap
:cy.waitUntil(() => cy.wrap(apiClient.get(item.id).then(i => i.items[0].Name === item.items[1].Name)););
In this form, the wait worked flawlessly.
My question is, whether
waitUntil
is limited only tocy
commands, or is it some kind of the defect. Maybe usage of twowaitUntil
is the issue here?The text was updated successfully, but these errors were encountered: