n8n/cypress/support/e2e.ts
Tomi Turtiainen 008fd5a917
test: Add e2e tests for cred setup on workflow editor (no-changelog) (#8245)
## Summary

Follow-up to https://github.com/n8n-io/n8n/pull/8240

Adds e2e tests for the template credential setup in workflow editor


## Related tickets and issues

https://linear.app/n8n/issue/ADO-1463/feature-enable-users-to-close-and-re-open-the-setup
2024-01-08 11:35:18 +02:00

28 lines
708 B
TypeScript

import { INSTANCE_OWNER } from '../constants';
import './commands';
before(() => {
cy.resetDatabase();
Cypress.on('uncaught:exception', (err) => {
return !err.message.includes('ResizeObserver');
});
});
beforeEach(() => {
if (!cy.config('disableAutoLogin')) {
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password });
}
cy.intercept('GET', '/rest/settings').as('loadSettings');
cy.intercept('GET', '/types/nodes.json').as('loadNodeTypes');
// 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' },
},
});
});