question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XHR's displaying as 'aborted' when they are not

See original GitHub issue

Current 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:

ok

test 3/3 looks like:

aborted

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:

aborted with wait

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:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:31 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
brian-manncommented, Dec 19, 2018

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.

1reaction
jennifer-shehanecommented, Nov 19, 2018

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress XHR requests get aborted when running headless, in ...
I had an issue with WAF (AWS Cloud). in my cloud front, there was a rule to block XHR requests to the backend....
Read more >
cypress-io/cypress - Gitter
Post Second page loads, Why XHR is aborted while saving a deal. 'Create Deal' POST request works sometime and some time it is...
Read more >
Aborted xhr requests should be visibly different from ongoing ...
When you call xhr.abort() on an XHR request, there's (as far as I can see) no way in the Network tab to see...
Read more >
Changelog - Cypress Documentation
Fixed issues involving XHRs displaying as 'aborted' in the Cypress Command Log when they were not actually aborted. Fixes #1652. We no longer...
Read more >
XHR requests are cancelled in Cypress - SQA Stack Exchange
The button clicked in step 2, Cypress starts to load the correct URL but then the landing page (login screen from step 1)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found