-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into N8N-5498-workflow-action-tests
* master: refactor: Improve typings for element-ui imports (no-changelog) (#4678) fix(core): Mark binary data to be deleted when pruning executions (#4713) test: Add e2e tests for workflow/credential migrations when enabling UM (#4719) ci: Setup cypress tasks for resetting DB, and setting up an owner (#4717) fix: Fix Windows development environments (no-changelog) (#4720) refactor(core): Reduce memory usage in the Webhook node (#4640) 📚 Update CHANGELOG.md and main package.json to 0.204.0 🔖 Release n8n@0.204.0 ⬆️ Set n8n-core@0.144.0, n8n-editor-ui@0.170.0, n8n-nodes-base@0.202.0 and n8n-workflow@0.126.0 on n8n 🔖 Release n8n-editor-ui@0.170.0 ⬆️ Set n8n-design-system@0.44.0 and n8n-workflow@0.126.0 on n8n-editor-ui 🔖 Release n8n-design-system@0.44.0 🔖 Release n8n-nodes-base@0.202.0 ⬆️ Set n8n-core@0.144.0 and n8n-workflow@0.126.0 on n8n-nodes-base 🔖 Release n8n-node-dev@0.83.0 ⬆️ Set n8n-core@0.144.0 and n8n-workflow@0.126.0 on n8n-node-dev 🔖 Release n8n-core@0.144.0 ⬆️ Set n8n-workflow@0.126.0 on n8n-core 🔖 Release n8n-workflow@0.126.0 fix: Apply SpecialNodeParameters to the types generated for the frontend (no-changelog) (#4715)
- Loading branch information
Showing
97 changed files
with
849 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
const fetch = require('node-fetch'); | ||
const { defineConfig } = require('cypress'); | ||
|
||
const BASE_URL = 'http://localhost:5678'; | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:5678', | ||
baseUrl: BASE_URL, | ||
video: false, | ||
screenshotOnRunFailure: true, | ||
experimentalSessionAndOrigin: true, | ||
experimentalInteractiveRunEvents: true, | ||
|
||
setupNodeEvents(on) { | ||
on('task', { | ||
'db:reset': () => fetch(BASE_URL + '/e2e/db/reset', { method: 'POST' }), | ||
'db:setup-owner': (payload) => | ||
fetch(BASE_URL + '/e2e/db/setup-owner', { | ||
method: 'POST', | ||
body: JSON.stringify(payload), | ||
headers: { 'Content-Type': 'application/json' }, | ||
}), | ||
}); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
import {DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD} from "../constants"; | ||
import {randFirstName, randLastName} from "@ngneat/falso"; | ||
import { DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD } from '../constants'; | ||
import { randFirstName, randLastName } from '@ngneat/falso'; | ||
|
||
const username = DEFAULT_USER_EMAIL; | ||
const email = DEFAULT_USER_EMAIL; | ||
const password = DEFAULT_USER_PASSWORD; | ||
const firstName = randFirstName(); | ||
const lastName = randLastName(); | ||
|
||
describe('Authentication', () => { | ||
beforeEach(() => { | ||
cy.task('db:reset'); | ||
}); | ||
|
||
it('should setup owner', () => { | ||
cy.signup(username, firstName, lastName, password); | ||
cy.signup(email, firstName, lastName, password); | ||
}); | ||
|
||
it('should sign user in', () => { | ||
cy.task('db:setup-owner', { email, password, firstName, lastName }); | ||
cy.on('uncaught:exception', (err, runnable) => { | ||
expect(err.message).to.include('Not logged in'); | ||
|
||
return false; | ||
}) | ||
}); | ||
|
||
cy.signin(username, password); | ||
cy.signin(email, password); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,115 @@ | ||
describe('Authentication', () => { | ||
it('should skip owner setup', () => { | ||
cy.skipSetup(); | ||
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 username = DEFAULT_USER_EMAIL; | ||
const password = DEFAULT_USER_PASSWORD; | ||
const firstName = randFirstName(); | ||
const lastName = randLastName(); | ||
|
||
describe('Default owner', () => { | ||
// todo test should redirect to setup if have not skipped | ||
|
||
beforeEach(() => { | ||
cy.task('db:reset'); | ||
}); | ||
|
||
// todo test for adding workflow | ||
// todo test for setting up UM again through settings | ||
// todo test that workflows migrated successfully | ||
it('should be able to use n8n without user management and setup UM', () => { | ||
describe('should skip owner setup', () => { | ||
cy.skipSetup(); | ||
cy.url().should('include', workflowsPage.url); | ||
}); | ||
|
||
describe('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'); | ||
}); | ||
|
||
describe('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); | ||
}); | ||
|
||
describe('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); | ||
}); | ||
|
||
describe('should be able to setup instance and migrate workflows and credentials', () => { | ||
cy.signup(username, firstName, lastName, password); | ||
|
||
messageBox.getters.content().should('contain.text', '1 existing workflow and 1 credential') | ||
|
||
messageBox.actions.confirm(); | ||
}); | ||
|
||
describe('should be redirected back to users page after setup', () => { | ||
cy.url().should('include', settingsUsersPage.url); | ||
// todo test users and that owner exist | ||
}); | ||
|
||
describe('can click back to workflows and have migrated workflow after setup', () => { | ||
settingsSidebar.actions.back(); | ||
|
||
cy.url().should('include', workflowsPage.url); | ||
|
||
workflowsPage.getters.workflowCards().should('have.length', 1); | ||
}); | ||
|
||
describe('can click back to main menu and have migrated credential after setup', () => { | ||
mainSidebar.actions.goToCredentials(); | ||
|
||
cy.url().should('include', workflowsPage.url); | ||
|
||
workflowsPage.getters.workflowCards().should('have.length', 1); | ||
}); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './credentials-modal'; | ||
export * from './message-box'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BasePage } from "./base"; | ||
|
||
export class SettingsUsersPage extends BasePage { | ||
url = '/settings/users'; | ||
getters = { | ||
setUpOwnerButton: () => cy.getByTestId('action-box').find('button'), | ||
} | ||
actions = { | ||
goToOwnerSetup: () => this.getters.setUpOwnerButton().click(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './main-sidebar'; | ||
export * from './settings-sidebar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { BasePage } from "../base"; | ||
|
||
export class MainSidebar extends BasePage { | ||
getters = { | ||
settings: () => cy.getByTestId('menu-item-settings', { timeout: 5000 }), | ||
templates: () => cy.getByTestId('menu-item-templates'), | ||
workflows: () => cy.getByTestId('menu-item-workflows'), | ||
credentials: () => cy.getByTestId('menu-item-credentials'), | ||
executions: () => cy.getByTestId('menu-item-executions'), | ||
}; | ||
actions = { | ||
goToSettings: () => this.getters.settings().click(), | ||
goToCredentials: () => this.getters.credentials().click(), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { BasePage } from "../base"; | ||
|
||
export class SettingsSidebar extends BasePage { | ||
getters = { | ||
personal: () => cy.getByTestId('menu-item-settings-personal'), | ||
users: () => cy.getByTestId('menu-item-settings-users'), | ||
api: () => cy.getByTestId('menu-item-settings-api'), | ||
communityNodes: () => cy.getByTestId('menu-item-settings-community-nodes'), | ||
back: () => cy.getByTestId('settings-back'), | ||
}; | ||
actions = { | ||
back: () => this.getters.back().click(), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.