mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
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
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import 'cypress-real-events';
|
||||
import { WorkflowPage } from '../pages';
|
||||
import { BACKEND_BASE_URL, INSTANCE_MEMBERS, INSTANCE_OWNER, N8N_AUTH_COOKIE } from '../constants';
|
||||
import {
|
||||
BACKEND_BASE_URL,
|
||||
INSTANCE_ADMIN,
|
||||
INSTANCE_MEMBERS,
|
||||
INSTANCE_OWNER,
|
||||
N8N_AUTH_COOKIE,
|
||||
} from '../constants';
|
||||
|
||||
Cypress.Commands.add('getByTestId', (selector, ...args) => {
|
||||
return cy.get(`[data-test-id="${selector}"]`, ...args);
|
||||
@@ -51,6 +57,10 @@ Cypress.Commands.add('signin', ({ email, password }) => {
|
||||
);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('signinAsOwner', () => {
|
||||
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password });
|
||||
});
|
||||
|
||||
Cypress.Commands.add('signout', () => {
|
||||
cy.request('POST', `${BACKEND_BASE_URL}/rest/logout`);
|
||||
cy.getCookie(N8N_AUTH_COOKIE).should('not.exist');
|
||||
@@ -183,3 +193,11 @@ Cypress.Commands.add('shouldNotHaveConsoleErrors', () => {
|
||||
cy.wrap(spy).should('not.have.been.called');
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('resetDatabase', () => {
|
||||
cy.request('POST', `${BACKEND_BASE_URL}/rest/e2e/reset`, {
|
||||
owner: INSTANCE_OWNER,
|
||||
members: INSTANCE_MEMBERS,
|
||||
admin: INSTANCE_ADMIN,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user