mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
test: Add initial e2e tests for default owner setup (#4710)
* use user-folder override consistently everywhere, including for the `.cache` folder * use consistent config for e2e tesing, skipping config loading from env and config files * simplify all the cypress commands, and run all e2e tests on master * add tests for skipping owner setup * add todos Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
import { WorkflowsPage, SigninPage, SignupPage } from "../pages";
|
||||
import { N8N_AUTH_COOKIE } from "../constants";
|
||||
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
||||
import { MessageBox } from '../pages/modals/message-box';
|
||||
|
||||
Cypress.Commands.add('getByTestId', (selector, ...args) => {
|
||||
return cy.get(`[data-test-id="${selector}"]`, ...args)
|
||||
@@ -74,6 +75,7 @@ Cypress.Commands.add(
|
||||
});
|
||||
});
|
||||
|
||||
// todo rename to setup
|
||||
Cypress.Commands.add('signup', (email, firstName, lastName, password) => {
|
||||
const signupPage = new SignupPage();
|
||||
|
||||
@@ -93,3 +95,28 @@ Cypress.Commands.add('signup', (email, firstName, lastName, password) => {
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
Cypress.Commands.add('skipSetup', () => {
|
||||
const signupPage = new SignupPage();
|
||||
const workflowsPage = new WorkflowsPage();
|
||||
const Confirmation = new MessageBox();
|
||||
|
||||
cy.visit(signupPage.url);
|
||||
|
||||
signupPage.getters.form().within(() => {
|
||||
cy.url().then((url) => {
|
||||
if (url.endsWith(signupPage.url)) {
|
||||
signupPage.getters.skip().click();
|
||||
|
||||
|
||||
Confirmation.getters.header().should('contain.text', 'Skip owner account setup?');
|
||||
Confirmation.actions.confirm();
|
||||
|
||||
// we should be redirected to /workflows
|
||||
cy.url().should('include', workflowsPage.url);
|
||||
} else {
|
||||
cy.log('User already signed up');
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user