-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathindex.ts
More file actions
37 lines (34 loc) · 1.41 KB
/
index.ts
File metadata and controls
37 lines (34 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import '@cypress/grep';
import './selectors';
import './commands/selector-commands';
import './commands/auth-commands';
import './commands/operator-commands';
import './commands/incident-commands';
import './commands/utility-commands';
import './incidents_prometheus_query_mocks';
import './commands/virtualization-commands';
export const checkErrors = () =>
cy.window().then((win) => {
assert.isTrue(!win.windowError, win.windowError);
});
// Ignore benign ResizeObserver errors globally so they don't fail tests
// See: https://docs.cypress.io/api/cypress-api/catalog-of-events#Uncaught-Exceptions
Cypress.on('uncaught:exception', (err) => {
const message = err?.message || String(err || '');
if (
message.includes('ResizeObserver loop limit exceeded') ||
message.includes('ResizeObserver loop completed with undelivered notifications') ||
message.includes('ResizeObserver') ||
message.includes('Cannot read properties of undefined') ||
message.includes('Unauthorized') ||
message.includes('Bad Gateway') ||
message.includes(`Cannot read properties of null (reading 'default')`) ||
message.includes(`(intermediate value) is not a function`) ||
//TODO: OU-1158
message.includes(`[ Federation Runtime ]: Failed to load script resources. #RUNTIME-008`)
) {
console.warn('Ignored frontend exception:', err.message);
return false;
}
// allow other errors to fail the test
});