test: Remove flaky Chat Hub conversation flow e2e test (no-changelog) (#40728)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub Kadlubiec 2026-10-09 05:36:24 +00:00 committed by GitHub
parent 3ba522910b
commit c4f84e2f78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,64 +57,5 @@ test.describe(
// generated title text, which drifts as fixtures are re-recorded.
await expect(n8n.chatHubChat.sidebar.getConversations().first()).toBeVisible();
});
test('conversation flow', async ({ n8n, anthropicCredential: _ }) => {
await n8n.navigate.toChatHub();
await n8n.chatHubChat.dismissWelcomeScreen();
await expect(n8n.chatHubChat.getModelSelectorButton()).toContainText(/claude/i); // auto-select a model
// STEP: send first prompt
await n8n.chatHubChat.getChatInput().fill('Hi');
await n8n.chatHubChat.getSendButton().click();
await expect(n8n.chatHubChat.getChatMessages().nth(0)).toHaveText('Hi'); // user-typed, assert exact
await n8n.chatHubChat.expectReplyAt(1); // assistant reply streamed in (content is non-deterministic)
// Message counts are structural (not model content), so they stay exact.
await expect(n8n.chatHubChat.getChatMessages()).toHaveCount(2);
// Capture the first assistant reply so alternatives can be compared
// structurally without hardcoding drift-prone model text.
const firstReply = await n8n.chatHubChat.getMessageContentAt(1).innerText();
// STEP: send 2nd prompt
await n8n.chatHubChat.getChatInput().fill('How are you?');
await n8n.chatHubChat.getSendButton().click();
await expect(n8n.chatHubChat.getChatMessages().nth(0)).toContainText('Hi'); // user-typed, assert exact
await n8n.chatHubChat.expectReplyAt(1);
await expect(n8n.chatHubChat.getChatMessages().nth(2)).toContainText('How are you?'); // user-typed, assert exact
await n8n.chatHubChat.expectReplyAt(3);
await expect(n8n.chatHubChat.getChatMessages()).toHaveCount(4);
// STEP: regenerate response to first prompt - the alternative must differ
await n8n.chatHubChat.clickRegenerateButtonAt(1);
await expect(n8n.chatHubChat.getChatMessages()).toHaveCount(2);
await expect
.poll(async () => await n8n.chatHubChat.getMessageContentAt(1).innerText())
.not.toBe(firstReply);
// STEP: switch to previous alternative - restores the original reply
await n8n.chatHubChat.clickPrevAlternativeButtonAt(1);
await expect(n8n.chatHubChat.getChatMessages()).toHaveCount(4);
await expect
.poll(async () => await n8n.chatHubChat.getMessageContentAt(1).innerText())
.toBe(firstReply);
// STEP: edit 2nd prompt
await n8n.chatHubChat.clickEditButtonAt(2);
await n8n.chatHubChat.getEditorAt(2).fill('Hola');
await n8n.chatHubChat.getSendButtonAt(2).click();
await expect(n8n.chatHubChat.getChatMessages().nth(2)).toContainText('Hola'); // user-typed, assert exact
await n8n.chatHubChat.expectReplyAt(3); // assistant reply streamed in (content is non-deterministic)
await expect(n8n.chatHubChat.getChatMessages()).toHaveCount(4);
// STEP: reload page and verify persistence
await n8n.page.reload();
await expect(n8n.chatHubChat.getChatMessages()).toHaveCount(4);
await expect(n8n.chatHubChat.getChatMessages().nth(0)).toContainText('Hi'); // user-typed, assert exact
await expect
.poll(async () => await n8n.chatHubChat.getMessageContentAt(1).innerText())
.toBe(firstReply); // restored alternative persisted across reload
await expect(n8n.chatHubChat.getChatMessages().nth(2)).toContainText('Hola'); // user-typed, assert exact
await n8n.chatHubChat.expectReplyAt(3);
});
},
);