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.

Is there an equivalent of cy.server({ignore: (xhr) => bool}) to disable logging, after moving to cy.intercept?

See original GitHub issue

What 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:closed
  • Created 3 years ago
  • Reactions:36
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
sliktscommented, Sep 29, 2021

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.

9reactions
tonivj5commented, Dec 23, 2020

I’m looking for an equivalent of cy.server’s force404 option, without this option or similar behavior I can’t move to cy.intercept… 😞

Read more comments on GitHub >

github_iconTop 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 >

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