n8n/cypress/e2e/5-ndv.cy.ts
OlegIvaniv 1c36c37a12
test(editor): Fix flaky e2e tests (#4779)
* 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>
2022-12-07 18:16:38 +01:00

57 lines
1.7 KiB
TypeScript

import { WorkflowsPage, WorkflowPage, NDV } from '../pages';
import { v4 as uuid } from 'uuid';
const workflowsPage = new WorkflowsPage();
const workflowPage = new WorkflowPage();
const ndv = new NDV();
describe('NDV', () => {
beforeEach(() => {
cy.resetAll();
cy.skipSetup();
workflowsPage.actions.createWorkflowFromCard();
workflowPage.actions.renameWorkflow(uuid());
workflowPage.actions.saveWorkflowOnButtonClick();
});
it('should show up when double clicked on a node and close when Back to canvas clicked', () => {
workflowPage.actions.addInitialNodeToCanvas('Manual Trigger');
workflowPage.getters.canvasNodes().first().dblclick();
ndv.getters.container().should('be.visible');
ndv.getters.backToCanvas().click()
ndv.getters.container().should('not.be.visible');
});
it('should test webhook node', () => {
workflowPage.actions.addInitialNodeToCanvas('Webhook');
workflowPage.getters.canvasNodes().first().dblclick();
ndv.getters.nodeExecuteButton().first().click();
ndv.getters.copyInput().click();
cy.grantBrowserPermissions('clipboardReadWrite', 'clipboardSanitizedWrite');
cy.readClipboard().then(url => {
cy.request({
method: 'GET',
url,
}).then((resp) => {
expect(resp.status).to.eq(200)
})
});
ndv.getters.runDataDisplayMode().should('have.length.at.least', 1).and('be.visible');
});
it('should change input', () => {
cy.createFixtureWorkflow('NDV-test-select-input.json', `NDV test select input ${uuid()}`);
workflowPage.actions.zoomToFit();
workflowPage.getters.canvasNodes().last().dblclick();
ndv.getters.inputSelect().click();
ndv.getters.inputOption().last().click();
ndv.getters.inputPanel().within(() => {
ndv.getters.dataContainer().should('contain', 'start');
});
});
});