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 only waits for first request out of many matched requests #9034

Closed
quad5 opened this issue Oct 29, 2020 · 1 comment
Closed

cy.wait only waits for first request out of many matched requests #9034

quad5 opened this issue Oct 29, 2020 · 1 comment

Comments

@quad5
Copy link

quad5 commented Oct 29, 2020

Current behavior

Screen Shot 2020-10-29 at 4 10 20 PM

Desired behavior

In our application, multiple requests may match from a single routeMatcher (ie cy.route2()). When I use cy.wait, it only intercepts the first request. I thought it would wait for all matched request on such routeMatcher.

Test code to reproduce

let routeAlias = 'alias1';
cy.route2({routeMatcherObject}, routeAlias);
cy.visit("url");
cy.wait(`@${routeAlias}`).then((req) => {
            cy.log(req);
            console.log(req);
        })

Versions

Cypress: 5.5.0
Chrome: 86.0.4240.111
MacOS: 10.15.6

@jennifer-shehane
Copy link
Member

@quad5 cy.route2() with its current API has no idea what 'all' requests are without that being predefined somewhere. We'd have no idea if 1 route or 100 routes will be coming in later to match the route you've defined and when you wanted to stop waiting with the current API.

Likely one of these features will be helpful in testing what you're looking for: #7663 #8531 so feel free to comment in those your support and whether they would be helpful in testing the number of requests you'd like to match.

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

No branches or pull requests

2 participants