-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cancelled network requests fail to resolve with cy.wait #19326
Comments
Poking around in the debugger, once cancelled intercepted requests get a response, they are marked with the state |
Hitting this issue as well, seems to block my ability to catch subsequent completed requests as well. |
This is a problem for Single Page Applications. For example, in a Vue app that makes GraphQL requests using Apollo, navigating to different page will cancel any requests in progress. If the tests are written as full E2E tests, hitting a real API and database, and each test clears & seeds data in the database, you might start to see intermittent database deadlocks. This is because some GraphQL query is still in progress and accessing the database, while the DB is attempting to truncate all tables. When dealing with a large number of existing (legacy) tests, the quick solution is to intercept every GraphQL request in a |
@flotwig looks like yes but still reproducible, im using 9.7 version |
@NavyMint try updating to Cypress 12, which is where that fix landed. We don't typically backport fixes to older versions. |
I seem to be able to reproduce this with 12.5.1 with the following test case:
|
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
Issue still occurs on 12.17.4 |
any updates here? 🙏 |
I have the same problem, is there any solution to ignore the canceled request? |
I have the same issue. Has anyone found a workaround? |
My workaround is to mock the status code of such requests:
|
Current behavior
If a network request is aliased and the network request is cancelled by the browser,
cy.wait
will timeout waiting for the network request.Desired behavior
cy.wait
should complete with a failed network request and should convey that the request was cancelled.Test code to reproduce
Cypress Version
9.1.1
Other
No response
The text was updated successfully, but these errors were encountered: