From 534c87509a38256ddc398b3f567ab2dc5719bc90 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Thu, 20 Jul 2023 23:41:53 +0530 Subject: [PATCH] Ignore common on-reload xhr errors in Cypress. --- frontend/cypress/support/commands.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/cypress/support/commands.js b/frontend/cypress/support/commands.js index 8ca871cd2..f9959e4df 100644 --- a/frontend/cypress/support/commands.js +++ b/frontend/cypress/support/commands.js @@ -41,3 +41,14 @@ Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe, callback = .should((iframe) => expect(iframe.contents().find('body')).to.exist) .then((iframe) => cy.wrap(iframe.contents().find('body'))) .within({}, callback)); + +Cypress.on('uncaught:exception', (err, runnable) => { + if (err.hasOwnProperty('request')) { + const u = err.request.url; + if (u.includes('config') || u.includes('settings') || u.includes('events')) { + return false; + } + } + + return true; +});