From fdb2a92c1ccf66d8a293caaf442d098cab50fc9f Mon Sep 17 00:00:00 2001 From: darkskygit Date: Tue, 6 May 2025 09:59:48 +0000 Subject: [PATCH] test(core): fix chat with tag falky (#12141) ## Summary by CodeRabbit - **Tests** - Improved reliability of chat panel end-to-end tests by refining the sequence of UI interactions and wait conditions during tag and collection selection. --- .../affine-cloud-copilot/e2e/utils/chat-panel-utils.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/affine-cloud-copilot/e2e/utils/chat-panel-utils.ts b/tests/affine-cloud-copilot/e2e/utils/chat-panel-utils.ts index d6b1104f1f..7ffbd9b5df 100644 --- a/tests/affine-cloud-copilot/e2e/utils/chat-panel-utils.ts +++ b/tests/affine-cloud-copilot/e2e/utils/chat-panel-utils.ts @@ -264,8 +264,11 @@ export class ChatPanelUtils { await withMenu.getByTestId('ai-chat-with-tags').click(); await withMenu.getByText(tag).click(); await page.getByTestId('chat-panel-chips').getByText(tag); + await this.waitForEmbeddingProgress(page); + await withMenu.waitFor({ + state: 'hidden', + }); } - await this.waitForEmbeddingProgress(page); } public static async chatWithCollections(page: Page, collections: string[]) { @@ -276,8 +279,11 @@ export class ChatPanelUtils { await withMenu.getByTestId('ai-chat-with-collections').click(); await withMenu.getByText(collection).click(); await page.getByTestId('chat-panel-chips').getByText(collection); + await this.waitForEmbeddingProgress(page); + await withMenu.waitFor({ + state: 'hidden', + }); } - await this.waitForEmbeddingProgress(page); } public static async waitForEmbeddingProgress(page: Page) {