Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Improve debugging of sub-workflows #11602

Merged
merged 62 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
c49c4bb
merge in Jan's branch to master, handle conflicts
mutdmour Nov 6, 2024
f456191
add comment
mutdmour Nov 6, 2024
67e09e2
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 7, 2024
152ca97
feat: bring back UI
mutdmour Nov 7, 2024
932ca07
fix: type
mutdmour Nov 7, 2024
3df228c
feat: Add link to parent execution
mutdmour Nov 7, 2024
f121cbd
fix: handle merge conflict
mutdmour Nov 7, 2024
fe1f308
fix: add comment
mutdmour Nov 7, 2024
376fa05
merge
mutdmour Nov 7, 2024
a80a560
move to table
mutdmour Nov 7, 2024
b483c40
add hover behavior
mutdmour Nov 7, 2024
9705e42
try and fix link
mutdmour Nov 7, 2024
cd52d34
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 7, 2024
37c8a3e
fix: links to subworkflow
mutdmour Nov 7, 2024
ee4becc
merge master
mutdmour Nov 8, 2024
34f2cc5
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 8, 2024
9f56693
add metadata to output data
mutdmour Nov 8, 2024
cf5125e
fix: design
mutdmour Nov 8, 2024
e9bbc71
fix: bug with setting metadata
mutdmour Nov 8, 2024
2dcf04d
feat: support workflow retrieval debugging
mutdmour Nov 8, 2024
cc97c6c
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 11, 2024
80ae58f
feat: add telemetry
mutdmour Nov 11, 2024
7e995bd
feat: add error notification
mutdmour Nov 11, 2024
2db0b14
feat: move below selector
mutdmour Nov 11, 2024
9d6f0c5
fix: handle better case when workflow id is missing
mutdmour Nov 11, 2024
ad99023
fix: refactor to update types
mutdmour Nov 11, 2024
785b30e
fix: refactor more
mutdmour Nov 11, 2024
597aa3e
fix types
mutdmour Nov 11, 2024
f320396
feat: add subexecution count
mutdmour Nov 12, 2024
cdd6625
fix: update error
mutdmour Nov 12, 2024
668df93
fix: add tooltip
mutdmour Nov 12, 2024
af2da6a
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 12, 2024
a59f1c5
clean up
mutdmour Nov 12, 2024
96f5faf
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 12, 2024
893eb5c
fix: type
mutdmour Nov 12, 2024
2fde595
clean up
mutdmour Nov 12, 2024
f11fb63
fix: correct run count
mutdmour Nov 12, 2024
ba2c2f5
lint
mutdmour Nov 12, 2024
c240d9d
refactor
mutdmour Nov 12, 2024
ba0502e
refactor
mutdmour Nov 12, 2024
83abcea
refactor: remove startmetata
mutdmour Nov 12, 2024
020d860
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 12, 2024
8d5ec7d
test: add tests
mutdmour Nov 12, 2024
9e70cb1
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 12, 2024
f746da0
address design feedback
mutdmour Nov 12, 2024
938db40
fix: reduce redundancy, fix bug in items count
mutdmour Nov 12, 2024
9a376b5
type fix
mutdmour Nov 12, 2024
e661444
font size
mutdmour Nov 13, 2024
17a14d8
refactor/add tests
mutdmour Nov 13, 2024
e6b2daa
type
mutdmour Nov 13, 2024
63e74f5
add debug button to empty items
mutdmour Nov 13, 2024
edcb74a
merge in master
mutdmour Nov 13, 2024
5f491fb
add unit test
mutdmour Nov 13, 2024
40fd8b3
add e2e tests
mutdmour Nov 14, 2024
289140b
Merge branch 'master' of github.com:n8n-io/n8n into ado-2808-1
mutdmour Nov 14, 2024
47e80f7
fix flaky tests
mutdmour Nov 14, 2024
8e2a562
add unit tests
mutdmour Nov 14, 2024
c124bb9
add unit tests
mutdmour Nov 14, 2024
4952326
merge master
mutdmour Nov 14, 2024
553246a
fix unrelated flaky tests
mutdmour Nov 14, 2024
e068bd2
fix: test
mutdmour Nov 14, 2024
eec4d81
fix: test
mutdmour Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions cypress/composables/executions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Getters
*/

