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

cy.wait timeout and passing multiple aliases #2573

Closed
DamienCassou opened this issue Mar 4, 2020 · 4 comments · Fixed by #2648
Closed

cy.wait timeout and passing multiple aliases #2573

DamienCassou opened this issue Mar 4, 2020 · 4 comments · Fixed by #2648

Comments

@DamienCassou
Copy link

I'm submitting a...

[X] Bug report
[ ] Content update
[ ] Process update (build, deployment, ... )

Type of bug / changes

cy.wait() can be passed an array of aliases. This is good. However, it is not clear what the impact on the timeout is. cy.wait() has 2 timeouts, requestTimeout and responseTimeout.

I guess that if before requestTimeout all aliases have matched, then cy.wait() will be happy. But what if only a few of the aliases have matched while others have not matched yet?

@DamienCassou
Copy link
Author

From my experiment, passing several aliases to cy.wait() means:

"I want all requests to be sent before requestTimeout"

This makes sense but I was expecting a completely different semantics:

"I don't want to wait more than requestTimeout between a response is received and the next request is sent".

More information about my context: cypress-io/cypress#6563.

@jennifer-shehane
Copy link
Member

Yes, your assessment is correct. When using cy.wait(['@alias1', '@alias2']) Cypress will wait for all requests to complete within the given requestTimeout and responseTimeout.

I also do not like this behavior personally as it generally caused me to pull everything out into their own cy.wait() which just seems unnecessary. Feel free to open an issue to change this behavior in the cypress repo.

This should definitely be clarified better in the docs. Probably in one or both of these sections:

@DamienCassou
Copy link
Author

DamienCassou commented Mar 5, 2020

I just opened an issue in the main repo.

@DamienCassou
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants