ci: Do not reset the server for every e2e sub-test (no-changelog) (#5521)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-02-24 18:07:35 +01:00
committed by GitHub
parent 88de6613bd
commit d09ca875ec
17 changed files with 470 additions and 273 deletions

View File

@@ -10,9 +10,12 @@ const WorkflowPage = new WorkflowPageClass();
const ndv = new NDV(); const ndv = new NDV();
describe('Undo/Redo', () => { describe('Undo/Redo', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
WorkflowPage.actions.visit(); WorkflowPage.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
}); });
@@ -38,7 +41,11 @@ describe('Undo/Redo', () => {
it('should undo/redo adding node in the middle', () => { it('should undo/redo adding node in the middle', () => {
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME); WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME); WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
WorkflowPage.actions.addNodeBetweenNodes(SCHEDULE_TRIGGER_NODE_NAME, CODE_NODE_NAME, SET_NODE_NAME) WorkflowPage.actions.addNodeBetweenNodes(
SCHEDULE_TRIGGER_NODE_NAME,
CODE_NODE_NAME,
SET_NODE_NAME,
);
WorkflowPage.actions.zoomToFit(); WorkflowPage.actions.zoomToFit();
WorkflowPage.actions.hitUndo(); WorkflowPage.actions.hitUndo();
WorkflowPage.getters.canvasNodes().should('have.have.length', 2); WorkflowPage.getters.canvasNodes().should('have.have.length', 2);

View File

@@ -21,9 +21,12 @@ const ZOOM_OUT_X2_FACTOR = 0.64;
const RENAME_NODE_NAME = 'Something else'; const RENAME_NODE_NAME = 'Something else';
describe('Canvas Actions', () => { describe('Canvas Actions', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
WorkflowPage.actions.visit(); WorkflowPage.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
}); });
@@ -46,14 +49,16 @@ describe('Canvas Actions', () => {
// Change connection from Set to Set1 // Change connection from Set to Set1
cy.draganddrop( cy.draganddrop(
WorkflowPage.getters.getEndpointSelector('input', SET_NODE_NAME), WorkflowPage.getters.getEndpointSelector('input', SET_NODE_NAME),
WorkflowPage.getters.getEndpointSelector('input', `${SET_NODE_NAME}1`) WorkflowPage.getters.getEndpointSelector('input', `${SET_NODE_NAME}1`),
) );
WorkflowPage.getters.canvasNodeInputEndpointByName(`${SET_NODE_NAME}1`).should('have.class', 'jtk-endpoint-connected'); WorkflowPage.getters
.canvasNodeInputEndpointByName(`${SET_NODE_NAME}1`)
.should('have.class', 'jtk-endpoint-connected');
cy.get('.jtk-connector').should('have.length', 1); cy.get('.jtk-connector').should('have.length', 1);
// Disconnect Set1 // Disconnect Set1
cy.drag(WorkflowPage.getters.getEndpointSelector('input', `${SET_NODE_NAME}1`), [-200, 100]) cy.drag(WorkflowPage.getters.getEndpointSelector('input', `${SET_NODE_NAME}1`), [-200, 100]);
cy.get('.jtk-connector').should('have.length', 0); cy.get('.jtk-connector').should('have.length', 0);
}); });
@@ -67,7 +72,10 @@ describe('Canvas Actions', () => {
WorkflowPage.getters.canvasPlusButton().should('be.visible'); WorkflowPage.getters.canvasPlusButton().should('be.visible');
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME, true); WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME, true);
cy.drag(WorkflowPage.getters.getEndpointSelector('plus', SCHEDULE_TRIGGER_NODE_NAME), [100, 100]) cy.drag(
WorkflowPage.getters.getEndpointSelector('plus', SCHEDULE_TRIGGER_NODE_NAME),
[100, 100],
);
WorkflowPage.getters.nodeCreatorSearchBar().should('be.visible'); WorkflowPage.getters.nodeCreatorSearchBar().should('be.visible');
WorkflowPage.actions.addNodeToCanvas(IF_NODE_NAME, false); WorkflowPage.actions.addNodeToCanvas(IF_NODE_NAME, false);
@@ -79,18 +87,20 @@ describe('Canvas Actions', () => {
// Switch has 4 output endpoints // Switch has 4 output endpoints
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i++) {
WorkflowPage.getters.canvasNodePlusEndpointByName(SWITCH_NODE_NAME, i).click({ force: true }) WorkflowPage.getters.canvasNodePlusEndpointByName(SWITCH_NODE_NAME, i).click({ force: true });
WorkflowPage.getters.nodeCreatorSearchBar().should('be.visible'); WorkflowPage.getters.nodeCreatorSearchBar().should('be.visible');
WorkflowPage.actions.addNodeToCanvas(SET_NODE_NAME, false); WorkflowPage.actions.addNodeToCanvas(SET_NODE_NAME, false);
WorkflowPage.actions.zoomToFit(); WorkflowPage.actions.zoomToFit();
} }
WorkflowPage.actions.saveWorkflowOnButtonClick(); WorkflowPage.actions.saveWorkflowOnButtonClick();
cy.reload() cy.reload();
cy.waitForLoad(); cy.waitForLoad();
// Make sure all connections are there after reload // Make sure all connections are there after reload
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i++) {
const setName = `${SET_NODE_NAME}${i > 0 ? i : ''}`; const setName = `${SET_NODE_NAME}${i > 0 ? i : ''}`;
WorkflowPage.getters.canvasNodeInputEndpointByName(setName).should('have.class', 'jtk-endpoint-connected'); WorkflowPage.getters
.canvasNodeInputEndpointByName(setName)
.should('have.class', 'jtk-endpoint-connected');
} }
}); });
@@ -109,26 +119,26 @@ describe('Canvas Actions', () => {
// Connect manual to Set1 // Connect manual to Set1
cy.draganddrop( cy.draganddrop(
WorkflowPage.getters.getEndpointSelector('output', MANUAL_TRIGGER_NODE_DISPLAY_NAME), WorkflowPage.getters.getEndpointSelector('output', MANUAL_TRIGGER_NODE_DISPLAY_NAME),
WorkflowPage.getters.getEndpointSelector('input', `${SET_NODE_NAME}1`) WorkflowPage.getters.getEndpointSelector('input', `${SET_NODE_NAME}1`),
) );
cy.get('.rect-input-endpoint.jtk-endpoint-connected').should('have.length', 2); cy.get('.rect-input-endpoint.jtk-endpoint-connected').should('have.length', 2);
// Connect Set1 and Set2 to merge // Connect Set1 and Set2 to merge
cy.draganddrop( cy.draganddrop(
WorkflowPage.getters.getEndpointSelector('plus', SET_NODE_NAME), WorkflowPage.getters.getEndpointSelector('plus', SET_NODE_NAME),
WorkflowPage.getters.getEndpointSelector('input', MERGE_NODE_NAME, 0) WorkflowPage.getters.getEndpointSelector('input', MERGE_NODE_NAME, 0),
) );
cy.draganddrop( cy.draganddrop(
WorkflowPage.getters.getEndpointSelector('plus', `${SET_NODE_NAME}1`), WorkflowPage.getters.getEndpointSelector('plus', `${SET_NODE_NAME}1`),
WorkflowPage.getters.getEndpointSelector('input', MERGE_NODE_NAME, 1) WorkflowPage.getters.getEndpointSelector('input', MERGE_NODE_NAME, 1),
) );
cy.get('.rect-input-endpoint.jtk-endpoint-connected').should('have.length', 4); cy.get('.rect-input-endpoint.jtk-endpoint-connected').should('have.length', 4);
// Make sure all connections are there after save & reload // Make sure all connections are there after save & reload
WorkflowPage.actions.saveWorkflowOnButtonClick(); WorkflowPage.actions.saveWorkflowOnButtonClick();
cy.reload() cy.reload();
cy.waitForLoad(); cy.waitForLoad();
cy.get('.rect-input-endpoint.jtk-endpoint-connected').should('have.length', 4); cy.get('.rect-input-endpoint.jtk-endpoint-connected').should('have.length', 4);
@@ -156,7 +166,7 @@ describe('Canvas Actions', () => {
cy.get('.plus-draggable-endpoint').filter(':visible').should('not.have.class', 'ep-success'); cy.get('.plus-draggable-endpoint').filter(':visible').should('not.have.class', 'ep-success');
cy.get('.jtk-connector.success').should('have.length', 3); cy.get('.jtk-connector.success').should('have.length', 3);
cy.get('.jtk-connector').should('have.length', 4); cy.get('.jtk-connector').should('have.length', 4);
}) });
it('should add a connected node using plus endpoint', () => { it('should add a connected node using plus endpoint', () => {
WorkflowPage.actions.addNodeToCanvas(MANUAL_TRIGGER_NODE_NAME); WorkflowPage.actions.addNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);

View File

@@ -4,15 +4,18 @@ const workflowPage = new WorkflowPage();
const ndv = new NDV(); const ndv = new NDV();
describe('Data pinning', () => { describe('Data pinning', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit(); workflowPage.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
}); });
it('Should be able to pin node output', () => { it('Should be able to pin node output', () => {
workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger', { keepNdvOpen: true}); workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger', { keepNdvOpen: true });
ndv.getters.container().should('be.visible'); ndv.getters.container().should('be.visible');
ndv.getters.pinDataButton().should('not.exist'); ndv.getters.pinDataButton().should('not.exist');
ndv.getters.editPinnedDataButton().should('be.visible'); ndv.getters.editPinnedDataButton().should('be.visible');
@@ -43,7 +46,7 @@ describe('Data pinning', () => {
}); });
it('Should be be able to set pinned data', () => { it('Should be be able to set pinned data', () => {
workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger', { keepNdvOpen: true}); workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger', { keepNdvOpen: true });
ndv.getters.container().should('be.visible'); ndv.getters.container().should('be.visible');
ndv.getters.pinDataButton().should('not.exist'); ndv.getters.pinDataButton().should('not.exist');
ndv.getters.editPinnedDataButton().should('be.visible'); ndv.getters.editPinnedDataButton().should('be.visible');

View File

@@ -4,15 +4,20 @@ const wf = new WorkflowPage();
const ndv = new NDV(); const ndv = new NDV();
describe('Data transformation expressions', () => { describe('Data transformation expressions', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
wf.actions.visit(); wf.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
cy.window() cy.window()
// @ts-ignore // @ts-ignore
.then(win => win.onBeforeUnload && win.removeEventListener('beforeunload', win.onBeforeUnload)); .then(
(win) => win.onBeforeUnload && win.removeEventListener('beforeunload', win.onBeforeUnload),
);
}); });
it('$json + native string methods', () => { it('$json + native string methods', () => {
@@ -26,7 +31,7 @@ describe('Data transformation expressions', () => {
ndv.getters.inlineExpressionEditorInput().clear().type(input); ndv.getters.inlineExpressionEditorInput().clear().type(input);
ndv.actions.execute(); ndv.actions.execute();
ndv.getters.outputDataContainer().should('be.visible') ndv.getters.outputDataContainer().should('be.visible');
ndv.getters.outputDataContainer().contains(output); ndv.getters.outputDataContainer().contains(output);
}); });
@@ -41,7 +46,7 @@ describe('Data transformation expressions', () => {
ndv.getters.inlineExpressionEditorInput().clear().type(input); ndv.getters.inlineExpressionEditorInput().clear().type(input);
ndv.actions.execute(); ndv.actions.execute();
ndv.getters.outputDataContainer().should('be.visible') ndv.getters.outputDataContainer().should('be.visible');
ndv.getters.outputDataContainer().contains(output); ndv.getters.outputDataContainer().contains(output);
}); });
@@ -56,7 +61,7 @@ describe('Data transformation expressions', () => {
ndv.getters.inlineExpressionEditorInput().clear().type(input); ndv.getters.inlineExpressionEditorInput().clear().type(input);
ndv.actions.execute(); ndv.actions.execute();
ndv.getters.outputDataContainer().should('be.visible') ndv.getters.outputDataContainer().should('be.visible');
ndv.getters.outputDataContainer().contains(output); ndv.getters.outputDataContainer().contains(output);
}); });
@@ -71,7 +76,7 @@ describe('Data transformation expressions', () => {
ndv.getters.inlineExpressionEditorInput().clear().type(input); ndv.getters.inlineExpressionEditorInput().clear().type(input);
ndv.actions.execute(); ndv.actions.execute();
ndv.getters.outputDataContainer().should('be.visible') ndv.getters.outputDataContainer().should('be.visible');
ndv.getters.outputDataContainer().contains(output); ndv.getters.outputDataContainer().contains(output);
}); });
@@ -86,7 +91,7 @@ describe('Data transformation expressions', () => {
ndv.getters.inlineExpressionEditorInput().clear().type(input); ndv.getters.inlineExpressionEditorInput().clear().type(input);
ndv.actions.execute(); ndv.actions.execute();
ndv.getters.outputDataContainer().should('be.visible') ndv.getters.outputDataContainer().should('be.visible');
ndv.getters.outputDataContainer().contains(output); ndv.getters.outputDataContainer().contains(output);
}); });

