Skip to content

Commit

Permalink
test: Add tests for parameter lag (n8n-io#6942)
Browse files Browse the repository at this point in the history
Github issue / Community forum post (link here to close automatically):
  • Loading branch information
mutdmour authored Aug 29, 2023
1 parent 4600bb3 commit e1922f7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
25 changes: 25 additions & 0 deletions cypress/e2e/5-ndv.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,29 @@ describe('NDV', () => {
ndv.getters.parameterInput('value').clear();
});
});

it('should flag issues as soon as params are set', () => {
workflowPage.actions.addInitialNodeToCanvas('Webhook');
workflowPage.getters.canvasNodes().first().dblclick();

workflowPage.getters.nodeIssuesByName('Webhook').should('not.exist');
ndv.getters.nodeExecuteButton().should('not.be.disabled');
ndv.getters.triggerPanelExecuteButton().should('exist');

ndv.getters.parameterInput('path').clear();

ndv.getters.nodeExecuteButton().should('be.disabled');
ndv.getters.triggerPanelExecuteButton().should('not.exist');
ndv.actions.close();
workflowPage.getters.nodeIssuesByName('Webhook').should('exist');

workflowPage.getters.canvasNodes().first().dblclick();
ndv.getters.parameterInput('path').type('t')

ndv.getters.nodeExecuteButton().should('not.be.disabled');
ndv.getters.triggerPanelExecuteButton().should('exist');

ndv.actions.close();
workflowPage.getters.nodeIssuesByName('Webhook').should('not.exist');
});
});
1 change: 1 addition & 0 deletions cypress/pages/ndv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class NDV extends BasePage {
copyInput: () => cy.getByTestId('copy-input'),
credentialInput: (eq = 0) => cy.getByTestId('node-credentials-select').eq(eq),
nodeExecuteButton: () => cy.getByTestId('node-execute-button'),
triggerPanelExecuteButton: () => cy.getByTestId('trigger-execute-button'),
inputSelect: () => cy.getByTestId('ndv-input-select'),
inputOption: () => cy.getByTestId('ndv-input-option'),
inputPanel: () => cy.getByTestId('ndv-input-panel'),
Expand Down
4 changes: 4 additions & 0 deletions cypress/pages/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export class WorkflowPage extends BasePage {
canvasNodes: () => cy.getByTestId('canvas-node'),
canvasNodeByName: (nodeName: string) =>
this.getters.canvasNodes().filter(`:contains(${nodeName})`),
nodeIssuesByName: (nodeName: string) =>
this.getters.canvasNodes().filter(`:contains(${nodeName})`)
.should('have.length.greaterThan', 0)
.findChildByTestId('node-issues'),
getEndpointSelector: (type: 'input' | 'output' | 'plus', nodeName: string, index = 0) => {
return `[data-endpoint-name='${nodeName}'][data-endpoint-type='${type}'][data-input-index='${index}']`;
},
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/Node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
v-if="!data.disabled"
:class="{ 'node-info-icon': true, 'shift-icon': shiftOutputCount }"
>
<div v-if="hasIssues" class="node-issues">
<div v-if="hasIssues" class="node-issues" data-test-id="node-issues">
<n8n-tooltip placement="bottom">
<template #content>
<titled-list :title="`${$locale.baseText('node.issues')}:`" :items="nodeIssues" />
Expand Down
3 changes: 3 additions & 0 deletions packages/editor-ui/src/components/TriggerPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
@copy="onTestLinkCopied"
></CopyInput>
<NodeExecuteButton
data-test-id="trigger-execute-button"
:nodeName="nodeName"
@execute="onNodeExecute"
size="medium"
Expand All @@ -49,6 +50,7 @@
</n8n-text>
</div>
<NodeExecuteButton
data-test-id="trigger-execute-button"
:nodeName="nodeName"
@execute="onNodeExecute"
size="medium"
Expand All @@ -72,6 +74,7 @@
</div>

<NodeExecuteButton
data-test-id="trigger-execute-button"
:nodeName="nodeName"
@execute="onNodeExecute"
size="medium"
Expand Down

0 comments on commit e1922f7

Please sign in to comment.