Cypress is not capturing app XHR its only capturing 3rd party XHR calls
See original GitHub issueCurrent behavior:
Request(XHR) going to 3rd party is captured Request going to our own api is not captured:
Desired behavior:
Every XHR request on page load should be captured.
Steps to reproduce:
cy.visit('/');
cy.get('select#users').select('ShootCoordinator')
cy.get('input').click();
cy.wait(2000)
cy.get('.filter-callout.medium-text').contains('Filters')
cy.visit('/asosstudio/');
Versions
Latest version of Cypress, latest version of Chrome and on Windows 7 OS
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (6 by maintainers)
Top Results From Across the Web
Asserting Network Calls from Cypress Tests
This blog post shows how easy it is to confirm the network calls from the web app happen as expected. Note: you can...
Read more >Cypress: Test non-XHR request caused by submitting POST ...
In some cases my application have to submit(not just after click submit button but programmatically) POST form and redirect to 3rd party server ......
Read more >A Practical Guide to Intercepting Network Requests in Cypress
It's a very simple Vue.js app built with json-server - a single file json ... The previous command was only working with XHR...
Read more >Part 27 - Intercept Network Requests (Both XHR and FETCH ...
In this video I've shown how to intercept the Network Requests with Cypress 1. Both XHR & FETCH Type Requests 2. SPY &...
Read more >Cypress cy.intercept Problems - Gleb Bahmutov
visit command. By the time cy.intercept runs, the call is already in progress, and thus not intercepted. Cypress shows XHR calls by default...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I guess I know the answer. For some reason Cypress is not intercepting requests, when application uses Fetch API instead of XHR API.
Our application under test contains a lib which checks if browser knows about ‘fetch’ function. If not, it fallbacks to XHR-based requests. So, our solution was to “disable” fetch feature to cause this fallback. Our tests do the following:
(support/index.js)
But in your case it might not work. Check with your developers if they use Fetch API, and if yes, ask if they can provide fallback to XHR API.
I can’t swear that your problem is of the same origin, but it looks exactly like ours to me.
It doesn’t. There is an open issue for that: https://github.com/cypress-io/cypress/issues/687