View File

@@ -9,15 +9,20 @@ const workflowPage = new WorkflowPage();
const ndv = new NDV(); const ndv = new NDV();
describe('Data mapping', () => { describe('Data mapping', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit(); workflowPage.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
cy.window() cy.window()
// @ts-ignore // @ts-ignore
.then(win => win.onBeforeUnload && win.removeEventListener('beforeunload', win.onBeforeUnload)) .then(
(win) => win.onBeforeUnload && win.removeEventListener('beforeunload', win.onBeforeUnload),
);
}); });
it('maps expressions from table header', () => { it('maps expressions from table header', () => {
@@ -30,15 +35,29 @@ describe('Data mapping', () => {
ndv.getters.inputDataContainer().get('table', { timeout: 10000 }).should('exist'); ndv.getters.inputDataContainer().get('table', { timeout: 10000 }).should('exist');
ndv.getters.nodeParameters().find('input[placeholder*="Add Value"]').click(); ndv.getters.nodeParameters().find('input[placeholder*="Add Value"]').click();
ndv.getters.nodeParameters().find('.el-select-dropdown__list li:nth-child(3)').should('have.text', 'String').click(); ndv.getters
ndv.getters.parameterInput('name').should('have.length', 1).find('input').should('have.value', 'propertyName'); .nodeParameters()
ndv.getters.parameterInput('value').should('have.length', 1).find('input').should('have.value', ''); .find('.el-select-dropdown__list li:nth-child(3)')
.should('have.text', 'String')
.click();
ndv.getters
.parameterInput('name')
.should('have.length', 1)
.find('input')
.should('have.value', 'propertyName');
ndv.getters
.parameterInput('value')
.should('have.length', 1)
.find('input')
.should('have.value', '');
ndv.actions.mapDataFromHeader(1, 'value'); ndv.actions.mapDataFromHeader(1, 'value');
ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.timestamp }}'); ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.timestamp }}');
ndv.actions.mapDataFromHeader(2, 'value'); ndv.actions.mapDataFromHeader(2, 'value');
ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.timestamp }} {{ $json["Readable date"] }}'); ndv.getters
.inlineExpressionEditorInput()
.should('have.text', '{{ $json.timestamp }} {{ $json["Readable date"] }}');
}); });
it('maps expressions from table json, and resolves value based on hover', () => { it('maps expressions from table json, and resolves value based on hover', () => {
@@ -50,40 +69,56 @@ describe('Data mapping', () => {
ndv.actions.switchInputMode('Table'); ndv.actions.switchInputMode('Table');
ndv.getters.inputDataContainer().get('table', { timeout: 10000 }).should('exist'); ndv.getters.inputDataContainer().get('table', { timeout: 10000 }).should('exist');
ndv.getters.parameterInput('name').should('have.length', 1).find('input').should('have.value', 'other'); ndv.getters
ndv.getters.parameterInput('value').should('have.length', 1).find('input').should('have.value', ''); .parameterInput('name')
.should('have.length', 1)
.find('input')
.should('have.value', 'other');
ndv.getters
.parameterInput('value')
.should('have.length', 1)
.find('input')
.should('have.value', '');
ndv.getters.inputTbodyCell(1, 0).find('span').contains('count').trigger('mousedown', {force: true}); ndv.getters
.inputTbodyCell(1, 0)
.find('span')
.contains('count')
.trigger('mousedown', { force: true });
ndv.actions.mapToParameter('value'); ndv.actions.mapToParameter('value');
ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }}'); ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }}');
ndv.getters.parameterExpressionPreview('value').should('include.text', '0') ndv.getters.parameterExpressionPreview('value').should('include.text', '0');
ndv.getters.inputTbodyCell(1, 0).realHover(); ndv.getters.inputTbodyCell(1, 0).realHover();
ndv.getters.parameterExpressionPreview('value') ndv.getters
.parameterExpressionPreview('value')
.should('include.text', '0') .should('include.text', '0')
.invoke('css', 'color') .invoke('css', 'color')
.should('equal', 'rgb(125, 125, 135)'); .should('equal', 'rgb(125, 125, 135)');
ndv.getters.inputTbodyCell(2, 0).realHover(); ndv.getters.inputTbodyCell(2, 0).realHover();
ndv.getters.parameterExpressionPreview('value') ndv.getters
.should('include.text', '1') .parameterExpressionPreview('value')
.invoke('css', 'color') .should('include.text', '1')
.should('equal', 'rgb(125, 125, 135)'); .invoke('css', 'color')
.should('equal', 'rgb(125, 125, 135)');
ndv.actions.execute(); ndv.actions.execute();
ndv.getters.outputTbodyCell(1, 0).realHover(); ndv.getters.outputTbodyCell(1, 0).realHover();
ndv.getters.parameterExpressionPreview('value') ndv.getters
.parameterExpressionPreview('value')
.should('include.text', '0') .should('include.text', '0')
.invoke('css', 'color') .invoke('css', 'color')
.should('equal', 'rgb(125, 125, 135)'); // todo update color .should('equal', 'rgb(125, 125, 135)'); // todo update color
ndv.getters.outputTbodyCell(2, 0).realHover(); ndv.getters.outputTbodyCell(2, 0).realHover();
ndv.getters.parameterExpressionPreview('value') ndv.getters
.should('include.text', '1') .parameterExpressionPreview('value')
.invoke('css', 'color') .should('include.text', '1')
.should('equal', 'rgb(125, 125, 135)'); .invoke('css', 'color')
.should('equal', 'rgb(125, 125, 135)');
}); });
it('maps expressions from json view', () => { it('maps expressions from json view', () => {
@@ -94,24 +129,34 @@ describe('Data mapping', () => {
workflowPage.actions.openNode('Set'); workflowPage.actions.openNode('Set');
ndv.actions.switchInputMode('JSON'); ndv.actions.switchInputMode('JSON');
ndv.getters.inputDataContainer().should('exist').find('.json-data') ndv.getters
.should('have.text', '[{"input":[{"count":0,"with space":"!!","with.dot":"!!","with"quotes":"!!"}]},{"input":[{"count":1}]}]') .inputDataContainer()
.find('span').contains('"count"') .should('exist')
.find('.json-data')
.should(
'have.text',
'[{"input":[{"count":0,"with space":"!!","with.dot":"!!","with"quotes":"!!"}]},{"input":[{"count":1}]}]',
)
.find('span')
.contains('"count"')
.realMouseDown(); .realMouseDown();
ndv.actions.mapToParameter('value'); ndv.actions.mapToParameter('value');
ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }}'); ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }}');
ndv.getters.parameterExpressionPreview('value') ndv.getters.parameterExpressionPreview('value').should('include.text', '0');
.should('include.text', '0');
ndv.getters.inputDataContainer().find('.json-data') ndv.getters
.find('span').contains('"input"') .inputDataContainer()
.find('.json-data')
.find('span')
.contains('"input"')
.realMouseDown(); .realMouseDown();
ndv.actions.mapToParameter('value'); ndv.actions.mapToParameter('value');
ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }} {{ $json.input }}'); ndv.getters
ndv.getters.parameterExpressionPreview('value') .inlineExpressionEditorInput()
.should('include.text', '0 [object Object]'); .should('have.text', '{{ $json.input[0].count }} {{ $json.input }}');
ndv.getters.parameterExpressionPreview('value').should('include.text', '0 [object Object]');
}); });
it('maps expressions from schema view', () => { it('maps expressions from schema view', () => {
@@ -123,25 +168,19 @@ describe('Data mapping', () => {
ndv.actions.clearParameterInput('value'); ndv.actions.clearParameterInput('value');
cy.get('body').type('{esc}'); cy.get('body').type('{esc}');
ndv.getters.inputDataContainer() ndv.getters.inputDataContainer().should('exist').find('span').contains('count').realMouseDown();
.should('exist')
.find('span').contains('count')
.realMouseDown();
ndv.actions.mapToParameter('value'); ndv.actions.mapToParameter('value');
ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }}'); ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }}');
ndv.getters.parameterExpressionPreview('value') ndv.getters.parameterExpressionPreview('value').should('include.text', '0');
.should('include.text', '0');
ndv.getters.inputDataContainer() ndv.getters.inputDataContainer().find('span').contains('input').realMouseDown();
.find('span').contains('input')
.realMouseDown();
ndv.actions.mapToParameter('value'); ndv.actions.mapToParameter('value');
ndv.getters.inlineExpressionEditorInput().should('have.text', '{{ $json.input[0].count }} {{ $json.input }}'); ndv.getters
ndv.getters.parameterExpressionPreview('value') .inlineExpressionEditorInput()
.should('include.text', '0 [object Object]'); .should('have.text', '{{ $json.input[0].count }} {{ $json.input }}');
ndv.getters.parameterExpressionPreview('value').should('include.text', '0 [object Object]');
}); });
it('maps expressions from previous nodes', () => { it('maps expressions from previous nodes', () => {
@@ -150,32 +189,33 @@ describe('Data mapping', () => {
ndv.actions.selectInputNode(SCHEDULE_TRIGGER_NODE_NAME); ndv.actions.selectInputNode(SCHEDULE_TRIGGER_NODE_NAME);
ndv.getters.inputDataContainer() ndv.getters.inputDataContainer().find('span').contains('count').realMouseDown();
.find('span').contains('count')
.realMouseDown();
ndv.actions.mapToParameter('value'); ndv.actions.mapToParameter('value');
ndv.getters.inlineExpressionEditorInput().should('have.text', `{{ $node["${SCHEDULE_TRIGGER_NODE_NAME}"].json.input[0].count }}`); ndv.getters
ndv.getters.parameterExpressionPreview('value') .inlineExpressionEditorInput()
.should('not.exist'); .should('have.text', `{{ $node["${SCHEDULE_TRIGGER_NODE_NAME}"].json.input[0].count }}`);
ndv.getters.parameterExpressionPreview('value').should('not.exist');
ndv.actions.switchInputMode('Table'); ndv.actions.switchInputMode('Table');
ndv.actions.mapDataFromHeader(1, 'value'); ndv.actions.mapDataFromHeader(1, 'value');
ndv.getters.inlineExpressionEditorInput().should('have.text', `{{ $node["${SCHEDULE_TRIGGER_NODE_NAME}"].json.input[0].count }} {{ $node["${SCHEDULE_TRIGGER_NODE_NAME}"].json.input }}`); ndv.getters
ndv.getters.parameterExpressionPreview('value') .inlineExpressionEditorInput()
.should('not.exist'); .should(
'have.text',
`{{ $node["${SCHEDULE_TRIGGER_NODE_NAME}"].json.input[0].count }} {{ $node["${SCHEDULE_TRIGGER_NODE_NAME}"].json.input }}`,
);
ndv.getters.parameterExpressionPreview('value').should('not.exist');
ndv.actions.selectInputNode('Set'); ndv.actions.selectInputNode('Set');
ndv.actions.executePrevious(); ndv.actions.executePrevious();
ndv.getters.executingLoader().should('not.exist'); ndv.getters.executingLoader().should('not.exist');
ndv.getters.inputDataContainer().should('exist'); ndv.getters.inputDataContainer().should('exist');
ndv.getters.parameterExpressionPreview('value') ndv.getters.parameterExpressionPreview('value').should('include.text', '0 [object Object]');
.should('include.text', '0 [object Object]');
ndv.getters.inputTbodyCell(2, 0).realHover(); ndv.getters.inputTbodyCell(2, 0).realHover();
ndv.getters.parameterExpressionPreview('value') ndv.getters.parameterExpressionPreview('value').should('include.text', '1 [object Object]');
.should('include.text', '1 [object Object]');
}); });
it('maps keys to path', () => { it('maps keys to path', () => {
@@ -186,20 +226,20 @@ describe('Data mapping', () => {
{ {
input: [ input: [
{ {
"hello.world": { 'hello.world': {
"my count": 0, 'my count': 0,
}, },
} },
] ],
}, },
{ {
input: [ input: [
{ {
"hello.world": { 'hello.world': {
"my count": 1, 'my count': 1,
} },
} },
] ],
}, },
]); ]);
@@ -208,21 +248,18 @@ describe('Data mapping', () => {
workflowPage.actions.addNodeToCanvas('Item Lists'); workflowPage.actions.addNodeToCanvas('Item Lists');
workflowPage.actions.openNode('Item Lists'); workflowPage.actions.openNode('Item Lists');
ndv.getters.parameterInput('operation') ndv.getters.parameterInput('operation').click().find('li').contains('Sort').click();
.click()
.find('li').contains('Sort')
.click();
ndv.getters.nodeParameters().find('button').contains('Add Field To Sort By').click(); ndv.getters.nodeParameters().find('button').contains('Add Field To Sort By').click();
ndv.getters.inputDataContainer() ndv.getters.inputDataContainer().find('span').contains('my count').realMouseDown();
.find('span').contains('my count')
.realMouseDown();
ndv.actions.mapToParameter('fieldName'); ndv.actions.mapToParameter('fieldName');
ndv.getters.inlineExpressionEditorInput().should('have.length', 0); ndv.getters.inlineExpressionEditorInput().should('have.length', 0);
ndv.getters.parameterInput('fieldName') ndv.getters
.find('input').should('have.value', 'input[0]["hello.world"]["my count"]'); .parameterInput('fieldName')
.find('input')
.should('have.value', 'input[0]["hello.world"]["my count"]');
}); });
}); });

