From b9f312cfb8871f29c3cb0d1cdda871f784039729 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 27 Nov 2024 17:16:52 -0300 Subject: [PATCH] Refactor: update chatInputOutput.spec.ts to improve test reliability and performance (#4853) Refactor chatInputOutput.spec.ts to improve test reliability and performance --- src/frontend/tests/core/unit/chatInputOutput.spec.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/frontend/tests/core/unit/chatInputOutput.spec.ts b/src/frontend/tests/core/unit/chatInputOutput.spec.ts index 5748c384f..e40a00283 100644 --- a/src/frontend/tests/core/unit/chatInputOutput.spec.ts +++ b/src/frontend/tests/core/unit/chatInputOutput.spec.ts @@ -23,7 +23,9 @@ test("chat_io_teste", { tag: ["@release", "@workspace"] }, async ({ page }) => { while (modalCount === 0) { await page.getByText("New Flow", { exact: true }).click(); - await page.waitForTimeout(3000); + await page.waitForSelector('[data-testid="modal-title"]', { + timeout: 3000, + }); modalCount = await page.getByTestId("modal-title")?.count(); } @@ -37,7 +39,9 @@ test("chat_io_teste", { tag: ["@release", "@workspace"] }, async ({ page }) => { }); await page.getByTestId("sidebar-search-input").click(); await page.getByTestId("sidebar-search-input").fill("chat output"); - await page.waitForTimeout(1000); + await page.waitForSelector('[data-testid="outputsChat Output"]', { + timeout: 2000, + }); await page .getByTestId("outputsChat Output") @@ -47,7 +51,9 @@ test("chat_io_teste", { tag: ["@release", "@workspace"] }, async ({ page }) => { await page.getByTestId("sidebar-search-input").click(); await page.getByTestId("sidebar-search-input").fill("chat input"); - await page.waitForTimeout(1000); + await page.waitForSelector('[data-testid="inputsChat Input"]', { + timeout: 2000, + }); await page .getByTestId("inputsChat Input")