export const getExecutionsSidebar = () => cy.getByTestId('executions-sidebar');

export const getWorkflowExecutionPreviewIframe = () => cy.getByTestId('workflow-preview-iframe');

export const getExecutionPreviewBody = () =>
getWorkflowExecutionPreviewIframe()
.its('0.contentDocument.body')
.then((el) => cy.wrap(el));

export const getExecutionPreviewBodyNodes = () =>
getExecutionPreviewBody().findChildByTestId('canvas-node');

export const getExecutionPreviewBodyNodesByName = (name: string) =>
getExecutionPreviewBody().findChildByTestId('canvas-node').filter(`[data-name="${name}"]`).eq(0);

export function getExecutionPreviewOutputPanelRelatedExecutionLink() {
return getExecutionPreviewBody().findChildByTestId('related-execution-link');
}

/**
* Actions
*/

export const openExecutionPreviewNode = (name: string) =>
getExecutionPreviewBodyNodesByName(name).dblclick();
33 changes: 33 additions & 0 deletions cypress/composables/ndv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,38 @@ export function getOutputTableRow(row: number) {
return getOutputTableRows().eq(row);
}

export function getOutputTableHeaders() {
return getOutputPanelDataContainer().find('table thead th');
}

export function getOutputTableHeaderByText(text: string) {
return getOutputTableHeaders().contains(text);
}

export function getOutputTbodyCell(row: number, col: number) {
return getOutputTableRows().eq(row).find('td').eq(col);
}

export function getOutputRunSelector() {
return getOutputPanel().findChildByTestId('run-selector');
}

export function getOutputRunSelectorInput() {
return getOutputRunSelector().find('input');
}

export function getOutputPanelTable() {
return getOutputPanelDataContainer().get('table');
}

export function getOutputPanelItemsCount() {
return getOutputPanel().getByTestId('ndv-items-count');
}

export function getOutputPanelRelatedExecutionLink() {
return getOutputPanel().getByTestId('related-execution-link');
}

/**
* Actions
*/
Expand Down Expand Up @@ -90,3 +118,8 @@ export function setParameterSelectByContent(name: string, content: string) {
getParameterInputByName(name).realClick();
getVisibleSelect().find('.option-headline').contains(content).click();
}

export function changeOutputRunSelector(runName: string) {
getOutputRunSelector().click();
getVisibleSelect().find('.el-select-dropdown__item').contains(runName).click();
}
24 changes: 24 additions & 0 deletions cypress/composables/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ export function getCanvasNodes() {
);
}

export function getSaveButton() {
return cy.getByTestId('workflow-save-button');
}

export function getZoomToFitButton() {
return cy.getByTestId('zoom-to-fit');
}

