fix(editor): Keep chat session when switching to other tabs (#19483)

This commit is contained in:
Mutasem Aldmour
2025-09-15 15:31:03 +02:00
committed by GitHub
parent 5a63304014
commit 7e63e56ccd
7 changed files with 133 additions and 45 deletions

View File

@@ -207,6 +207,11 @@ export class CanvasPage extends BasePage {
async clickExecutionsTab(): Promise<void> {
await this.page.getByRole('radio', { name: 'Executions' }).click();
}
async clickEditorTab(): Promise<void> {
await this.page.getByRole('radio', { name: 'Editor' }).click();
}
async setWorkflowName(name: string): Promise<void> {
await this.clickByTestId('inline-edit-preview');
await this.fillByTestId('inline-edit-input', name);

View File

@@ -529,4 +529,24 @@ test.describe('Langchain Integration @capability:proxy', () => {
await expect(n8n.canvas.getManualChatLatestBotMessage()).toContainText('this_my_field_4');
});
});
test('should keep the same session when switching tabs', async ({ n8n }) => {
await n8n.start.fromImportedWorkflow('Test_workflow_chat_partial_execution.json');
await n8n.canvas.clickZoomToFitButton();
await n8n.canvas.logsPanel.open();
// Send a message
await n8n.canvas.logsPanel.sendManualChatMessage('Test');
await expect(n8n.canvas.getManualChatLatestBotMessage()).toContainText('this_my_field');
await n8n.canvas.clickExecutionsTab();
await n8n.canvas.clickEditorTab();
await expect(n8n.canvas.getManualChatLatestBotMessage()).toContainText('this_my_field');
// Refresh session
await n8n.page.getByTestId('refresh-session-button').click();
await expect(n8n.canvas.getManualChatMessages()).not.toBeAttached();
});
});