Is there an equivalent of cy.server({ignore: (xhr) => bool}) to disable logging, after moving to cy.intercept?
See original GitHub issueWhat would you like?
I would like to continue to be able to disable logging of some routes after moving to cy.intercept()
.
Why is this needed?
A nice side-effect of calling cy.server({ignore: (xhr) => bool})
to disable stubbing is that it also disables logging of matching routes. This helps decluttering the logs when we’re running interactive tests.
Examples are ping-pong requests with back-end server, webpack-dev-server’s sockjs route, etc.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:36
- Comments:14 (1 by maintainers)
Top Results From Across the Web
intercept - Cypress Documentation
Waiting on an aliased cy.intercept() route using cy.wait() will yield an object that contains information about the matching request/response cycle.
Read more >Cypress cy.intercept Problems - Gleb Bahmutov
Cypress shows XHR calls by default in its Command Log, thus it has nothing to do with our intercept. I always thought NOT...
Read more >Hide XHR calls on Cypress test runner - Stack Overflow
It looks like Cypress.Server is deprecated along with cy.server() (possibly it's the same thing). An intercept might do what you want
Read more >A Practical Guide to Intercepting Network Requests in Cypress
First things first - matching our url. When using .intercept() command, there are two main questions that need to be resolved. How do...
Read more >Cypress Intercept How To Force The Server To Ignore 404 - ADocLib
The method cy.intercept is used to redirect the responses to the matching requests. ... A nice sideeffect of calling cy.server{ignore: xhr bool} to...
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
If
cy.intercept()
is used for mocking, for example, assets and not just API calls, it can flood the command log and make it difficult to overview, so a feature to hide certain intercepted requests would be very nice to have for this use case.I’m looking for an equivalent of
cy.server
’sforce404
option, without this option or similar behavior I can’t move tocy.intercept
… 😞