mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 08:34:07 -08:00
1c36c37a12
* test(editor): Fix default-owner and credentials saving e2e specs * test(editor): fix webhook node test * test(editor): add cy command for browser permissions * test(editor): add cy command for reading clipboard * Fix 3-default-owner spec * Resolve review comments * Merge spec * Fix http node and expression editor modal specs * Add optional param to credentials modal saving action to wait for the test endpoint * Improve sidebar items clicking and increase credentials saving timeout * Rename http e2e spec to fix ordering * Fix pasting and copying of nodes e2e spec * Make sure to only access error.cause if it exists * Wait longer for the keyboard press * Make sure to focus the body when typing * Try type delay * Use meta key based on the running platform * Fix flaky workflowTagElements getter Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
110 lines
3.4 KiB
TypeScript
110 lines
3.4 KiB
TypeScript
import { randFirstName, randLastName } from '@ngneat/falso';
|
|
import { DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD } from '../constants';
|
|
import { SettingsUsersPage, SignupPage, WorkflowsPage, WorkflowPage, CredentialsPage, CredentialsModal, MessageBox } from '../pages';
|
|
|
|
import { MainSidebar, SettingsSidebar } from "../pages/sidebar";
|
|
|
|
const mainSidebar = new MainSidebar();
|
|
const settingsSidebar = new SettingsSidebar();
|
|
|
|
const workflowsPage = new WorkflowsPage();
|
|
const signupPage = new SignupPage();
|
|
const workflowPage = new WorkflowPage();
|
|
|
|
const credentialsPage = new CredentialsPage();
|
|
const credentialsModal = new CredentialsModal();
|
|
|
|
const settingsUsersPage = new SettingsUsersPage();
|
|
|
|
const messageBox = new MessageBox();
|
|
|
|
const email = DEFAULT_USER_EMAIL;
|
|
const password = DEFAULT_USER_PASSWORD;
|
|
const firstName = randFirstName();
|
|
const lastName = randLastName();
|
|
|
|
describe('Default owner', () => {
|
|
before(() => {
|
|
cy.resetAll();
|
|
});
|
|
beforeEach(() => {
|
|
cy.visit('/');
|
|
})
|
|
|
|
it('should skip owner setup', () => {
|
|
cy.skipSetup();
|
|
});
|
|
|
|
it('should be able to create workflows', () => {
|
|
workflowsPage.getters.newWorkflowButtonCard().should('be.visible');
|
|
workflowsPage.getters.newWorkflowButtonCard().click();
|
|
|
|
cy.createFixtureWorkflow('Test_workflow_1.json', `Test workflow`);
|
|
|
|
// reload page, ensure owner still has access
|
|
cy.reload();
|
|
|
|
workflowPage.getters.workflowNameInput().should('contain.value', 'Test workflow');
|
|
});
|
|
|
|
it('should be able to add new credentials', () => {
|
|
cy.visit(credentialsPage.url);
|
|
|
|
credentialsPage.getters.emptyListCreateCredentialButton().click();
|
|
|
|
credentialsModal.getters.newCredentialModal().should('be.visible');
|
|
credentialsModal.getters.newCredentialTypeSelect().should('be.visible');
|
|
credentialsModal.getters.newCredentialTypeOption('Notion API').click();
|
|
|
|
credentialsModal.getters.newCredentialTypeButton().click();
|
|
|
|
credentialsModal.getters.connectionParameter('API Key').type('1234567890');
|
|
|
|
credentialsModal.actions.setName('My awesome Notion account');
|
|
credentialsModal.actions.save();
|
|
|
|
credentialsModal.actions.close();
|
|
|
|
credentialsModal.getters.newCredentialModal().should('not.exist');
|
|
credentialsModal.getters.editCredentialModal().should('not.exist');
|
|
|
|
credentialsPage.getters.credentialCards().should('have.length', 1);
|
|
});
|
|
|
|
it('should be able to setup UM from settings', () => {
|
|
mainSidebar.getters.settings().should('be.visible');
|
|
mainSidebar.actions.goToSettings();
|
|
cy.url().should('include', settingsUsersPage.url);
|
|
|
|
settingsUsersPage.actions.goToOwnerSetup();
|
|
|
|
cy.url().should('include', signupPage.url);
|
|
});
|
|
|
|
it('should be able to setup instance and migrate workflows and credentials', () => {
|
|
cy.setup({ email, firstName, lastName, password });
|
|
|
|
messageBox.getters.content().should('contain.text', '1 existing workflow and 1 credential')
|
|
|
|
messageBox.actions.confirm();
|
|
cy.url().should('include', settingsUsersPage.url);
|
|
settingsSidebar.actions.back();
|
|
|
|
cy.url().should('include', workflowsPage.url);
|
|
|
|
workflowsPage.getters.workflowCards().should('have.length', 1);
|
|
});
|
|
|
|
it('can click back to main menu and have migrated credential after setup', () => {
|
|
cy.signin({ email, password });
|
|
cy.visit(workflowsPage.url);
|
|
|
|
mainSidebar.actions.goToCredentials();
|
|
|
|
cy.url().should('include', credentialsPage.url);
|
|
|
|
credentialsPage.getters.credentialCards().should('have.length', 1);
|
|
});
|
|
});
|
|
|