From 32cc456c18cf806bfb9e3085d2b559d7c0c3fcdc Mon Sep 17 00:00:00 2001 From: Holger Benl Date: Thu, 16 May 2024 13:23:57 +0200 Subject: [PATCH] Fix the retry logic in the editLogPoint test helper (#10533) --- packages/e2e-tests/helpers/source-panel.ts | 33 ++++++++++------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/packages/e2e-tests/helpers/source-panel.ts b/packages/e2e-tests/helpers/source-panel.ts index 609e595519d..d9e5b8aed52 100644 --- a/packages/e2e-tests/helpers/source-panel.ts +++ b/packages/e2e-tests/helpers/source-panel.ts @@ -337,24 +337,21 @@ export async function editLogPoint( // The typeahead popup sometimes sticks around and overlaps the save button. // Sometimes, it will show up after we check the first time (PRO-238) so we // retry a couple times to ensure that we can clear it and move forward. - await waitFor( - async () => { - await hideTypeAheadSuggestions(page, { - sourceLineNumber: lineNumber, - type: "log-point-condition", - }); - await hideTypeAheadSuggestions(page, { - sourceLineNumber: lineNumber, - type: "log-point-content", - }); - - const saveButton = line.locator('[data-test-name="PointPanel-SaveButton"]'); - await expect(saveButton).toBeEnabled(); - await saveButton.click(); - await saveButton.waitFor({ state: "detached" }); - }, - { timeout: 2_000 } - ); + await waitFor(async () => { + await hideTypeAheadSuggestions(page, { + sourceLineNumber: lineNumber, + type: "log-point-condition", + }); + await hideTypeAheadSuggestions(page, { + sourceLineNumber: lineNumber, + type: "log-point-content", + }); + + const saveButton = line.locator('[data-test-name="PointPanel-SaveButton"]'); + await expect(saveButton).toBeEnabled(); + await saveButton.click({ timeout: 1_000 }); + await saveButton.waitFor({ state: "detached" }); + }); } }