Replies: 6 comments 8 replies
-
To ignore requests from the Command Log, you can ignore them as part of
|
Beta Was this translation helpful? Give feedback.
-
hi @jennifer-shehane any update on this or any workaround on Cypress v10? |
Beta Was this translation helpful? Give feedback.
-
I've added blockHosts but nothing is blocked. |
Beta Was this translation helpful? Give feedback.
-
Hello @jennifer-shehane , is there something in the new version to block the noise ? I added some URLs in my blockedHosts but this just replaces grey 200 calls with red 404 ones, not sure this is an improvement. Thanks in advance |
Beta Was this translation helpful? Give feedback.
-
This worked for me: projectId: "PROJECT_ID", blockHosts: [ //cypress/support/e2e.js
});` |
Beta Was this translation helpful? Give feedback.
-
I can't get this to work, I believe this PR introduced the ability to hide logs of intercepted requests, and it seems like passing it as the third option in a config object when using a RouteHandler is correct (according to type hints): // e2e.js
// hide blocked URLs from the Cypress UI log so it's not so noisy
function hideBlockedRequests() {
const blockedTypes = 'xhr';
const blockedHosts = Cypress.config().blockHosts;
// setup blocked host interception for each blocked host
for (const blockedHost of blockedHosts) {
cy.intercept(
{
url: `${blockedHost}`,
middleware: true,
resourceType: blockedTypes
},
req => {
req.destroy();
},
{ log: false }
).as(`${blockedHost}`);
}
}
beforeEach(function () {
hideBlockedRequests();
}) And my blocked hosts:
Still seeing all the xhr 503s in the test runner 😕 |
Beta Was this translation helpful? Give feedback.
-
I have the following trackers blocked during Cypress tests. Cypress keeps on logging these urls in the test runner logs which is ugly and interferes with other useful log messages and assertions and increases scrolling/searching effort from the user.
Is there a way to disable logging of these urls in the test runner and console ?
Beta Was this translation helpful? Give feedback.
All reactions