XHR's displaying as 'aborted' when they are not
See original GitHub issueCurrent behavior:
When running a cypress spec, many (but not all) XHRs are shown as ‘aborted’ in the Cypress test runner when they are not, in fact. Chrome dev tools Network
tab shows successful XHRs and the app is working as designed, completing requests with no errors. We have one spec, currently, and the spec contains three tests: login / access app / use app. During the access app test, we start cy.server()
and route 2 requests with mock payloads. These are the only requests mocked in the spec. In this test and the preceding test, all XHRs look fine in the runner. In the subsequent test, however, the XHRs all show aborted - they show as red.
test 2/3 looks like:
test 3/3 looks like:
Per conversation with @ValerieThoma on Gitter, I added cy.wait()
for some routes in the aborted requests. This didn’t change the behavior as near as I can tell.
test 3/3 with cy.wait looks like:
Additional info: the app communicates via XHR to multiple backends - probably 3 different hosts, amongst them Amazon S3 - all XHRs show as ‘aborted’ - so this seems like something that’s local to the client app / cypress runner interaction. The app is Angular 5 w/ HttpClient.
Desired behavior:
Successful XHRs should not display as aborted.
Steps to reproduce:
Not sure how to reproduce generically, unfortunately.
Versions
Cypress 2.1.0 Chrome 66
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:31 (6 by maintainers)
Top GitHub Comments
I’ve opened a separate issue here for not manually aborting XHR’s aggressively on unload.
This should fix the rest of the issues in this thread. Once this PR is merged in I will lock this issue, and additional comments or problems should go in a new issue, as I believe these are all addressed.
Unfortunately in order to address an issue, we have to have a reproducible example provided. Can anyone provide the exact code + test code to reproduce this?