Hide XHR requests from the command log
See original GitHub issueCurrent behavior:
All XHR requests are printed to the command log, which can be distracting. There is no option to filter them. In https://github.com/cypress-io/cypress/issues/1184 it was mentioned this is possible by whitelisting requests with Cypress.Server.defaults
, but that breaks stubbing.
Desired behavior:
Having an option, to only log stubbed XHR requests to the command log.
Maybe the best fix would be not a config option, but a toggle on the test runner, that can hide these logs.
Test code to reproduce
Test any app that does network requests.
Versions
Any OS and version.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:47
- Comments:22 (3 by maintainers)
Top Results From Across the Web
Hide XHR calls on Cypress test runner - Stack Overflow
Try this, works for me. Add the following to cypress/support/index.js: // Hide fetch/XHR requests const app = window.top; ...
Read more >Muting Noisy XHR Logs in Cypress - DEV Community
Hide fetch/XHR requests from command log if (Cypress.config("hideXHRInCommandLog")) { const app = window.top; if ( app && !app.document.head ...
Read more >cypress-io/cypress - Gitter
How can i hide or remove the xhr request from the cybress test cases ? ... what is the command to run a...
Read more >How to hide xhr logs in Chrome developer console and ...
You cannot. Even if you could, if the user used Fiddler, Wireshark and similar, the requests would have been visible anyway, so it...
Read more >Cypress App
There are some places in the Command Log that display a link to the relevant file ... Network XHR Requests; URL hash changes;...
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
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into this problem myself and after a deep-dive into Cypress’ logging internals I discovered a novel workaround, simply hide fetch/XHR command log entries with CSS.
https://gist.github.com/simenbrekken/3d2248f9e50c1143bf9dbe02e67f5399
Updated to v8.2.0 and development turned into nightmare: all useless server pollings are back in the UI, couldn’t find anything in
intercept()
to hide requests from UI and no plugin to bringserver()
functionality back. It looks pretty much like screenshots in #1184 all over again, and would gladly upvote changes requested here.Did anyone find a way around it?