View File

@@ -5,7 +5,7 @@ const workflowPage = new WorkflowPage();
const ndv = new NDV(); const ndv = new NDV();
describe('Schedule Trigger node', async () => { describe('Schedule Trigger node', async () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
}); });
@@ -42,34 +42,44 @@ describe('Schedule Trigger node', async () => {
workflowPage.actions.activateWorkflow(); workflowPage.actions.activateWorkflow();
workflowPage.getters.activatorSwitch().should('have.class', 'is-checked'); workflowPage.getters.activatorSwitch().should('have.class', 'is-checked');
cy.request("GET", '/rest/workflows').then((response) => { cy.request('GET', '/rest/workflows')
expect(response.status).to.eq(200); .then((response) => {
expect(response.body.data).to.have.length(1);
const workflowId = response.body.data[0].id.toString();
expect(workflowId).to.not.be.empty;
return workflowId;
}).then((workflowId) => {
cy.wait(1200);
cy.request("GET", '/rest/executions').then((response) => {
expect(response.status).to.eq(200); expect(response.status).to.eq(200);
expect(response.body.data.results.length).to.be.greaterThan(0); expect(response.body.data).to.have.length(1);
const matchingExecutions = response.body.data.results.filter((execution: any) => execution.workflowId === workflowId); const workflowId = response.body.data[0].id.toString();
expect(matchingExecutions).to.have.length(1); expect(workflowId).to.not.be.empty;
return workflowId; return workflowId;
}).then((workflowId) => { })
.then((workflowId) => {
cy.wait(1200); cy.wait(1200);
cy.request("GET", '/rest/executions').then((response) => { cy.request('GET', '/rest/executions')
expect(response.status).to.eq(200); .then((response) => {
expect(response.body.data.results.length).to.be.greaterThan(0); expect(response.status).to.eq(200);
const matchingExecutions = response.body.data.results.filter((execution: any) => execution.workflowId === workflowId); expect(response.body.data.results.length).to.be.greaterThan(0);
expect(matchingExecutions).to.have.length(2); const matchingExecutions = response.body.data.results.filter(
}).then(()=>{ (execution: any) => execution.workflowId === workflowId,
workflowPage.actions.activateWorkflow(); );
workflowPage.getters.activatorSwitch().should('not.have.class', 'is-checked'); expect(matchingExecutions).to.have.length(1);
cy.visit(workflowsPage.url); return workflowId;
workflowsPage.actions.deleteWorkFlow('Schedule Trigger Workflow'); })
}); .then((workflowId) => {
cy.wait(1200);
cy.request('GET', '/rest/executions')
.then((response) => {
expect(response.status).to.eq(200);
expect(response.body.data.results.length).to.be.greaterThan(0);
const matchingExecutions = response.body.data.results.filter(
(execution: any) => execution.workflowId === workflowId,
);
expect(matchingExecutions).to.have.length(2);
})
.then(() => {
workflowPage.actions.activateWorkflow();
workflowPage.getters.activatorSwitch().should('not.have.class', 'is-checked');
cy.visit(workflowsPage.url);
workflowsPage.actions.deleteWorkFlow('Schedule Trigger Workflow');
});
});
}); });
});
}); });
}); });

