fix(editor): Waiting executions broken - Chat, Form, Wait (no-changelog) (#15343)

This commit is contained in:
Suguru Inoue
2025-05-13 17:01:00 +02:00
committed by GitHub
parent 3176f6fc89
commit 694af6c9f0
10 changed files with 279 additions and 58 deletions

View File

@@ -120,6 +120,18 @@ export function getNodeByName(name: string) {
);
}
export function getNodesWithSpinner() {
return cy
.getByTestId('canvas-node')
.filter((_, el) => Cypress.$(el).find('[data-icon=sync-alt]').length > 0);
}
export function getWaitingNodes() {
return cy
.getByTestId('canvas-node')
.filter((_, el) => Cypress.$(el).find('[data-icon=clock]').length > 0);
}
export function getNodeRenderedTypeByName(name: string) {
return cy.ifCanvasVersion(
() => getNodeByName(name),

View File

@@ -6,6 +6,7 @@ import * as workflow from '../composables/workflow';
import Workflow_chat from '../fixtures/Workflow_ai_agent.json';
import Workflow_if from '../fixtures/Workflow_if.json';
import Workflow_loop from '../fixtures/Workflow_loop.json';
import Workflow_wait_for_webhook from '../fixtures/Workflow_wait_for_webhook.json';
describe('Logs', () => {
beforeEach(() => {
@@ -193,4 +194,42 @@ describe('Logs', () => {
executions.getLogEntries().eq(1).should('contain.text', 'AI Agent');
executions.getLogEntries().eq(2).should('contain.text', 'E2E Chat Model');
});
it('should show logs for a workflow with a node that waits for webhook', () => {
workflow.navigateToNewWorkflowPage();
workflow.pasteWorkflow(Workflow_wait_for_webhook);
workflow.clickZoomToFit();
logs.openLogsPanel();
workflow.executeWorkflow();
workflow.getNodesWithSpinner().should('contain.text', 'Wait');
workflow.getWaitingNodes().should('contain.text', 'Wait');
logs.getLogEntries().should('have.length', 2);
logs.getLogEntries().eq(0).click(); // click selected row to deselect
logs.getLogEntries().eq(1).should('contain.text', 'Wait node');
logs.getLogEntries().eq(1).should('contain.text', 'Waiting');
workflow.openNode('Wait node');
ndv
.getOutputPanelDataContainer()
.find('a')
.should('have.attr', 'href')
.then((url) => {
cy.request(url as unknown as string).then((response) => {
expect(response.status).to.eq(200);
});
});
ndv.getBackToCanvasButton().click();
workflow.getNodesWithSpinner().should('not.exist');
workflow.getWaitingNodes().should('not.exist');
logs
.getOverviewStatus()
.contains(/Success in [\d\.]+m?s/)
.should('exist');
logs.getLogEntries().should('have.length', 2);
logs.getLogEntries().eq(1).should('contain.text', 'Wait node');
logs.getLogEntries().eq(1).should('contain.text', 'Success');
});
});

View File

@@ -0,0 +1,41 @@
{
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [0, 0],
"id": "42c6e003-10e7-4100-aff8-8865c49f384c",
"name": "When clicking Test workflow"
},
{
"parameters": {
"resume": "webhook",
"options": {}
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [220, 0],
"id": "77614c15-c41e-4b8c-95d6-084d48fed328",
"name": "Wait node",
"webhookId": "62aad98c-81b3-4c44-9adb-b33a23d1271d"
}
],
"connections": {
"When clicking Test workflow": {
"main": [
[
{
"node": "Wait node",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"instanceId": "eea4a7b09aa7ee308bc067003a65466862f88be8d9309a2bb16297f6bb2616ec"
}
}