From 9654ce74309efcce561a5eff458f649fd7c7adca Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 5 Dec 2024 22:28:16 -0300 Subject: [PATCH] improve: improve pythonGenerationCodeAPI (#5080) fix: update flow creation test to wait for modal title The code changes update the flow creation test in the pythonApiGeneration.spec.ts file. The test now waits for the modal title to appear before proceeding. This ensures that the test is more reliable and avoids any timing issues. --- .../tests/extended/features/pythonApiGeneration.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/tests/extended/features/pythonApiGeneration.spec.ts b/src/frontend/tests/extended/features/pythonApiGeneration.spec.ts index 492793b51..70c2a4d16 100644 --- a/src/frontend/tests/extended/features/pythonApiGeneration.spec.ts +++ b/src/frontend/tests/extended/features/pythonApiGeneration.spec.ts @@ -24,12 +24,13 @@ 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(); } await page.getByTestId("side_nav_options_all-templates").click(); await page.getByRole("heading", { name: "Basic Prompting" }).click(); - await page.waitForTimeout(1000); await page.getByText("API", { exact: true }).click(); await page.getByRole("tab", { name: "Python API" }).click(); await page.getByTestId("icon-Copy").click();