View File

@@ -27,7 +27,7 @@ const simpleWebhookCall = (options: SimpleWebhookCallOptions) => {
respondWith, respondWith,
responseData, responseData,
executeNow = true, executeNow = true,
} = options; } = options;
workflowPage.actions.addInitialNodeToCanvas('Webhook'); workflowPage.actions.addInitialNodeToCanvas('Webhook');
workflowPage.actions.openNode('Webhook'); workflowPage.actions.openNode('Webhook');
@@ -47,43 +47,43 @@ const simpleWebhookCall = (options: SimpleWebhookCallOptions) => {
if (authentication) { if (authentication) {
cy.getByTestId('parameter-input-authentication').click(); cy.getByTestId('parameter-input-authentication').click();
cy.getByTestId('parameter-input-authentication') cy.getByTestId('parameter-input-authentication')
.find('.el-select-dropdown') .find('.el-select-dropdown')
.find('.option-headline') .find('.option-headline')
.contains(authentication) .contains(authentication)
.click(); .click();
} }
if (responseCode) { if (responseCode) {
cy.getByTestId('parameter-input-responseCode') cy.getByTestId('parameter-input-responseCode')
.find('.parameter-input') .find('.parameter-input')
.find('input') .find('input')
.clear() .clear()
.type(responseCode.toString()); .type(responseCode.toString());
} }
if (respondWith) { if (respondWith) {
cy.getByTestId('parameter-input-responseMode').click(); cy.getByTestId('parameter-input-responseMode').click();
cy.getByTestId('parameter-input-responseMode') cy.getByTestId('parameter-input-responseMode')
.find('.el-select-dropdown') .find('.el-select-dropdown')
.find('.option-headline') .find('.option-headline')
.contains(respondWith) .contains(respondWith)
.click(); .click();
} }
if (responseData) { if (responseData) {
cy.getByTestId('parameter-input-responseData').click(); cy.getByTestId('parameter-input-responseData').click();
cy.getByTestId('parameter-input-responseData') cy.getByTestId('parameter-input-responseData')
.find('.el-select-dropdown') .find('.el-select-dropdown')
.find('.option-headline') .find('.option-headline')
.contains(responseData) .contains(responseData)
.click(); .click();
} }
if (executeNow) { if (executeNow) {
ndv.actions.execute(); ndv.actions.execute();
cy.wait(waitForWebhook); cy.wait(waitForWebhook);
cy.request(method, '/webhook-test/'+ webhookPath).then((response) => { cy.request(method, '/webhook-test/' + webhookPath).then((response) => {
expect(response.status).to.eq(200); expect(response.status).to.eq(200);
ndv.getters.outputPanel().contains('headers'); ndv.getters.outputPanel().contains('headers');
}); });
@@ -91,36 +91,41 @@ const simpleWebhookCall = (options: SimpleWebhookCallOptions) => {
}; };
describe('Webhook Trigger node', async () => { describe('Webhook Trigger node', async () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit(); workflowPage.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
cy.window() cy.window()
// @ts-ignore // @ts-ignore
.then(win => win.onBeforeUnload && win.removeEventListener('beforeunload', win.onBeforeUnload)); .then(
(win) => win.onBeforeUnload && win.removeEventListener('beforeunload', win.onBeforeUnload),
);
}); });
it('should listen for a GET request', () => { it('should listen for a GET request', () => {
simpleWebhookCall({method: 'GET', webhookPath: uuid(), executeNow: true}); simpleWebhookCall({ method: 'GET', webhookPath: uuid(), executeNow: true });
}); });
it('should listen for a POST request', () => { it('should listen for a POST request', () => {
simpleWebhookCall({method: 'POST', webhookPath: uuid(), executeNow: true}); simpleWebhookCall({ method: 'POST', webhookPath: uuid(), executeNow: true });
}); });
it('should listen for a DELETE request', () => { it('should listen for a DELETE request', () => {
simpleWebhookCall({method: 'DELETE', webhookPath: uuid(), executeNow: true}); simpleWebhookCall({ method: 'DELETE', webhookPath: uuid(), executeNow: true });
}); });
it('should listen for a HEAD request', () => { it('should listen for a HEAD request', () => {
simpleWebhookCall({method: 'HEAD', webhookPath: uuid(), executeNow: true}); simpleWebhookCall({ method: 'HEAD', webhookPath: uuid(), executeNow: true });
}); });
it('should listen for a PATCH request', () => { it('should listen for a PATCH request', () => {
simpleWebhookCall({method: 'PATCH', webhookPath: uuid(), executeNow: true}); simpleWebhookCall({ method: 'PATCH', webhookPath: uuid(), executeNow: true });
}); });
it('should listen for a PUT request', () => { it('should listen for a PUT request', () => {
simpleWebhookCall({method: 'PUT', webhookPath: uuid(), executeNow: true}); simpleWebhookCall({ method: 'PUT', webhookPath: uuid(), executeNow: true });
}); });
it('should listen for a GET request and respond with Respond to Webhook node', () => { it('should listen for a GET request and respond with Respond to Webhook node', () => {
@@ -138,7 +143,10 @@ describe('Webhook Trigger node', async () => {
workflowPage.actions.openNode('Set'); workflowPage.actions.openNode('Set');
cy.get('.add-option').click(); cy.get('.add-option').click();
cy.get('.add-option').find('.el-select-dropdown__item').contains('Number').click(); cy.get('.add-option').find('.el-select-dropdown__item').contains('Number').click();
cy.get('.fixed-collection-parameter').getByTestId('parameter-input-name').clear().type('MyValue'); cy.get('.fixed-collection-parameter')
.getByTestId('parameter-input-name')
.clear()
.type('MyValue');
cy.get('.fixed-collection-parameter').getByTestId('parameter-input-value').clear().type('1234'); cy.get('.fixed-collection-parameter').getByTestId('parameter-input-value').clear().type('1234');
ndv.getters.backToCanvas().click(); ndv.getters.backToCanvas().click();
@@ -147,7 +155,7 @@ describe('Webhook Trigger node', async () => {
workflowPage.actions.executeWorkflow(); workflowPage.actions.executeWorkflow();
cy.wait(waitForWebhook); cy.wait(waitForWebhook);
cy.request('GET', '/webhook-test/'+ webhookPath).then((response) => { cy.request('GET', '/webhook-test/' + webhookPath).then((response) => {
expect(response.status).to.eq(200); expect(response.status).to.eq(200);
expect(response.body.MyValue).to.eq(1234); expect(response.body.MyValue).to.eq(1234);
}); });
@@ -165,7 +173,7 @@ describe('Webhook Trigger node', async () => {
ndv.actions.execute(); ndv.actions.execute();
cy.wait(waitForWebhook); cy.wait(waitForWebhook);
cy.request('GET', '/webhook-test/'+ webhookPath).then((response) => { cy.request('GET', '/webhook-test/' + webhookPath).then((response) => {
expect(response.status).to.eq(201); expect(response.status).to.eq(201);
}); });
}); });
@@ -184,14 +192,17 @@ describe('Webhook Trigger node', async () => {
workflowPage.actions.openNode('Set'); workflowPage.actions.openNode('Set');
cy.get('.add-option').click(); cy.get('.add-option').click();
cy.get('.add-option').find('.el-select-dropdown__item').contains('Number').click(); cy.get('.add-option').find('.el-select-dropdown__item').contains('Number').click();
cy.get('.fixed-collection-parameter').getByTestId('parameter-input-name').clear().type('MyValue'); cy.get('.fixed-collection-parameter')
.getByTestId('parameter-input-name')
.clear()
.type('MyValue');
cy.get('.fixed-collection-parameter').getByTestId('parameter-input-value').clear().type('1234'); cy.get('.fixed-collection-parameter').getByTestId('parameter-input-value').clear().type('1234');
ndv.getters.backToCanvas().click(); ndv.getters.backToCanvas().click();
workflowPage.actions.executeWorkflow(); workflowPage.actions.executeWorkflow();
cy.wait(waitForWebhook); cy.wait(waitForWebhook);
cy.request('GET', '/webhook-test/'+ webhookPath).then((response) => { cy.request('GET', '/webhook-test/' + webhookPath).then((response) => {
expect(response.status).to.eq(200); expect(response.status).to.eq(200);
expect(response.body.MyValue).to.eq(1234); expect(response.body.MyValue).to.eq(1234);
}); });
@@ -213,10 +224,14 @@ describe('Webhook Trigger node', async () => {
cy.get('.add-option').click(); cy.get('.add-option').click();
cy.get('.add-option').find('.el-select-dropdown__item').contains('String').click(); cy.get('.add-option').find('.el-select-dropdown__item').contains('String').click();
cy.get('.fixed-collection-parameter').getByTestId('parameter-input-name').clear().type('data'); cy.get('.fixed-collection-parameter').getByTestId('parameter-input-name').clear().type('data');
cy.get('.fixed-collection-parameter').getByTestId('parameter-input-value').clear().find('input').invoke('val', cowBase64).trigger('blur'); cy.get('.fixed-collection-parameter')
.getByTestId('parameter-input-value')
.clear()
.find('input')
.invoke('val', cowBase64)
.trigger('blur');
ndv.getters.backToCanvas().click(); ndv.getters.backToCanvas().click();
workflowPage.actions.addNodeToCanvas('Move Binary Data'); workflowPage.actions.addNodeToCanvas('Move Binary Data');
workflowPage.actions.zoomToFit(); workflowPage.actions.zoomToFit();
@@ -232,7 +247,7 @@ describe('Webhook Trigger node', async () => {
workflowPage.actions.executeWorkflow(); workflowPage.actions.executeWorkflow();
cy.wait(waitForWebhook); cy.wait(waitForWebhook);
cy.request('GET', '/webhook-test/'+ webhookPath).then((response) => { cy.request('GET', '/webhook-test/' + webhookPath).then((response) => {
expect(response.status).to.eq(200); expect(response.status).to.eq(200);
expect(Object.keys(response.body).includes('data')).to.be.true; expect(Object.keys(response.body).includes('data')).to.be.true;
}); });
@@ -249,7 +264,7 @@ describe('Webhook Trigger node', async () => {
}); });
ndv.actions.execute(); ndv.actions.execute();
cy.wait(waitForWebhook); cy.wait(waitForWebhook);
cy.request('GET', '/webhook-test/'+ webhookPath).then((response) => { cy.request('GET', '/webhook-test/' + webhookPath).then((response) => {
expect(response.status).to.eq(200); expect(response.status).to.eq(200);
expect(response.body.MyValue).to.be.undefined; expect(response.body.MyValue).to.be.undefined;
}); });
@@ -273,28 +288,29 @@ describe('Webhook Trigger node', async () => {
cy.wait(waitForWebhook); cy.wait(waitForWebhook);
cy.request({ cy.request({
method: 'GET', method: 'GET',
url: '/webhook-test/'+ webhookPath, url: '/webhook-test/' + webhookPath,
auth: { auth: {
'user': 'username', user: 'username',
'pass': 'password', pass: 'password',
}, },
failOnStatusCode: false, failOnStatusCode: false,
}) })
.then((response) => { .then((response) => {
expect(response.status).to.eq(403); expect(response.status).to.eq(403);
}).then(() => { })
cy.request({ .then(() => {
method: 'GET', cy.request({
url: '/webhook-test/'+ webhookPath, method: 'GET',
auth: { url: '/webhook-test/' + webhookPath,
'user': 'test', auth: {
'pass': 'test', user: 'test',
}, pass: 'test',
failOnStatusCode: true, },
}).then((response) => { failOnStatusCode: true,
expect(response.status).to.eq(200); }).then((response) => {
expect(response.status).to.eq(200);
});
}); });
});
}); });
it('should listen for a GET request with Header Authentication', () => { it('should listen for a GET request with Header Authentication', () => {
@@ -315,25 +331,26 @@ describe('Webhook Trigger node', async () => {
cy.wait(waitForWebhook); cy.wait(waitForWebhook);
cy.request({ cy.request({
method: 'GET', method: 'GET',
url: '/webhook-test/'+ webhookPath, url: '/webhook-test/' + webhookPath,
headers: { headers: {
test: 'wrong', test: 'wrong',
}, },
failOnStatusCode: false, failOnStatusCode: false,
}) })
.then((response) => { .then((response) => {
expect(response.status).to.eq(403); expect(response.status).to.eq(403);
}).then(() => { })
cy.request({ .then(() => {
method: 'GET', cy.request({
url: '/webhook-test/'+ webhookPath, method: 'GET',
headers: { url: '/webhook-test/' + webhookPath,
test: 'test', headers: {
}, test: 'test',
failOnStatusCode: true, },
}).then((response) => { failOnStatusCode: true,
expect(response.status).to.eq(200); }).then((response) => {
expect(response.status).to.eq(200);
});
}); });
});
}); });
}); });

View File

@@ -5,9 +5,12 @@ const wf = new WorkflowPage();
const TEST_TAGS = ['Tag 1', 'Tag 2', 'Tag 3']; const TEST_TAGS = ['Tag 1', 'Tag 2', 'Tag 3'];
describe('Workflow tags', () => { describe('Workflow tags', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
wf.actions.visit(); wf.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
}); });

View File

@@ -42,8 +42,8 @@ const updatedPersonalData = {
newLastName: 'Else', newLastName: 'Else',
newEmail: 'something_else@acme.corp', newEmail: 'something_else@acme.corp',
newPassword: 'Keybo4rd', newPassword: 'Keybo4rd',
invalidPasswords: ['abc', 'longEnough', 'longenough123'] invalidPasswords: ['abc', 'longEnough', 'longenough123'],
} };
const usersSettingsPage = new SettingsUsersPage(); const usersSettingsPage = new SettingsUsersPage();
const workflowPage = new WorkflowPage(); const workflowPage = new WorkflowPage();
@@ -67,7 +67,7 @@ describe('User Management', () => {
}); });
it('should prevent non-owners to access UM settings', () => { it('should prevent non-owners to access UM settings', () => {
usersSettingsPage.actions.loginAndVisit(users[0].email, users[0].password, false) usersSettingsPage.actions.loginAndVisit(users[0].email, users[0].password, false);
}); });
it('should allow instance owner to access UM settings', () => { it('should allow instance owner to access UM settings', () => {
@@ -79,7 +79,10 @@ describe('User Management', () => {
// All items in user list should be there // All items in user list should be there
usersSettingsPage.getters.userListItems().should('have.length', 3); usersSettingsPage.getters.userListItems().should('have.length', 3);
// List item for current user should have the `Owner` badge // List item for current user should have the `Owner` badge
usersSettingsPage.getters.userItem(instanceOwner.email).find('.n8n-badge:contains("Owner")').should('exist'); usersSettingsPage.getters
.userItem(instanceOwner.email)
.find('.n8n-badge:contains("Owner")')
.should('exist');
// Other users list items should contain action pop-up list // Other users list items should contain action pop-up list
usersSettingsPage.getters.userActionsToggle(users[0].email).should('exist'); usersSettingsPage.getters.userActionsToggle(users[0].email).should('exist');
usersSettingsPage.getters.userActionsToggle(users[1].email).should('exist'); usersSettingsPage.getters.userActionsToggle(users[1].email).should('exist');
@@ -106,8 +109,13 @@ describe('User Management', () => {
it(`should allow user to change their personal data`, () => { it(`should allow user to change their personal data`, () => {
personalSettingsPage.actions.loginAndVisit(instanceOwner.email, instanceOwner.password); personalSettingsPage.actions.loginAndVisit(instanceOwner.email, instanceOwner.password);
personalSettingsPage.actions.updateFirstAndLastName(updatedPersonalData.newFirstName, updatedPersonalData.newLastName); personalSettingsPage.actions.updateFirstAndLastName(
personalSettingsPage.getters.currentUserName().should('contain', `${updatedPersonalData.newFirstName} ${updatedPersonalData.newLastName}`); updatedPersonalData.newFirstName,
updatedPersonalData.newLastName,
);
personalSettingsPage.getters
.currentUserName()
.should('contain', `${updatedPersonalData.newFirstName} ${updatedPersonalData.newLastName}`);
workflowPage.getters.successToast().should('contain', 'Personal details updated'); workflowPage.getters.successToast().should('contain', 'Personal details updated');
}); });
@@ -121,18 +129,30 @@ describe('User Management', () => {
it(`shouldn't allow user to change password if old password is wrong`, () => { it(`shouldn't allow user to change password if old password is wrong`, () => {
personalSettingsPage.actions.loginAndVisit(instanceOwner.email, instanceOwner.password); personalSettingsPage.actions.loginAndVisit(instanceOwner.email, instanceOwner.password);
personalSettingsPage.actions.updatePassword('iCannotRemember', updatedPersonalData.newPassword); personalSettingsPage.actions.updatePassword('iCannotRemember', updatedPersonalData.newPassword);
workflowPage.getters.errorToast().closest('div').should('contain', 'Provided current password is incorrect.'); workflowPage.getters
.errorToast()
.closest('div')
.should('contain', 'Provided current password is incorrect.');
}); });
it(`should change current user password`, () => { it(`should change current user password`, () => {
personalSettingsPage.actions.loginAndVisit(instanceOwner.email, instanceOwner.password); personalSettingsPage.actions.loginAndVisit(instanceOwner.email, instanceOwner.password);
personalSettingsPage.actions.updatePassword(instanceOwner.password, updatedPersonalData.newPassword); personalSettingsPage.actions.updatePassword(
instanceOwner.password,
updatedPersonalData.newPassword,
);
workflowPage.getters.successToast().should('contain', 'Password updated'); workflowPage.getters.successToast().should('contain', 'Password updated');
personalSettingsPage.actions.loginWithNewData(instanceOwner.email, updatedPersonalData.newPassword); personalSettingsPage.actions.loginWithNewData(
instanceOwner.email,
updatedPersonalData.newPassword,
);
}); });
it(`shouldn't allow users to set invalid email`, () => { it(`shouldn't allow users to set invalid email`, () => {
personalSettingsPage.actions.loginAndVisit(instanceOwner.email, updatedPersonalData.newPassword); personalSettingsPage.actions.loginAndVisit(
instanceOwner.email,
updatedPersonalData.newPassword,
);
// try without @ part // try without @ part
personalSettingsPage.actions.tryToSetInvalidEmail(updatedPersonalData.newEmail.split('@')[0]); personalSettingsPage.actions.tryToSetInvalidEmail(updatedPersonalData.newEmail.split('@')[0]);
// try without domain // try without domain
@@ -140,9 +160,15 @@ describe('User Management', () => {
}); });
it(`should change user email`, () => { it(`should change user email`, () => {
personalSettingsPage.actions.loginAndVisit(instanceOwner.email, updatedPersonalData.newPassword); personalSettingsPage.actions.loginAndVisit(
instanceOwner.email,
updatedPersonalData.newPassword,
);
personalSettingsPage.actions.updateEmail(updatedPersonalData.newEmail); personalSettingsPage.actions.updateEmail(updatedPersonalData.newEmail);
workflowPage.getters.successToast().should('contain', 'Personal details updated'); workflowPage.getters.successToast().should('contain', 'Personal details updated');
personalSettingsPage.actions.loginWithNewData(updatedPersonalData.newEmail, updatedPersonalData.newPassword); personalSettingsPage.actions.loginWithNewData(
updatedPersonalData.newEmail,
updatedPersonalData.newPassword,
);
}); });
}); });

View File

@@ -5,10 +5,13 @@ const workflowsPage = new WorkflowsPage();
const workflowPage = new WorkflowPageClass(); const workflowPage = new WorkflowPageClass();
const ndv = new NDV(); const ndv = new NDV();
describe('Execution',() => { describe('Execution', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
cy.visit('/'); cy.visit('/');
}); });
@@ -34,17 +37,36 @@ describe('Execution',() => {
workflowPage.getters.stopExecutionWaitingForWebhookButton().should('not.exist'); workflowPage.getters.stopExecutionWaitingForWebhookButton().should('not.exist');
// Check canvas nodes after 1st step (workflow passed the manual trigger node // Check canvas nodes after 1st step (workflow passed the manual trigger node
workflowPage.getters.canvasNodeByName('Manual').within(() => cy.get('.fa-check')).should('be.visible'); workflowPage.getters
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-check').should('not.exist')); .canvasNodeByName('Manual')
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-sync-alt')).should('be.visible'); .within(() => cy.get('.fa-check'))
workflowPage.getters.canvasNodeByName('Set').within(() => cy.get('.fa-check').should('not.exist')); .should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-check').should('not.exist'));
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-sync-alt'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check').should('not.exist'));
cy.wait(2000); cy.wait(2000);
// Check canvas nodes after 2nd step (waiting node finished its execution and the http request node is about to start) // Check canvas nodes after 2nd step (waiting node finished its execution and the http request node is about to start)
workflowPage.getters.canvasNodeByName('Manual').within(() => cy.get('.fa-check')).should('be.visible'); workflowPage.getters
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-check')).should('be.visible'); .canvasNodeByName('Manual')
workflowPage.getters.canvasNodeByName('Set').within(() => cy.get('.fa-check')).should('be.visible'); .within(() => cy.get('.fa-check'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-check'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check'))
.should('be.visible');
// Clear execution data // Clear execution data
workflowPage.getters.clearExecutionDataButton().should('be.visible'); workflowPage.getters.clearExecutionDataButton().should('be.visible');
@@ -77,20 +99,39 @@ describe('Execution',() => {
workflowPage.getters.stopExecutionWaitingForWebhookButton().should('not.exist'); workflowPage.getters.stopExecutionWaitingForWebhookButton().should('not.exist');
// Check canvas nodes after 1st step (workflow passed the manual trigger node // Check canvas nodes after 1st step (workflow passed the manual trigger node
workflowPage.getters.canvasNodeByName('Manual').within(() => cy.get('.fa-check')).should('be.visible'); workflowPage.getters
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-check').should('not.exist')); .canvasNodeByName('Manual')
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-sync-alt')).should('be.visible'); .within(() => cy.get('.fa-check'))
workflowPage.getters.canvasNodeByName('Set').within(() => cy.get('.fa-check').should('not.exist')); .should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-check').should('not.exist'));
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-sync-alt'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check').should('not.exist'));
cy.wait(1000); cy.wait(1000);
workflowPage.getters.stopExecutionButton().click(); workflowPage.getters.stopExecutionButton().click();
// Check canvas nodes after workflow stopped // Check canvas nodes after workflow stopped
workflowPage.getters.canvasNodeByName('Manual').within(() => cy.get('.fa-check')).should('be.visible'); workflowPage.getters
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-check')).should('be.visible'); .canvasNodeByName('Manual')
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-sync-alt').should('not.visible')); .within(() => cy.get('.fa-check'))
workflowPage.getters.canvasNodeByName('Set').within(() => cy.get('.fa-check').should('not.exist')); .should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-check'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-sync-alt').should('not.visible'));
workflowPage.getters
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check').should('not.exist'));
// Clear execution data // Clear execution data
workflowPage.getters.clearExecutionDataButton().should('be.visible'); workflowPage.getters.clearExecutionDataButton().should('be.visible');
@@ -140,17 +181,36 @@ describe('Execution',() => {
}); });
// Check canvas nodes after 1st step (workflow passed the manual trigger node // Check canvas nodes after 1st step (workflow passed the manual trigger node
workflowPage.getters.canvasNodeByName('Webhook').within(() => cy.get('.fa-check')).should('be.visible'); workflowPage.getters
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-check').should('not.exist')); .canvasNodeByName('Webhook')
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-sync-alt')).should('be.visible'); .within(() => cy.get('.fa-check'))
workflowPage.getters.canvasNodeByName('Set').within(() => cy.get('.fa-check').should('not.exist')); .should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-check').should('not.exist'));
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-sync-alt'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check').should('not.exist'));
cy.wait(2000); cy.wait(2000);
// Check canvas nodes after 2nd step (waiting node finished its execution and the http request node is about to start) // Check canvas nodes after 2nd step (waiting node finished its execution and the http request node is about to start)
workflowPage.getters.canvasNodeByName('Webhook').within(() => cy.get('.fa-check')).should('be.visible'); workflowPage.getters
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-check')).should('be.visible'); .canvasNodeByName('Webhook')
workflowPage.getters.canvasNodeByName('Set').within(() => cy.get('.fa-check')).should('be.visible'); .within(() => cy.get('.fa-check'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-check'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check'))
.should('be.visible');
// Clear execution data // Clear execution data
workflowPage.getters.clearExecutionDataButton().should('be.visible'); workflowPage.getters.clearExecutionDataButton().should('be.visible');
@@ -200,19 +260,39 @@ describe('Execution',() => {
}); });
// Check canvas nodes after 1st step (workflow passed the manual trigger node // Check canvas nodes after 1st step (workflow passed the manual trigger node
workflowPage.getters.canvasNodeByName('Webhook').within(() => cy.get('.fa-check')).should('be.visible'); workflowPage.getters
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-check').should('not.exist')); .canvasNodeByName('Webhook')
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-sync-alt')).should('be.visible'); .within(() => cy.get('.fa-check'))
workflowPage.getters.canvasNodeByName('Set').within(() => cy.get('.fa-check').should('not.exist')); .should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-check').should('not.exist'));
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-sync-alt'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check').should('not.exist'));
cy.wait(1000); cy.wait(1000);
workflowPage.getters.stopExecutionWaitingForWebhookButton().click(); workflowPage.getters.stopExecutionWaitingForWebhookButton().click();
// Check canvas nodes after workflow stopped // Check canvas nodes after workflow stopped
workflowPage.getters.canvasNodeByName('Webhook').within(() => cy.get('.fa-check')).should('be.visible'); workflowPage.getters
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-check')).should('be.visible'); .canvasNodeByName('Webhook')
workflowPage.getters.canvasNodeByName('Wait').within(() => cy.get('.fa-sync-alt').should('not.visible')); .within(() => cy.get('.fa-check'))
workflowPage.getters.canvasNodeByName('Set').within(() => cy.get('.fa-check').should('not.exist')); .should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-check'))
.should('be.visible');
workflowPage.getters
.canvasNodeByName('Wait')
.within(() => cy.get('.fa-sync-alt').should('not.visible'));
workflowPage.getters
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check').should('not.exist'));
// Clear execution data // Clear execution data
workflowPage.getters.clearExecutionDataButton().should('be.visible'); workflowPage.getters.clearExecutionDataButton().should('be.visible');