/**
* Actions
*/
Expand Down Expand Up @@ -170,3 +178,19 @@ export function clickManualChatButton() {
export function openNode(nodeName: string) {
getNodeByName(nodeName).dblclick();
}

export function saveWorkflowOnButtonClick() {
cy.intercept('POST', '/rest/workflows').as('createWorkflow');
getSaveButton().should('contain', 'Save');
getSaveButton().click();
getSaveButton().should('contain', 'Saved');
cy.url().should('not.have.string', '/new');
}

export function pasteWorkflow(workflow: object) {
cy.get('body').paste(JSON.stringify(workflow));
}

export function clickZoomToFit() {
getZoomToFitButton().click();
}
70 changes: 41 additions & 29 deletions cypress/e2e/24-ndv-paired-item.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,31 @@ describe('NDV', () => {

ndv.getters.inputTableRow(1).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.inputTableRow(1).realHover();
ndv.actions.dragMainPanelToRight();
ndv.getters.inputTableRow(1).realMouseMove(10, 10);
ndv.getters.outputTableRow(4).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.inputTableRow(2).realHover();
ndv.getters.inputTableRow(2).realMouseMove(10, 10);
ndv.getters.outputTableRow(2).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.inputTableRow(3).realHover();
ndv.getters.inputTableRow(3).realMouseMove(10, 10);
ndv.getters.outputTableRow(6).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

// output to input
ndv.getters.outputTableRow(1).realHover();
ndv.actions.dragMainPanelToLeft();
ndv.getters.outputTableRow(1).realMouseMove(10, 10);
ndv.getters.inputTableRow(4).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.outputTableRow(4).realHover();
ndv.getters.outputTableRow(4).realMouseMove(10, 10);
ndv.getters.inputTableRow(1).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.outputTableRow(2).realHover();
ndv.getters.outputTableRow(2).realMouseMove(10, 10);
ndv.getters.inputTableRow(2).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.outputTableRow(6).realHover();
ndv.getters.outputTableRow(6).realMouseMove(10, 10);
ndv.getters.inputTableRow(3).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.outputTableRow(1).realHover();
ndv.getters.outputTableRow(1).realMouseMove(10, 10);
ndv.getters.inputTableRow(4).invoke('attr', 'data-test-id').should('equal', 'hovering-item');
});

Expand All @@ -75,31 +77,31 @@ describe('NDV', () => {
ndv.actions.switchInputMode('Table');
ndv.actions.switchOutputMode('Table');

ndv.getters.backToCanvas().realHover(); // reset to default hover
ndv.getters.backToCanvas().realMouseMove(10, 10); // reset to default hover
ndv.getters.outputHoveringItem().should('not.exist');
ndv.getters.parameterExpressionPreview('value').should('include.text', '1111');

ndv.actions.selectInputNode('Set1');
ndv.getters.backToCanvas().realHover(); // reset to default hover
ndv.getters.backToCanvas().realMouseMove(10, 10); // reset to default hover

ndv.getters.inputTableRow(1).should('have.text', '1000');

ndv.getters.inputTableRow(1).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.inputTableRow(1).realHover();
cy.wait(50);
ndv.actions.dragMainPanelToRight();
ndv.getters.inputTbodyCell(1, 0).realMouseMove(10, 10);
ndv.getters.outputHoveringItem().should('have.text', '1000');
ndv.getters.parameterExpressionPreview('value').should('include.text', '1000');

ndv.actions.selectInputNode('Sort');
ndv.actions.dragMainPanelToLeft();
ndv.actions.changeOutputRunSelector('1 of 2 (6 items)');
ndv.getters.backToCanvas().realHover(); // reset to default hover
ndv.getters.backToCanvas().realMouseMove(10, 10); // reset to default hover

ndv.getters.inputTableRow(1).should('have.text', '1111');

ndv.getters.inputTableRow(1).invoke('attr', 'data-test-id').should('equal', 'hovering-item');
ndv.getters.inputTableRow(1).realHover();
cy.wait(50);
ndv.getters.inputTbodyCell(1, 0).realMouseMove(10, 10);
ndv.getters.outputHoveringItem().should('have.text', '1111');
ndv.getters.parameterExpressionPreview('value').should('include.text', '1111');
});
Expand Down Expand Up @@ -132,20 +134,22 @@ describe('NDV', () => {

ndv.getters.inputTableRow(1).should('have.text', '1111');
ndv.getters.inputTableRow(1).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.actions.dragMainPanelToLeft();
ndv.getters.outputTableRow(1).should('have.text', '1111');
ndv.getters.outputTableRow(1).realHover();
ndv.getters.outputTableRow(1).realMouseMove(10, 10);

ndv.getters.outputTableRow(3).should('have.text', '4444');
ndv.getters.outputTableRow(3).realHover();
ndv.getters.outputTableRow(3).realMouseMove(10, 10);

ndv.getters.inputTableRow(3).should('have.text', '4444');
ndv.getters.inputTableRow(3).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.actions.changeOutputRunSelector('2 of 2 (6 items)');
cy.wait(50);

ndv.getters.inputTableRow(1).should('have.text', '1000');
ndv.getters.inputTableRow(1).realHover();
ndv.actions.dragMainPanelToRight();
ndv.getters.inputTableRow(1).realMouseMove(10, 10);

ndv.getters.outputTableRow(1).should('have.text', '1000');
ndv.getters
Expand All @@ -155,7 +159,8 @@ describe('NDV', () => {
.should('equal', 'hovering-item');

ndv.getters.outputTableRow(3).should('have.text', '2000');
ndv.getters.outputTableRow(3).realHover();
ndv.actions.dragMainPanelToLeft();
ndv.getters.outputTableRow(3).realMouseMove(10, 10);

ndv.getters.inputTableRow(3).should('have.text', '2000');

Expand All @@ -175,14 +180,15 @@ describe('NDV', () => {

ndv.actions.switchOutputBranch('False Branch (2 items)');
ndv.getters.outputTableRow(1).should('have.text', '8888');
ndv.getters.outputTableRow(1).realHover();
ndv.actions.dragMainPanelToLeft();
ndv.getters.outputTableRow(1).realMouseMove(10, 10);

ndv.getters.inputTableRow(5).should('have.text', '8888');

ndv.getters.inputTableRow(5).invoke('attr', 'data-test-id').should('equal', 'hovering-item');

ndv.getters.outputTableRow(2).should('have.text', '9999');
ndv.getters.outputTableRow(2).realHover();
ndv.getters.outputTableRow(2).realMouseMove(10, 10);

ndv.getters.inputTableRow(6).should('have.text', '9999');

Expand All @@ -192,29 +198,35 @@ describe('NDV', () => {

workflowPage.actions.openNode('Set5');

ndv.actions.dragMainPanelToRight();
ndv.actions.switchInputBranch('True Branch');

ndv.actions.dragMainPanelToLeft();
ndv.actions.changeOutputRunSelector('1 of 2 (2 items)');
ndv.getters.outputTableRow(1).should('have.text', '8888');
ndv.getters.outputTableRow(1).realHover();
cy.wait(100);
ndv.getters.outputTableRow(1).realMouseMove(10, 10);
ndv.getters.inputHoveringItem().should('not.exist');

ndv.getters.inputTableRow(1).should('have.text', '1111');
ndv.getters.inputTableRow(1).realHover();
cy.wait(100);

ndv.actions.dragMainPanelToRight();
ndv.getters.inputTableRow(1).realMouseMove(10, 10);
ndv.getters.outputHoveringItem().should('not.exist');

ndv.actions.switchInputBranch('False Branch');
ndv.getters.inputTableRow(1).should('have.text', '8888');
ndv.getters.inputTableRow(1).realHover();
ndv.actions.dragMainPanelToRight();
ndv.getters.inputTableRow(1).realMouseMove(10, 10);

ndv.actions.dragMainPanelToLeft();
ndv.actions.changeOutputRunSelector('2 of 2 (4 items)');
ndv.getters.outputTableRow(1).should('have.text', '1111');
ndv.getters.outputTableRow(1).realHover();
ndv.getters.outputTableRow(1).realMouseMove(10, 10);

ndv.actions.changeOutputRunSelector('1 of 2 (2 items)');
ndv.getters.inputTableRow(1).should('have.text', '8888');
ndv.getters.inputTableRow(1).realHover();
ndv.actions.dragMainPanelToRight();
ndv.getters.inputTableRow(1).realMouseMove(10, 10);
ndv.getters.outputHoveringItem().should('have.text', '8888');
// todo there's a bug here need to fix ADO-534
// ndv.getters.outputHoveringItem().should('not.exist');
Expand Down
Loading
Loading