2024-01-08 01:35:18 -08:00
|
|
|
import { INSTANCE_OWNER } from '../constants';
|
2022-12-15 07:39:59 -08:00
|
|
|
import './commands';
|
2023-02-03 04:14:59 -08:00
|
|
|
|
2023-05-26 08:15:06 -07:00
|
|
|
before(() => {
|
2024-01-08 01:35:18 -08:00
|
|
|
cy.resetDatabase();
|
2023-07-28 00:51:07 -07:00
|
|
|
|
|
|
|
Cypress.on('uncaught:exception', (err) => {
|
|
|
|
return !err.message.includes('ResizeObserver');
|
|
|
|
});
|
2023-05-26 08:15:06 -07:00
|
|
|
});
|
|
|
|
|
2023-02-03 04:14:59 -08:00
|
|
|
beforeEach(() => {
|
2023-06-22 15:38:12 -07:00
|
|
|
if (!cy.config('disableAutoLogin')) {
|
|
|
|
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password });
|
|
|
|
}
|
|
|
|
|
2024-04-11 05:22:33 -07:00
|
|
|
cy.window().then((win): void => {
|
|
|
|
win.localStorage.setItem('N8N_THEME', 'light');
|
|
|
|
});
|
|
|
|
|
2023-03-10 07:54:54 -08:00
|
|
|
cy.intercept('GET', '/rest/settings').as('loadSettings');
|
2023-11-03 07:22:37 -07:00
|
|
|
cy.intercept('GET', '/types/nodes.json').as('loadNodeTypes');
|
2023-02-03 04:14:59 -08:00
|
|
|
|
2023-03-10 07:54:54 -08:00
|
|
|
// Always intercept the request to test credentials and return a success
|
|
|
|
cy.intercept('POST', '/rest/credentials/test', {
|
|
|
|
statusCode: 200,
|
|
|
|
body: {
|
|
|
|
data: { status: 'success', message: 'Tested successfully' },
|
2023-05-26 08:15:06 -07:00
|
|
|
},
|
2023-03-10 07:54:54 -08:00
|
|
|
});
|
2023-05-26 08:15:06 -07:00
|
|
|
});
|