View File

@@ -259,7 +259,7 @@ describe('Credentials', () => {
cy.contains('Create New Credential').click(); cy.contains('Create New Credential').click();
credentialsModal.getters.editCredentialModal().should('be.visible'); credentialsModal.getters.editCredentialModal().should('be.visible');
credentialsModal.getters.editCredentialModal().should('contain.text', 'Notion API'); credentialsModal.getters.editCredentialModal().should('contain.text', 'Notion API');
}) });
it('should render custom node with custom credential', () => { it('should render custom node with custom credential', () => {
workflowPage.actions.visit(); workflowPage.actions.visit();
@@ -269,5 +269,5 @@ describe('Credentials', () => {
cy.contains('Create New Credential').click(); cy.contains('Create New Credential').click();
credentialsModal.getters.editCredentialModal().should('be.visible'); credentialsModal.getters.editCredentialModal().should('be.visible');
credentialsModal.getters.editCredentialModal().should('contain.text', 'Custom E2E Credential'); credentialsModal.getters.editCredentialModal().should('contain.text', 'Custom E2E Credential');
}) });
}); });

View File

@@ -1,5 +1,5 @@
import { WorkflowPage } from "../pages"; import { WorkflowPage } from '../pages';
import { WorkflowExecutionsTab } from "../pages/workflow-executions-tab"; import { WorkflowExecutionsTab } from '../pages/workflow-executions-tab';
const workflowPage = new WorkflowPage(); const workflowPage = new WorkflowPage();
const executionsTab = new WorkflowExecutionsTab(); const executionsTab = new WorkflowExecutionsTab();
@@ -9,6 +9,9 @@ describe('Current Workflow Executions', () => {
before(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit(); workflowPage.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
cy.createFixtureWorkflow('Test_workflow_4_executions_view.json', `My test workflow`); cy.createFixtureWorkflow('Test_workflow_4_executions_view.json', `My test workflow`);
@@ -20,12 +23,14 @@ describe('Current Workflow Executions', () => {
executionsTab.getters.executionListItems().should('have.length', 11); executionsTab.getters.executionListItems().should('have.length', 11);
executionsTab.getters.successfulExecutionListItems().should('have.length', 9); executionsTab.getters.successfulExecutionListItems().should('have.length', 9);
executionsTab.getters.failedExecutionListItems().should('have.length', 2); executionsTab.getters.failedExecutionListItems().should('have.length', 2);
executionsTab.getters.executionListItems().first().invoke('attr','class').should('match', /_active_/); executionsTab.getters
.executionListItems()
.first()
.invoke('attr', 'class')
.should('match', /_active_/);
}); });
}); });
const createMockExecutions = () => { const createMockExecutions = () => {
workflowPage.actions.turnOnManualExecutionSaving(); workflowPage.actions.turnOnManualExecutionSaving();
executionsTab.actions.createManualExecutions(5); executionsTab.actions.createManualExecutions(5);
@@ -37,4 +42,4 @@ const createMockExecutions = () => {
executionsTab.actions.createManualExecutions(4); executionsTab.actions.createManualExecutions(4);
executionsTab.actions.switchToExecutionsTab(); executionsTab.actions.switchToExecutionsTab();
cy.waitForLoad(); cy.waitForLoad();
} };

View File

@@ -28,11 +28,7 @@ describe('Node Creator', () => {
it('should open node creator on trigger tab if no trigger is on canvas', () => { it('should open node creator on trigger tab if no trigger is on canvas', () => {
nodeCreatorFeature.getters.canvasAddButton().click(); nodeCreatorFeature.getters.canvasAddButton().click();
nodeCreatorFeature.getters nodeCreatorFeature.getters.nodeCreator().contains('Select a trigger').should('be.visible');
.nodeCreator()
.contains('Select a trigger')
.should('be.visible');
}); });
it('should navigate subcategory', () => { it('should navigate subcategory', () => {
@@ -86,20 +82,14 @@ describe('Node Creator', () => {
// TODO: Replace once we have canvas feature utils // TODO: Replace once we have canvas feature utils
cy.get('div').contains('Add first step').should('be.hidden'); cy.get('div').contains('Add first step').should('be.hidden');
nodeCreatorFeature.actions.openNodeCreator() nodeCreatorFeature.actions.openNodeCreator();
nodeCreatorFeature.getters nodeCreatorFeature.getters.nodeCreator().contains('What happens next?').should('be.visible');
.nodeCreator()
.contains('What happens next?')
.should('be.visible');
nodeCreatorFeature.getters.getCreatorItem('Add another trigger').click(); nodeCreatorFeature.getters.getCreatorItem('Add another trigger').click();
nodeCreatorFeature.getters.nodeCreator().contains('Select a trigger').should('be.visible'); nodeCreatorFeature.getters.nodeCreator().contains('Select a trigger').should('be.visible');
nodeCreatorFeature.getters.activeSubcategory().find('button').should('exist'); nodeCreatorFeature.getters.activeSubcategory().find('button').should('exist');
nodeCreatorFeature.getters.activeSubcategory().find('button').click(); nodeCreatorFeature.getters.activeSubcategory().find('button').click();
nodeCreatorFeature.getters nodeCreatorFeature.getters.nodeCreator().contains('What happens next?').should('be.visible');
.nodeCreator()
.contains('What happens next?')
.should('be.visible');
}); });
it('should add node to canvas from actions panel', () => { it('should add node to canvas from actions panel', () => {
@@ -110,7 +100,7 @@ describe('Node Creator', () => {
nodeCreatorFeature.getters.activeSubcategory().should('have.text', editImageNode); nodeCreatorFeature.getters.activeSubcategory().should('have.text', editImageNode);
nodeCreatorFeature.getters.getCreatorItem('Crop Image').click(); nodeCreatorFeature.getters.getCreatorItem('Crop Image').click();
NDVModal.getters.parameterInput('operation').should('contain.text', 'Crop'); NDVModal.getters.parameterInput('operation').should('contain.text', 'Crop');
}) });
it('should search through actions and confirm added action', () => { it('should search through actions and confirm added action', () => {
nodeCreatorFeature.actions.openNodeCreator(); nodeCreatorFeature.actions.openNodeCreator();

View File

@@ -6,16 +6,17 @@ const workflowPage = new WorkflowPage();
const ndv = new NDV(); const ndv = new NDV();
describe('NDV', () => { describe('NDV', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
workflowsPage.actions.createWorkflowFromCard(); workflowsPage.actions.createWorkflowFromCard();
workflowPage.actions.renameWorkflow(uuid()); workflowPage.actions.renameWorkflow(uuid());
workflowPage.actions.saveWorkflowOnButtonClick(); workflowPage.actions.saveWorkflowOnButtonClick();
}); });
it('should show up when double clicked on a node and close when Back to canvas clicked', () => { it('should show up when double clicked on a node and close when Back to canvas clicked', () => {
workflowPage.actions.addInitialNodeToCanvas('Manual'); workflowPage.actions.addInitialNodeToCanvas('Manual');
workflowPage.getters.canvasNodes().first().dblclick(); workflowPage.getters.canvasNodes().first().dblclick();

View File

@@ -5,7 +5,7 @@ const WorkflowPage = new WorkflowPageClass();
const ndv = new NDV(); const ndv = new NDV();
describe('Code node', () => { describe('Code node', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
}); });

View File

@@ -14,9 +14,12 @@ const DUPLICATE_WORKFLOW_TAG = 'Duplicate';
const WorkflowPage = new WorkflowPageClass(); const WorkflowPage = new WorkflowPageClass();
describe('Workflow Actions', () => { describe('Workflow Actions', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
});
beforeEach(() => {
WorkflowPage.actions.visit(); WorkflowPage.actions.visit();
cy.waitForLoad(); cy.waitForLoad();
}); });

View File

@@ -5,7 +5,7 @@ const workflowPage = new WorkflowPage();
const ndv = new NDV(); const ndv = new NDV();
describe('HTTP Request node', () => { describe('HTTP Request node', () => {
beforeEach(() => { before(() => {
cy.resetAll(); cy.resetAll();
cy.skipSetup(); cy.skipSetup();
}); });