Skip to content

Commit

Permalink
Merge branch 'master' into N8N-5498-workflow-action-tests
Browse files Browse the repository at this point in the history
* 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
MiloradFilipovic committed Nov 25, 2022
2 parents 8932ff4 + 55c201e commit a9197d1
Show file tree
Hide file tree
Showing 97 changed files with 849 additions and 494 deletions.
41 changes: 40 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# [0.204.0](https://github.com/n8n-io/n8n/compare/n8n@0.203.1...n8n@0.204.0) (2022-11-24)


### Bug Fixes

* **core:** Fix `$items().length` behavior in `executeOnce` mode ([#4694](https://github.com/n8n-io/n8n/issues/4694)) ([b87c122](https://github.com/n8n-io/n8n/commit/b87c12285fa2b339e726f81e271715e258b6a075))
* **core:** Fix for unused imports ([a6df51b](https://github.com/n8n-io/n8n/commit/a6df51b6e83fa25dad962ab212123edb3c055cac))
* **core:** Use CredentialsOverwrites when testing credentials ([#4675](https://github.com/n8n-io/n8n/issues/4675)) ([772ec78](https://github.com/n8n-io/n8n/commit/772ec78349b5b6877bf681f3262951e3a4e34fe4))
* Disable workflow locking due to issues ([#4708](https://github.com/n8n-io/n8n/issues/4708)) ([ee6ac5d](https://github.com/n8n-io/n8n/commit/ee6ac5d3417a2f308a7f4a3cda18c01fcec57faf))
* **editor:** Fix for missing node connections in dev environment ([#4707](https://github.com/n8n-io/n8n/issues/4707)) ([b18ae18](https://github.com/n8n-io/n8n/commit/b18ae18a6b10fb125f3eed73103e33e3519cd82c))
* **editor:** Fix missing resource locator component ([#4649](https://github.com/n8n-io/n8n/issues/4649)) ([44182f2](https://github.com/n8n-io/n8n/commit/44182f23a5e62c53209b3fa19edd1727586551ff))
* **editor:** Prevent node-creator tabs from showing when toggled by CanvasAddButton ([#4661](https://github.com/n8n-io/n8n/issues/4661)) ([60746dc](https://github.com/n8n-io/n8n/commit/60746dc92ee1b6c33015e2a6a0d34bc981aa1dd5))
* **editor:** Table view column limit tooltip ([#4655](https://github.com/n8n-io/n8n/issues/4655)) ([3ac9ba3](https://github.com/n8n-io/n8n/commit/3ac9ba3491c0dc1de283bc4285a243e02747f971))
* Fix broken n8n-info-tip slots ([#4665](https://github.com/n8n-io/n8n/issues/4665)) ([6c99223](https://github.com/n8n-io/n8n/commit/6c992233a053db1ea235f785a52a754c1e694555))
* **IF Node:** Fix "Is Empty" and "Is Not Empty" operation fails for date objects ([#4670](https://github.com/n8n-io/n8n/issues/4670)) ([753f4c9](https://github.com/n8n-io/n8n/commit/753f4c9a7d34c8d3329d4dc024fcf272f6f47ff3))
* Remove redundant await in node's api request functions without try/catch ([#4639](https://github.com/n8n-io/n8n/issues/4639)) ([67983e8](https://github.com/n8n-io/n8n/commit/67983e8f945397d3fb0be55fdeb47609be92b2cb))
* **Schedule Trigger Node:** Fixes inconsitent behavior with cron and weekly intervals ([#4558](https://github.com/n8n-io/n8n/issues/4558)) ([2fb8ed8](https://github.com/n8n-io/n8n/commit/2fb8ed825b18118fc0783e95d1551ee2ce8c3a38))
* Workflow activation should not crash if one of the credential is invalid ([#4671](https://github.com/n8n-io/n8n/issues/4671)) ([c0e13c2](https://github.com/n8n-io/n8n/commit/c0e13c2a8f9374e9c65aae3ce4102e37c993cf74))


### Features

* Add credentials E2E test suite and page object ([#4596](https://github.com/n8n-io/n8n/issues/4596)) ([b5b44d1](https://github.com/n8n-io/n8n/commit/b5b44d1b598e67ef7e735d7cdfb5233ca72caca6))
* Add save confirmation modal when leaving sharing modal ([#4683](https://github.com/n8n-io/n8n/issues/4683)) ([173badc](https://github.com/n8n-io/n8n/commit/173badc4e099ebb818686dc5a25c2192c138bcd9))
* Add share button to workflows list ([#4681](https://github.com/n8n-io/n8n/issues/4681)) ([a356d7b](https://github.com/n8n-io/n8n/commit/a356d7bdbadd5a4c69c61c5a5a30e75e9765e3d2))
* **core:** Add license support to n8n ([#4566](https://github.com/n8n-io/n8n/issues/4566)) ([30e5d3d](https://github.com/n8n-io/n8n/commit/30e5d3d04c3457780875cc36637c8c1ea14ec783))
* **core:** Lazy-load nodes and credentials to reduce baseline memory usage ([#4577](https://github.com/n8n-io/n8n/issues/4577)) ([b6c57e1](https://github.com/n8n-io/n8n/commit/b6c57e19fc5683dd7fb9eabb60ec4e89359c59eb))
* **editor:** Add workflows list status filter ([#4690](https://github.com/n8n-io/n8n/issues/4690)) ([5364e7f](https://github.com/n8n-io/n8n/commit/5364e7fc9250421b799adc28b3e47dc75819ec7d))
* Show delete button based on workflow permissions ([#4686](https://github.com/n8n-io/n8n/issues/4686)) ([4f64e26](https://github.com/n8n-io/n8n/commit/4f64e26a83c7e62c98d93c38bf3dcb6cdfaadb58))
* Show toast when saving workflow sharing settings ([#4684](https://github.com/n8n-io/n8n/issues/4684)) ([6f8d0de](https://github.com/n8n-io/n8n/commit/6f8d0de55dc9c3c1cdb17329a8560ee8453c639a))
* Switch owner subview to all subview if has shared resources ([#4672](https://github.com/n8n-io/n8n/issues/4672)) ([e3e17e5](https://github.com/n8n-io/n8n/commit/e3e17e5dac685b1230e39bbef247312419b71f9b))
* Use longer stack-traces when error-reporting is enabled ([#4674](https://github.com/n8n-io/n8n/issues/4674)) ([de5b0b0](https://github.com/n8n-io/n8n/commit/de5b0b03fedede680f5a6e0f4dc73770b888bf46))


### Performance Improvements

* **Code Node:** Improve n8n item key validation performance ([#4669](https://github.com/n8n-io/n8n/issues/4669)) ([740513b](https://github.com/n8n-io/n8n/commit/740513b42440b8760cd488659e92abe9951462b0))



## [0.203.1](https://github.com/n8n-io/n8n/compare/n8n@0.203.0...n8n@0.203.1) (2022-11-18)

### Bug Fixes
Expand All @@ -9,7 +49,6 @@
### Bug Fixes

- Add back mapping hint when parameter is focused ([#4634](https://github.com/n8n-io/n8n/issues/4634)) ([b35172e](https://github.com/n8n-io/n8n/commit/b35172e442a131f76c2d902d451356ab937bba48))
- Change feature flag for starting at empty WF state for PH experiments (no-changelog) ([#4606](https://github.com/n8n-io/n8n/issues/4606)) ([d1ffc58](https://github.com/n8n-io/n8n/commit/d1ffc58aa4947e5b9f956568061a981c8ab37e65))
- **core:** Deduplicate error handling in nodes ([#4319](https://github.com/n8n-io/n8n/issues/4319)) ([c7133ec](https://github.com/n8n-io/n8n/commit/c7133ecd3fe6f022a537b6edb4c006d6786efad2))
- **editor:** Add 'Stop execution' button to execution preview ([#4632](https://github.com/n8n-io/n8n/issues/4632)) ([be7672a](https://github.com/n8n-io/n8n/commit/be7672a177bfcf997ec241af7c628a90312849b1))
- **editor:** Curb direct item access linting ([#4591](https://github.com/n8n-io/n8n/issues/4591)) ([271cd06](https://github.com/n8n-io/n8n/commit/271cd06a6ac6274a83a6a71fe76072281edf3724))
Expand Down
17 changes: 16 additions & 1 deletion cypress.config.js
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' },
}),
});
},
},
});
17 changes: 11 additions & 6 deletions cypress/e2e/0-smoke.cy.ts
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);
});
});
118 changes: 112 additions & 6 deletions cypress/e2e/3-default-owner.cy.ts
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);
});
});
});

2 changes: 2 additions & 0 deletions cypress/pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ export * from './credentials';
export * from './signin';
export * from './signup';
export * from './workflows';
export * from './workflow';
export * from './modals';
export * from './settings-users';
9 changes: 7 additions & 2 deletions cypress/pages/modals/credentials-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ export class CredentialsModal extends BasePage {
newCredentialTypeSelect: () => cy.getByTestId('new-credential-type-select'),
newCredentialTypeOption: (credentialType: string) => cy.getByTestId('new-credential-type-select-option').contains(credentialType),
newCredentialTypeButton: () => cy.getByTestId('new-credential-type-button'),
editCredentialModal: () => cy.getByTestId('editCredential-modal', { timeout: 5000 }),
connectionParameters: () => cy.getByTestId('credential-connection-parameter'),
connectionParameter: (fieldName: string) => this.getters.connectionParameters().contains(fieldName)
.parents('[data-test-id="credential-connection-parameter"]')
.find('.n8n-input input'),
name: () => cy.getByTestId('credential-name'),
nameInput: () => cy.getByTestId('credential-name').find('input'),
saveButton: () => cy.getByTestId('credential-save-button')
saveButton: () => cy.getByTestId('credential-save-button'),
closeButton: () => this.getters.editCredentialModal().find('.el-dialog__close'),
};
actions = {
setName: (name: string) => {
Expand All @@ -21,6 +23,9 @@ export class CredentialsModal extends BasePage {
},
save: () => {
this.getters.saveButton().click();
}
},
close: () => {
this.getters.closeButton().click();
},
};
}
1 change: 1 addition & 0 deletions cypress/pages/modals/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './credentials-modal';
export * from './message-box';
1 change: 1 addition & 0 deletions cypress/pages/modals/message-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export class MessageBox extends BasePage {
getters = {
modal: () => cy.get('.el-message-box', { withinSubject: null }),
header: () => this.getters.modal().find('.el-message-box__title'),
content: () => this.getters.modal().find('.el-message-box__content'),
confirm: () => this.getters.modal().find('.btn--confirm'),
cancel: () => this.getters.modal().find('.btn--cancel'),
};
Expand Down
11 changes: 11 additions & 0 deletions cypress/pages/settings-users.ts
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(),
}
}
2 changes: 2 additions & 0 deletions cypress/pages/sidebar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './main-sidebar';
export * from './settings-sidebar';
15 changes: 15 additions & 0 deletions cypress/pages/sidebar/main-sidebar.ts
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(),
};
}
14 changes: 14 additions & 0 deletions cypress/pages/sidebar/settings-sidebar.ts
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(),
};
}
2 changes: 1 addition & 1 deletion cypress/pages/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BasePage } from "./base";
export class WorkflowPage extends BasePage {
url = '/workflow/new';
getters = {
workflowNameInput: () => cy.getByTestId('workflow-name-input').then($el => cy.wrap($el.find('input'))),
workflowNameInput: () => cy.getByTestId('workflow-name-input', { timeout: 5000 }).then($el => cy.wrap($el.find('input'))),
workflowImportInput: () => cy.getByTestId('workflow-import-input'),
workflowTags: () => cy.getByTestId('workflow-tags'),
saveButton: () => cy.getByTestId('wf-save-button').children().first(),
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n",
"version": "0.203.1",
"version": "0.204.0",
"private": true,
"homepage": "https://n8n.io",
"engines": {
Expand All @@ -27,7 +27,7 @@
"webhook": "./packages/cli/bin/n8n webhook",
"worker": "./packages/cli/bin/n8n worker",
"cypress:install": "cypress install",
"test:e2e:ui": "cross-env E2E_TESTS=true CYPRESS_BASE_URL=http://localhost:5678 start-server-and-test start http://localhost:5678/favicon.ico 'cypress open'",
"test:e2e:ui": "cross-env E2E_TESTS=true start-server-and-test start http://localhost:5678/favicon.ico 'cypress open'",
"test:e2e:dev": "cross-env E2E_TESTS=true CYPRESS_BASE_URL=http://localhost:8080 start-server-and-test dev http://localhost:8080/favicon.ico 'cypress open'",
"test:e2e:smoke": "cross-env E2E_TESTS=true start-server-and-test start http://localhost:5678/favicon.ico 'cypress run --headless --spec \"cypress/e2e/0-smoke.cy.ts\"'",
"test:e2e:all": "cross-env E2E_TESTS=true start-server-and-test start http://localhost:5678/favicon.ico 'cypress run'"
Expand All @@ -42,6 +42,7 @@
"@types/node": "^16.11.22",
"cross-env": "^7.0.3",
"cypress": "^10.0.3",
"node-fetch": "^2.6.7",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"jest-mock": "^29.3.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n",
"version": "0.203.1",
"version": "0.204.0",
"description": "n8n Workflow Automation Tool",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -150,10 +150,10 @@
"lodash.split": "^4.4.2",
"lodash.unset": "^4.5.2",
"mysql2": "~2.3.0",
"n8n-core": "~0.143.0",
"n8n-editor-ui": "~0.169.0",
"n8n-nodes-base": "~0.201.1",
"n8n-workflow": "~0.125.0",
"n8n-core": "~0.144.0",
"n8n-editor-ui": "~0.170.0",
"n8n-nodes-base": "~0.202.0",
"n8n-workflow": "~0.126.0",
"nodemailer": "^6.7.1",
"oauth-1.0a": "^2.2.6",
"open": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/Db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
export let isInitialized = false;
export const collections = {} as IDatabaseCollections;

let connection: Connection;
export let connection: Connection;

export async function transaction<T>(fn: (entityManager: EntityManager) => Promise<T>): Promise<T> {
return connection.transaction(fn);
Expand Down
Loading

0 comments on commit a9197d1

Please sign in to comment.