From 39335a7e478e5986643d9a92a7ad47a6c8fe08df Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Sat, 7 Dec 2024 00:07:28 -0300 Subject: [PATCH] refactor: Improve flow creation and search performance in test (#5139) feat: Improve flow creation and search functionality Improve the flow creation and search functionality by adding explicit wait conditions for modals and search results. This ensures that the necessary elements are loaded before interacting with them, preventing potential errors or timeouts. Refactor the code in the 'generalBugs-shard-8.spec.ts' file to include the following changes: - Add a timeout of 3000ms for the modal title selector - Add a timeout of 3000ms for the dataAPI request selector These changes enhance the reliability and stability of the tests in the 'generalBugs-shard-8.spec.ts' file. --- .../tests/extended/regression/generalBugs-shard-8.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/tests/extended/regression/generalBugs-shard-8.spec.ts b/src/frontend/tests/extended/regression/generalBugs-shard-8.spec.ts index 79e15a21f..114ae619c 100644 --- a/src/frontend/tests/extended/regression/generalBugs-shard-8.spec.ts +++ b/src/frontend/tests/extended/regression/generalBugs-shard-8.spec.ts @@ -25,14 +25,18 @@ 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("blank-flow").click(); await page.getByTestId("sidebar-search-input").click(); await page.getByTestId("sidebar-search-input").fill("api request"); - await page.waitForTimeout(1000); + await page.waitForSelector('[data-testid="dataAPI Request"]', { + timeout: 3000, + }); await page .getByTestId("dataAPI Request")