mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
feat(editor): Indicate dirty nodes with yellow borders/connectors on canvas (#13040)
This commit is contained in:
@@ -206,6 +206,10 @@ export function clickWorkflowCardContent(workflowName: string) {
|
||||
getWorkflowCardContent(workflowName).click();
|
||||
}
|
||||
|
||||
export function clickAssignmentCollectionAdd() {
|
||||
cy.getByTestId('assignment-collection-drop-area').click();
|
||||
}
|
||||
|
||||
export function assertNodeOutputHintExists() {
|
||||
getNodeOutputHint().should('exist');
|
||||
}
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
import {
|
||||
clickAssignmentCollectionAdd,
|
||||
clickGetBackToCanvas,
|
||||
getNodeRunInfoStale,
|
||||
getOutputTbodyCell,
|
||||
} from '../composables/ndv';
|
||||
import {
|
||||
clickExecuteWorkflowButton,
|
||||
getNodeByName,
|
||||
getZoomToFitButton,
|
||||
navigateToNewWorkflowPage,
|
||||
openNode,
|
||||
} from '../composables/workflow';
|
||||
import { NDV, WorkflowPage } from '../pages';
|
||||
|
||||
const canvas = new WorkflowPage();
|
||||
@@ -26,4 +39,53 @@ describe('Manual partial execution', () => {
|
||||
ndv.getters.nodeRunTooltipIndicator().should('not.exist');
|
||||
ndv.getters.outputRunSelector().should('not.exist');
|
||||
});
|
||||
|
||||
describe('partial execution v2', () => {
|
||||
beforeEach(() => {
|
||||
cy.window().then((win) => {
|
||||
win.localStorage.setItem('PartialExecution.version', '2');
|
||||
});
|
||||
navigateToNewWorkflowPage();
|
||||
});
|
||||
|
||||
it('should execute from the first dirty node up to the current node', () => {
|
||||
cy.createFixtureWorkflow('Test_workflow_partial_execution_v2.json');
|
||||
|
||||
getZoomToFitButton().click();
|
||||
|
||||
// First, execute the whole workflow
|
||||
clickExecuteWorkflowButton();
|
||||
|
||||
getNodeByName('A').findChildByTestId('canvas-node-status-success').should('be.visible');
|
||||
getNodeByName('B').findChildByTestId('canvas-node-status-success').should('be.visible');
|
||||
getNodeByName('C').findChildByTestId('canvas-node-status-success').should('be.visible');
|
||||
openNode('A');
|
||||
getOutputTbodyCell(1, 0).invoke('text').as('before', { type: 'static' });
|
||||
clickGetBackToCanvas();
|
||||
|
||||
// Change parameter of the node in the middle
|
||||
openNode('B');
|
||||
clickAssignmentCollectionAdd();
|
||||
getNodeRunInfoStale().should('be.visible');
|
||||
clickGetBackToCanvas();
|
||||
|
||||
getNodeByName('A').findChildByTestId('canvas-node-status-success').should('be.visible');
|
||||
getNodeByName('B').findChildByTestId('canvas-node-status-warning').should('be.visible');
|
||||
getNodeByName('C').findChildByTestId('canvas-node-status-success').should('be.visible');
|
||||
|
||||
// Partial execution
|
||||
getNodeByName('C').findChildByTestId('execute-node-button').click();
|
||||
|
||||
getNodeByName('A').findChildByTestId('canvas-node-status-success').should('be.visible');
|
||||
getNodeByName('B').findChildByTestId('canvas-node-status-success').should('be.visible');
|
||||
getNodeByName('C').findChildByTestId('canvas-node-status-success').should('be.visible');
|
||||
openNode('A');
|
||||
getOutputTbodyCell(1, 0).invoke('text').as('after', { type: 'static' });
|
||||
|
||||
// Assert that 'A' ran only once by comparing its output
|
||||
cy.get('@before').then((before) =>
|
||||
cy.get('@after').then((after) => expect(before).to.equal(after)),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
74
cypress/fixtures/Test_workflow_partial_execution_v2.json
Normal file
74
cypress/fixtures/Test_workflow_partial_execution_v2.json
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [{}]
|
||||
}
|
||||
},
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"typeVersion": 1.2,
|
||||
"position": [0, 0],
|
||||
"id": "dcc1c5e1-c6c1-45f8-80d5-65c88d66d56e",
|
||||
"name": "A"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "3d8f0810-84f0-41ce-a81b-0e7f04fd88cb",
|
||||
"name": "",
|
||||
"value": "",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [220, 0],
|
||||
"id": "097ffa30-d37b-4de6-bd5c-ccd945f31df1",
|
||||
"name": "B"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [440, 0],
|
||||
"id": "dc44e635-916f-4f76-a745-1add5762f730",
|
||||
"name": "C"
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"A": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "B",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"B": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "C",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {},
|
||||
"meta": {
|
||||
"instanceId": "b0d9447cff9c96796e4ac4f00fcd899b03cfac3ab3d4f748ae686d34881eae0c"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user