From 42eccbfa0d7e7defba02ee3589535689556390bb Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 18 Jun 2025 13:28:53 -0300 Subject: [PATCH] refactor: enhance freeze.spec.ts by replacing timeout with waitForSelector for improved test reliability - Updated the test to use waitForSelector instead of a fixed timeout, enhancing the robustness of the test execution. - This change aims to ensure that the test waits for the specific element to be present before proceeding, reducing flakiness. --- src/frontend/tests/core/features/freeze.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/tests/core/features/freeze.spec.ts b/src/frontend/tests/core/features/freeze.spec.ts index de5090d33d..e6439a2b59 100644 --- a/src/frontend/tests/core/features/freeze.spec.ts +++ b/src/frontend/tests/core/features/freeze.spec.ts @@ -70,8 +70,12 @@ test( await page.keyboard.press("Escape"); await page.getByTestId("div-generic-node").getByRole("button").click(); - - await page.waitForTimeout(2000); + await page.waitForSelector( + '[data-testid="output-inspection-output text-textinput"]', + { + timeout: 2000, + }, + ); await page.getByTestId("output-inspection-output text-textinput").click();