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

requestTimeout and responseTimeout should apply individually to each request in cy.wait([]) with array of requests #6650

Open
DamienCassou opened this issue Mar 5, 2020 · 1 comment
Labels
pkg/driver This is due to an issue in the packages/driver directory stage: proposal 💡 No work has been done of this issue type: breaking change Requires a new major release version type: enhancement Requested enhancement of existing feature

Comments

@DamienCassou
Copy link

Current behavior:

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?

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

"I want all requests to be sent before requestTimeout"

Desired behavior:

The current behavior 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".

I think the documentation should be improved about that so I opened an issue on the cypress-documentation project.

Still, @jennifer-shehane believes that the semantics of cy.wait() could benefit from being changed to match what we both expect.

More information about my context: #6563.

Versions

  • Cypress: 4.1.0
  • OS: Fedora 31
  • Browser: Chromium
@cypress-bot cypress-bot bot added the stage: proposal 💡 No work has been done of this issue label Mar 6, 2020
@jennifer-shehane jennifer-shehane changed the title Semantics of multiple aliases passed to cy.wait() requestTimeout and responseTimeout should apply individually to each request in cy.wait([]) with array of requests Mar 6, 2020
@jennifer-shehane
Copy link
Member

When using cy.wait(['@alias1', '@alias2']) Cypress will wait for all requests to complete within the given requestTimeout and responseTimeout, but I think they should individually wait for requestTimeout and responseTimeout for each initiated request.

I think the implementation is a bit trickier than what I've plainly written it as though. Also...probably a breaking change?

@jennifer-shehane jennifer-shehane added pkg/driver This is due to an issue in the packages/driver directory type: enhancement Requested enhancement of existing feature labels Mar 6, 2020
@jennifer-shehane jennifer-shehane added the type: breaking change Requires a new major release version label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory stage: proposal 💡 No work has been done of this issue type: breaking change Requires a new major release version type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants