Skip to content

Commit

Permalink
Merge branch 'master' into ADO-2220-agent-assistant-poc
Browse files Browse the repository at this point in the history
* master:
  refactor(core): Use consistent CSRF state validation across oAuth controllers (#9104)
  feat(core): Print the name of the migration that cannot be reverted when using `n8n db:revert` (#9473)
  fix(editor): Hard load after logout to reset stores (no-changelog) (#9500)
  refactor(core): Stop reporting `EAUTH` error codes to Sentry (no-changelog) (#9496)
  fix(core): Upgrade sheetjs to address CVE-2024-22363 (#9498)
  refactor: Remove skipped tests (no-changelog) (#9497)
  feat(editor): Add initial code for NodeView and Canvas rewrite (no-changelog) (#9135)
  fix(editor): Show input panel with not connected message (#9495)
  fix(editor): Prevent XSS in node-issues tooltip (#9490)

# Conflicts:
#	pnpm-lock.yaml
  • Loading branch information
MiloradFilipovic committed May 24, 2024
2 parents 3806ef3 + b585777 commit de21a08
Show file tree
Hide file tree
Showing 84 changed files with 4,714 additions and 794 deletions.
21 changes: 21 additions & 0 deletions cypress/e2e/18-user-management.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ describe('User Management', { disableAutoLogin: true }, () => {
cy.enableFeature('sharing');
});

it.only('should login and logout', () => {
cy.visit('/');
cy.get('input[name="email"]').type(INSTANCE_OWNER.email);
cy.get('input[name="password"]').type(INSTANCE_OWNER.password);
cy.getByTestId('form-submit-button').click();
mainSidebar.getters.logo().should('be.visible');
mainSidebar.actions.goToSettings();
settingsSidebar.getters.users().should('be.visible');

mainSidebar.actions.closeSettings();
mainSidebar.actions.openUserMenu();
cy.getByTestId('user-menu-item-logout').click();

cy.get('input[name="email"]').type(INSTANCE_MEMBERS[0].email);
cy.get('input[name="password"]').type(INSTANCE_MEMBERS[0].password);
cy.getByTestId('form-submit-button').click();
mainSidebar.getters.logo().should('be.visible');
mainSidebar.actions.goToSettings();
cy.getByTestId('menu-item').filter('#settings-users').should('not.exist');
});

it('should prevent non-owners to access UM settings', () => {
usersSettingsPage.actions.loginAndVisit(
INSTANCE_MEMBERS[0].email,
Expand Down
33 changes: 0 additions & 33 deletions cypress/e2e/2-credentials.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,6 @@ describe('Credentials', () => {
credentialsPage.getters.credentialCards().should('have.length', 1);
});

it.skip('should create a new credential using Add Credential button', () => {
credentialsPage.getters.createCredentialButton().click();

credentialsModal.getters.newCredentialModal().should('be.visible');
credentialsModal.getters.newCredentialTypeSelect().should('be.visible');
credentialsModal.getters.newCredentialTypeOption('Airtable API').click();

credentialsModal.getters.newCredentialTypeButton().click();
credentialsModal.getters.editCredentialModal().should('be.visible');
credentialsModal.getters.connectionParameter('API Key').type('1234567890');

credentialsModal.actions.setName('Airtable Account');
credentialsModal.actions.save();
credentialsModal.actions.close();

credentialsPage.getters.credentialCards().should('have.length', 2);
});

it.skip('should search credentials', () => {
// Search by name
credentialsPage.actions.search('Notion');
credentialsPage.getters.credentialCards().should('have.length', 1);

// Search by Credential type
credentialsPage.actions.search('Airtable API');
credentialsPage.getters.credentialCards().should('have.length', 1);

// No results
credentialsPage.actions.search('Google');
credentialsPage.getters.credentialCards().should('have.length', 0);
credentialsPage.getters.emptyList().should('be.visible');
});

it('should sort credentials', () => {
credentialsPage.actions.search('');
credentialsPage.actions.sortBy('nameDesc');
Expand Down
118 changes: 0 additions & 118 deletions cypress/e2e/30-workflow-filters.cy.ts

This file was deleted.

147 changes: 0 additions & 147 deletions cypress/e2e/38-custom-template-repository.cy.ts

This file was deleted.

11 changes: 10 additions & 1 deletion cypress/e2e/39-projects.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const credentialsModal = new CredentialsModal();
const executionsTab = new WorkflowExecutionsTab();

describe('Projects', () => {
beforeEach(() => {
before(() => {
cy.resetDatabase();
cy.enableFeature('sharing');
cy.enableFeature('advancedPermissions');
Expand Down Expand Up @@ -219,4 +219,13 @@ describe('Projects', () => {
menuItems.filter('[class*=active_]').should('have.length', 1);
menuItems.filter(':contains("Development")[class*=active_]').should('exist');
});

it('should not show project add button and projects to a member if not invited to any project', () => {
cy.signout();
cy.signin(INSTANCE_MEMBERS[1]);
cy.visit(workflowsPage.url);

projects.getAddProjectButton().should('not.exist');
projects.getMenuItems().should('not.exist');
});
});
8 changes: 8 additions & 0 deletions cypress/e2e/5-ndv.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ describe('NDV', () => {
ndv.getters.container().should('not.be.visible');
});

it('should show input panel when node is not connected', () => {
workflowPage.actions.addInitialNodeToCanvas('Manual');
workflowPage.actions.deselectAll();
workflowPage.actions.addNodeToCanvas('Set');
workflowPage.getters.canvasNodes().last().dblclick();
ndv.getters.container().should('be.visible').should('contain', 'Wire me up');
});

it('should test webhook node', () => {
workflowPage.actions.addInitialNodeToCanvas('Webhook');
workflowPage.getters.canvasNodes().first().dblclick();
Expand Down
5 changes: 3 additions & 2 deletions cypress/pages/sidebar/main-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class MainSidebar extends BasePage {
getters = {
menuItem: (id: string) => cy.getByTestId('menu-item').get('#' + id),
settings: () => this.getters.menuItem('settings'),
settingsBack: () => cy.getByTestId('settings-back'),
templates: () => this.getters.menuItem('templates'),
workflows: () => this.getters.menuItem('workflows'),
credentials: () => this.getters.menuItem('credentials'),
Expand All @@ -30,8 +31,8 @@ export class MainSidebar extends BasePage {
openUserMenu: () => {
this.getters.userMenu().click();
},
openUserMenu: () => {
this.getters.userMenu().click();
closeSettings: () => {
this.getters.settingsBack().click();
},
signout: () => {
const workflowsPage = new WorkflowsPage();
Expand Down
Loading

0 comments on commit de21a08

Please sign in to comment.