From fa2ac6b9f0bf0961d26e404c16572cd9415ef7b6 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 6 Dec 2024 23:36:50 -0300 Subject: [PATCH] Refactor: update remove unnecessary wait timeouts in regression test (#5132) * refactor: Remove unnecessary wait timeouts in regression test --- .../regression/general-bugs-shard-3836.spec.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/frontend/tests/extended/regression/general-bugs-shard-3836.spec.ts b/src/frontend/tests/extended/regression/general-bugs-shard-3836.spec.ts index dbb017926..a4198b3f8 100644 --- a/src/frontend/tests/extended/regression/general-bugs-shard-3836.spec.ts +++ b/src/frontend/tests/extended/regression/general-bugs-shard-3836.spec.ts @@ -17,8 +17,6 @@ test( await page.goto("/"); - await page.waitForTimeout(1000); - let modalCount = 0; try { const modalTitleElement = await page?.getByTestId("modal-title"); @@ -31,7 +29,9 @@ test( 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(); } @@ -52,14 +52,12 @@ test( while (outdatedComponents > 0) { await page.getByTestId("icon-AlertTriangle").first().click(); - await page.waitForTimeout(1000); outdatedComponents = await page.getByTestId("icon-AlertTriangle").count(); } let filledApiKey = await page.getByTestId("remove-icon-badge").count(); while (filledApiKey > 0) { await page.getByTestId("remove-icon-badge").first().click(); - await page.waitForTimeout(1000); filledApiKey = await page.getByTestId("remove-icon-badge").count(); } @@ -81,8 +79,6 @@ test( await page.getByTestId("showfiles").click(); await page.getByText("Close").last().click(); - await page.waitForTimeout(500); - const userQuestion = "What is this image?"; await page.getByTestId("textarea_str_input_value").fill(userQuestion); @@ -106,8 +102,6 @@ test( await page.getByText("Playground", { exact: true }).last().click(); - await page.waitForTimeout(500); - await page.waitForSelector('[data-testid="button-send"]', { timeout: 100000, });