mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
test: Refactor page objects and reuse locators (#19191)
This commit is contained in:
@@ -25,38 +25,42 @@ test.describe('Logs', () => {
|
||||
await setupRequirements({ workflow: 'Workflow_loop.json' });
|
||||
|
||||
await n8n.canvas.clickZoomToFitButton();
|
||||
await n8n.logs.openLogsPanel();
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(0);
|
||||
await n8n.canvas.logsPanel.open();
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(0);
|
||||
|
||||
await n8n.canvas.clickExecuteWorkflowButton();
|
||||
await expect(n8n.logs.getOverviewStatus().filter({ hasText: 'Running' })).toBeVisible();
|
||||
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(4);
|
||||
await expect(n8n.logs.getLogEntries().nth(0)).toContainText(NODES.MANUAL_TRIGGER);
|
||||
await expect(n8n.logs.getLogEntries().nth(1)).toContainText(NODES.CODE);
|
||||
await expect(n8n.logs.getLogEntries().nth(2)).toContainText(NODES.LOOP_OVER_ITEMS);
|
||||
await expect(n8n.logs.getLogEntries().nth(3)).toContainText(NODES.WAIT);
|
||||
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(6);
|
||||
await expect(n8n.logs.getLogEntries().nth(4)).toContainText(NODES.LOOP_OVER_ITEMS);
|
||||
await expect(n8n.logs.getLogEntries().nth(5)).toContainText(NODES.WAIT);
|
||||
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(8);
|
||||
await expect(n8n.logs.getLogEntries().nth(6)).toContainText(NODES.LOOP_OVER_ITEMS);
|
||||
await expect(n8n.logs.getLogEntries().nth(7)).toContainText(NODES.WAIT);
|
||||
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(10);
|
||||
await expect(n8n.logs.getLogEntries().nth(8)).toContainText(NODES.LOOP_OVER_ITEMS);
|
||||
await expect(n8n.logs.getLogEntries().nth(9)).toContainText(NODES.CODE1);
|
||||
await expect(
|
||||
n8n.logs.getOverviewStatus().filter({ hasText: /Error in [\d.]+s/ }),
|
||||
n8n.canvas.logsPanel.getOverviewStatus().filter({ hasText: 'Running' }),
|
||||
).toBeVisible();
|
||||
await expect(n8n.logs.getSelectedLogEntry()).toContainText(NODES.CODE1); // Errored node is automatically selected
|
||||
await expect(n8n.logs.getNodeErrorMessageHeader()).toContainText('test!!! [line 1]');
|
||||
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(4);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(0)).toContainText(NODES.MANUAL_TRIGGER);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(1)).toContainText(NODES.CODE);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(2)).toContainText(NODES.LOOP_OVER_ITEMS);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(3)).toContainText(NODES.WAIT);
|
||||
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(6);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(4)).toContainText(NODES.LOOP_OVER_ITEMS);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(5)).toContainText(NODES.WAIT);
|
||||
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(8);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(6)).toContainText(NODES.LOOP_OVER_ITEMS);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(7)).toContainText(NODES.WAIT);
|
||||
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(10);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(8)).toContainText(NODES.LOOP_OVER_ITEMS);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(9)).toContainText(NODES.CODE1);
|
||||
await expect(
|
||||
n8n.canvas.logsPanel.getOverviewStatus().filter({ hasText: /Error in [\d.]+s/ }),
|
||||
).toBeVisible();
|
||||
await expect(n8n.canvas.logsPanel.getSelectedLogEntry()).toContainText(NODES.CODE1); // Errored node is automatically selected
|
||||
await expect(n8n.canvas.logsPanel.outputPanel.getNodeErrorMessageHeader()).toContainText(
|
||||
'test!!! [line 1]',
|
||||
);
|
||||
await expect(n8n.canvas.getNodeIssuesByName(NODES.CODE1)).toBeVisible();
|
||||
|
||||
await n8n.logs.getClearExecutionButton().click();
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(0);
|
||||
await n8n.canvas.logsPanel.getClearExecutionButton().click();
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(0);
|
||||
await expect(n8n.canvas.getNodeIssuesByName(NODES.CODE1)).not.toBeVisible();
|
||||
});
|
||||
|
||||
@@ -64,22 +68,22 @@ test.describe('Logs', () => {
|
||||
await setupRequirements({ workflow: 'Workflow_if.json' });
|
||||
|
||||
await n8n.canvas.clickZoomToFitButton();
|
||||
await n8n.logs.openLogsPanel();
|
||||
await n8n.canvas.logsPanel.open();
|
||||
|
||||
await n8n.workflowComposer.executeWorkflowAndWaitForNotification('Successful');
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(6);
|
||||
await expect(n8n.logs.getLogEntries().nth(0)).toContainText(NODES.SCHEDULE_TRIGGER);
|
||||
await expect(n8n.logs.getLogEntries().nth(1)).toContainText(NODES.CODE);
|
||||
await expect(n8n.logs.getLogEntries().nth(2)).toContainText(NODES.EDIT_FIELDS);
|
||||
await expect(n8n.logs.getLogEntries().nth(3)).toContainText(NODES.IF);
|
||||
await expect(n8n.logs.getLogEntries().nth(4)).toContainText(NODES.EDIT_FIELDS);
|
||||
await expect(n8n.logs.getLogEntries().nth(5)).toContainText(NODES.EDIT_FIELDS);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(6);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(0)).toContainText(NODES.SCHEDULE_TRIGGER);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(1)).toContainText(NODES.CODE);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(2)).toContainText(NODES.EDIT_FIELDS);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(3)).toContainText(NODES.IF);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(4)).toContainText(NODES.EDIT_FIELDS);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(5)).toContainText(NODES.EDIT_FIELDS);
|
||||
|
||||
await n8n.logs.clickTriggerPartialExecutionAtRow(3);
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(3);
|
||||
await expect(n8n.logs.getLogEntries().nth(0)).toContainText(NODES.SCHEDULE_TRIGGER);
|
||||
await expect(n8n.logs.getLogEntries().nth(1)).toContainText(NODES.CODE);
|
||||
await expect(n8n.logs.getLogEntries().nth(2)).toContainText(NODES.IF);
|
||||
await n8n.canvas.logsPanel.clickTriggerPartialExecutionAtRow(3);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(3);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(0)).toContainText(NODES.SCHEDULE_TRIGGER);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(1)).toContainText(NODES.CODE);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(2)).toContainText(NODES.IF);
|
||||
});
|
||||
|
||||
// TODO: make it possible to test workflows with AI model end-to-end
|
||||
@@ -90,37 +94,45 @@ test.describe('Logs', () => {
|
||||
await setupRequirements({ workflow: 'Workflow_ai_agent.json' });
|
||||
|
||||
await n8n.canvas.clickZoomToFitButton();
|
||||
await n8n.logs.openLogsPanel();
|
||||
await n8n.canvas.sendManualChatMessage('Hi!');
|
||||
await n8n.canvas.logsPanel.open();
|
||||
await n8n.canvas.logsPanel.sendManualChatMessage('Hi!');
|
||||
await n8n.workflowComposer.executeWorkflowAndWaitForNotification('Successful');
|
||||
await expect(n8n.canvas.getManualChatMessages().nth(0)).toContainText('Hi!');
|
||||
await expect(n8n.canvas.getManualChatMessages().nth(1)).toContainText(
|
||||
await expect(n8n.canvas.logsPanel.getManualChatMessages().nth(0)).toContainText('Hi!');
|
||||
await expect(n8n.canvas.logsPanel.getManualChatMessages().nth(1)).toContainText(
|
||||
'Hello from e2e model!!!',
|
||||
);
|
||||
await expect(n8n.logs.getLogEntries().nth(2)).toHaveText('E2E Chat Model');
|
||||
await n8n.logs.getLogEntries().nth(2).click();
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(2)).toHaveText('E2E Chat Model');
|
||||
await n8n.canvas.logsPanel.getLogEntries().nth(2).click();
|
||||
|
||||
await expect(n8n.logs.getOutputPanel()).toContainText('Hello from e2e model!!!');
|
||||
await n8n.logs.setOutputDisplayMode('table');
|
||||
await expect(n8n.logs.getOutputTbodyCell(0, 0)).toContainText(
|
||||
await expect(n8n.canvas.logsPanel.outputPanel.get()).toContainText('Hello from e2e model!!!');
|
||||
await n8n.canvas.logsPanel.outputPanel.switchDisplayMode('table');
|
||||
await expect(n8n.canvas.logsPanel.outputPanel.getTbodyCell(0, 0)).toContainText(
|
||||
'text:Hello from **e2e** model!!!',
|
||||
);
|
||||
await expect(n8n.logs.getOutputTbodyCell(0, 1)).toContainText('completionTokens:20');
|
||||
await n8n.logs.setOutputDisplayMode('schema');
|
||||
await expect(n8n.logs.getOutputPanel()).toContainText('generations[0]');
|
||||
await expect(n8n.logs.getOutputPanel()).toContainText('Hello from **e2e** model!!!');
|
||||
await n8n.logs.setOutputDisplayMode('json');
|
||||
await expect(n8n.logs.getOutputPanel()).toContainText('[{"response": {"generations": [');
|
||||
await expect(n8n.canvas.logsPanel.outputPanel.getTbodyCell(0, 1)).toContainText(
|
||||
'completionTokens:20',
|
||||
);
|
||||
await n8n.canvas.logsPanel.outputPanel.switchDisplayMode('schema');
|
||||
await expect(n8n.canvas.logsPanel.outputPanel.get()).toContainText('generations[0]');
|
||||
await expect(n8n.canvas.logsPanel.outputPanel.get()).toContainText(
|
||||
'Hello from **e2e** model!!!',
|
||||
);
|
||||
await n8n.canvas.logsPanel.outputPanel.switchDisplayMode('json');
|
||||
await expect(n8n.canvas.logsPanel.outputPanel.get()).toContainText(
|
||||
'[{"response": {"generations": [',
|
||||
);
|
||||
|
||||
await n8n.logs.toggleInputPanel();
|
||||
await expect(n8n.logs.getInputPanel()).toContainText('Human: Hi!');
|
||||
await n8n.logs.setInputDisplayMode('table');
|
||||
await expect(n8n.logs.getInputTbodyCell(0, 0)).toContainText('0:Human: Hi!');
|
||||
await n8n.logs.setInputDisplayMode('schema');
|
||||
await expect(n8n.logs.getInputPanel()).toContainText('messages[0]');
|
||||
await expect(n8n.logs.getInputPanel()).toContainText('Human: Hi!');
|
||||
await n8n.logs.setInputDisplayMode('json');
|
||||
await expect(n8n.logs.getInputPanel()).toContainText('[{"messages": ["Human: Hi!"],');
|
||||
await n8n.canvas.logsPanel.toggleInputPanel();
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.get()).toContainText('Human: Hi!');
|
||||
await n8n.canvas.logsPanel.inputPanel.switchDisplayMode('table');
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTbodyCell(0, 0)).toContainText('0:Human: Hi!');
|
||||
await n8n.canvas.logsPanel.inputPanel.switchDisplayMode('schema');
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.get()).toContainText('messages[0]');
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.get()).toContainText('Human: Hi!');
|
||||
await n8n.canvas.logsPanel.inputPanel.switchDisplayMode('json');
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.get()).toContainText(
|
||||
'[{"messages": ["Human: Hi!"],',
|
||||
);
|
||||
});
|
||||
|
||||
test('should show input and output data of correct run index and branch', async ({
|
||||
@@ -130,48 +142,49 @@ test.describe('Logs', () => {
|
||||
await setupRequirements({ workflow: 'Workflow_if.json' });
|
||||
|
||||
await n8n.canvas.clickZoomToFitButton();
|
||||
await n8n.logs.openLogsPanel();
|
||||
await n8n.canvas.logsPanel.open();
|
||||
await n8n.canvas.clickExecuteWorkflowButton();
|
||||
|
||||
await n8n.logs.clickLogEntryAtRow(2); // Run #1 of 'Edit Fields' node; input is 'Code' node
|
||||
await n8n.logs.toggleInputPanel();
|
||||
await n8n.logs.setInputDisplayMode('table');
|
||||
await expect(n8n.logs.getInputTableRows()).toHaveCount(11);
|
||||
await expect(n8n.logs.getInputTbodyCell(0, 0)).toContainText('0');
|
||||
await expect(n8n.logs.getInputTbodyCell(9, 0)).toContainText('9');
|
||||
await n8n.logs.clickOpenNdvAtRow(2);
|
||||
await n8n.ndv.switchInputMode('Table');
|
||||
await n8n.canvas.logsPanel.clickLogEntryAtRow(2); // Run #1 of 'Edit Fields' node; input is 'Code' node
|
||||
await n8n.canvas.logsPanel.toggleInputPanel();
|
||||
await n8n.canvas.logsPanel.inputPanel.get().hover();
|
||||
await n8n.canvas.logsPanel.inputPanel.switchDisplayMode('table');
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTableRows()).toHaveCount(11);
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTbodyCell(0, 0)).toContainText('0');
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTbodyCell(9, 0)).toContainText('9');
|
||||
await n8n.canvas.logsPanel.clickOpenNdvAtRow(2);
|
||||
await n8n.ndv.inputPanel.switchDisplayMode('table');
|
||||
await expect(n8n.ndv.getInputSelect()).toHaveValue(`${NODES.CODE} `);
|
||||
await expect(n8n.ndv.getInputTableRows()).toHaveCount(11);
|
||||
await expect(n8n.ndv.getInputTbodyCell(0, 0)).toContainText('0');
|
||||
await expect(n8n.ndv.getInputTbodyCell(9, 0)).toContainText('9');
|
||||
await expect(n8n.ndv.getOutputRunSelectorInput()).toHaveValue('1 of 3 (10 items)');
|
||||
await expect(n8n.ndv.inputPanel.getTableRows()).toHaveCount(11);
|
||||
await expect(n8n.ndv.inputPanel.getTbodyCell(0, 0)).toContainText('0');
|
||||
await expect(n8n.ndv.inputPanel.getTbodyCell(9, 0)).toContainText('9');
|
||||
await expect(n8n.ndv.outputPanel.getRunSelectorInput()).toHaveValue('1 of 3 (10 items)');
|
||||
|
||||
await n8n.ndv.clickBackToCanvasButton();
|
||||
|
||||
await n8n.logs.clickLogEntryAtRow(4); // Run #2 of 'Edit Fields' node; input is false branch of 'If' node
|
||||
await expect(n8n.logs.getInputTableRows()).toHaveCount(6);
|
||||
await expect(n8n.logs.getInputTbodyCell(0, 0)).toContainText('5');
|
||||
await expect(n8n.logs.getInputTbodyCell(4, 0)).toContainText('9');
|
||||
await n8n.logs.clickOpenNdvAtRow(4);
|
||||
await n8n.canvas.logsPanel.clickLogEntryAtRow(4); // Run #2 of 'Edit Fields' node; input is false branch of 'If' node
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTableRows()).toHaveCount(6);
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTbodyCell(0, 0)).toContainText('5');
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTbodyCell(4, 0)).toContainText('9');
|
||||
await n8n.canvas.logsPanel.clickOpenNdvAtRow(4);
|
||||
await expect(n8n.ndv.getInputSelect()).toHaveValue(`${NODES.IF} `);
|
||||
await expect(n8n.ndv.getInputTableRows()).toHaveCount(6);
|
||||
await expect(n8n.ndv.getInputTbodyCell(0, 0)).toContainText('5');
|
||||
await expect(n8n.ndv.getInputTbodyCell(4, 0)).toContainText('9');
|
||||
await expect(n8n.ndv.getOutputRunSelectorInput()).toHaveValue('2 of 3 (5 items)');
|
||||
await expect(n8n.ndv.inputPanel.getTableRows()).toHaveCount(6);
|
||||
await expect(n8n.ndv.inputPanel.getTbodyCell(0, 0)).toContainText('5');
|
||||
await expect(n8n.ndv.inputPanel.getTbodyCell(4, 0)).toContainText('9');
|
||||
await expect(n8n.ndv.outputPanel.getRunSelectorInput()).toHaveValue('2 of 3 (5 items)');
|
||||
|
||||
await n8n.ndv.clickBackToCanvasButton();
|
||||
|
||||
await n8n.logs.clickLogEntryAtRow(5); // Run #3 of 'Edit Fields' node; input is true branch of 'If' node
|
||||
await expect(n8n.logs.getInputTableRows()).toHaveCount(6);
|
||||
await expect(n8n.logs.getInputTbodyCell(0, 0)).toContainText('0');
|
||||
await expect(n8n.logs.getInputTbodyCell(4, 0)).toContainText('4');
|
||||
await n8n.logs.clickOpenNdvAtRow(5);
|
||||
await n8n.canvas.logsPanel.clickLogEntryAtRow(5); // Run #3 of 'Edit Fields' node; input is true branch of 'If' node
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTableRows()).toHaveCount(6);
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTbodyCell(0, 0)).toContainText('0');
|
||||
await expect(n8n.canvas.logsPanel.inputPanel.getTbodyCell(4, 0)).toContainText('4');
|
||||
await n8n.canvas.logsPanel.clickOpenNdvAtRow(5);
|
||||
await expect(n8n.ndv.getInputSelect()).toHaveValue(`${NODES.IF} `);
|
||||
await expect(n8n.ndv.getInputTableRows()).toHaveCount(6);
|
||||
await expect(n8n.ndv.getInputTbodyCell(0, 0)).toContainText('0');
|
||||
await expect(n8n.ndv.getInputTbodyCell(4, 0)).toContainText('4');
|
||||
await expect(n8n.ndv.getOutputRunSelectorInput()).toHaveValue('3 of 3 (5 items)');
|
||||
await expect(n8n.ndv.inputPanel.getTableRows()).toHaveCount(6);
|
||||
await expect(n8n.ndv.inputPanel.getTbodyCell(0, 0)).toContainText('0');
|
||||
await expect(n8n.ndv.inputPanel.getTbodyCell(4, 0)).toContainText('4');
|
||||
await expect(n8n.ndv.outputPanel.getRunSelectorInput()).toHaveValue('3 of 3 (5 items)');
|
||||
});
|
||||
|
||||
test('should keep populated logs unchanged when workflow get edits after the execution', async ({
|
||||
@@ -181,14 +194,14 @@ test.describe('Logs', () => {
|
||||
await setupRequirements({ workflow: 'Workflow_if.json' });
|
||||
|
||||
await n8n.canvas.clickZoomToFitButton();
|
||||
await n8n.logs.openLogsPanel();
|
||||
await n8n.canvas.logsPanel.open();
|
||||
|
||||
await n8n.workflowComposer.executeWorkflowAndWaitForNotification('Successful');
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(6);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(6);
|
||||
await n8n.canvas.nodeDisableButton(NODES.EDIT_FIELDS).click();
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(6);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(6);
|
||||
await n8n.canvas.deleteNodeByName(NODES.IF);
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(6);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(6);
|
||||
});
|
||||
|
||||
// TODO: make it possible to test workflows with AI model end-to-end
|
||||
@@ -196,23 +209,25 @@ test.describe('Logs', () => {
|
||||
await setupRequirements({ workflow: 'Workflow_ai_agent.json' });
|
||||
|
||||
await n8n.canvas.clickZoomToFitButton();
|
||||
await n8n.logs.openLogsPanel();
|
||||
await n8n.canvas.logsPanel.open();
|
||||
|
||||
await n8n.canvas.sendManualChatMessage('Hi!');
|
||||
await n8n.canvas.logsPanel.sendManualChatMessage('Hi!');
|
||||
await n8n.workflowComposer.executeWorkflowAndWaitForNotification('Successful');
|
||||
await n8n.canvas.openExecutions();
|
||||
await n8n.executions.getAutoRefreshButton().click();
|
||||
await expect(n8n.executions.getManualChatMessages().nth(0)).toContainText('Hi!');
|
||||
await expect(n8n.executions.getManualChatMessages().nth(1)).toContainText(
|
||||
await expect(n8n.executions.logsPanel.getManualChatMessages().nth(0)).toContainText('Hi!');
|
||||
await expect(n8n.executions.logsPanel.getManualChatMessages().nth(1)).toContainText(
|
||||
'Hello from e2e model!!!',
|
||||
);
|
||||
await expect(
|
||||
n8n.executions.getLogsOverviewStatus().filter({ hasText: /Success in [\d.]+m?s/ }),
|
||||
n8n.executions.logsPanel.getOverviewStatus().filter({ hasText: /Success in [\d.]+m?s/ }),
|
||||
).toBeVisible();
|
||||
await expect(n8n.executions.getLogEntries()).toHaveCount(3);
|
||||
await expect(n8n.executions.getLogEntries().nth(0)).toContainText('When chat message received');
|
||||
await expect(n8n.executions.getLogEntries().nth(1)).toContainText('AI Agent');
|
||||
await expect(n8n.executions.getLogEntries().nth(2)).toContainText('E2E Chat Model');
|
||||
await expect(n8n.executions.logsPanel.getLogEntries()).toHaveCount(3);
|
||||
await expect(n8n.executions.logsPanel.getLogEntries().nth(0)).toContainText(
|
||||
'When chat message received',
|
||||
);
|
||||
await expect(n8n.executions.logsPanel.getLogEntries().nth(1)).toContainText('AI Agent');
|
||||
await expect(n8n.executions.logsPanel.getLogEntries().nth(2)).toContainText('E2E Chat Model');
|
||||
});
|
||||
|
||||
test('should show logs for a workflow with a node that waits for webhook', async ({
|
||||
@@ -223,18 +238,21 @@ test.describe('Logs', () => {
|
||||
|
||||
await n8n.canvas.canvasBody().click({ position: { x: 0, y: 0 } }); // click logs panel to deselect nodes in canvas
|
||||
await n8n.canvas.clickZoomToFitButton();
|
||||
await n8n.logs.openLogsPanel();
|
||||
await n8n.canvas.logsPanel.open();
|
||||
|
||||
await n8n.canvas.clickExecuteWorkflowButton();
|
||||
|
||||
await expect(n8n.canvas.getNodesWithSpinner()).toContainText(NODES.WAIT_NODE);
|
||||
await expect(n8n.canvas.getWaitingNodes()).toContainText(NODES.WAIT_NODE);
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(2);
|
||||
await expect(n8n.logs.getLogEntries().nth(1)).toContainText(NODES.WAIT_NODE);
|
||||
await expect(n8n.logs.getLogEntries().nth(1)).toContainText('Waiting');
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(2);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(1)).toContainText(NODES.WAIT_NODE);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(1)).toContainText('Waiting');
|
||||
|
||||
await n8n.canvas.openNode(NODES.WAIT_NODE);
|
||||
const webhookUrl = await n8n.ndv.getOutputDataContainer().locator('a').getAttribute('href');
|
||||
const webhookUrl = await n8n.ndv.outputPanel
|
||||
.getDataContainer()
|
||||
.locator('a')
|
||||
.getAttribute('href');
|
||||
await n8n.ndv.clickBackToCanvasButton();
|
||||
|
||||
// Trigger the webhook
|
||||
@@ -244,11 +262,11 @@ test.describe('Logs', () => {
|
||||
await expect(n8n.canvas.getNodesWithSpinner()).not.toBeVisible();
|
||||
await expect(n8n.canvas.getWaitingNodes()).not.toBeVisible();
|
||||
await expect(
|
||||
n8n.logs.getOverviewStatus().filter({ hasText: /Success in [\d.]+m?s/ }),
|
||||
n8n.canvas.logsPanel.getOverviewStatus().filter({ hasText: /Success in [\d.]+m?s/ }),
|
||||
).toBeVisible();
|
||||
await n8n.logs.getLogEntries().nth(1).click(); // click selected row to deselect
|
||||
await expect(n8n.logs.getLogEntries()).toHaveCount(2);
|
||||
await expect(n8n.logs.getLogEntries().nth(1)).toContainText(NODES.WAIT_NODE);
|
||||
await expect(n8n.logs.getLogEntries().nth(1)).toContainText('Success');
|
||||
await n8n.canvas.logsPanel.getLogEntries().nth(1).click(); // click selected row to deselect
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries()).toHaveCount(2);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(1)).toContainText(NODES.WAIT_NODE);
|
||||
await expect(n8n.canvas.logsPanel.getLogEntries().nth(1)).toContainText('Success');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user