From 67cee504a07d2b572b3967ca6e3f2e38dee6e293 Mon Sep 17 00:00:00 2001 From: Veronica Gonzalez Date: Fri, 27 Dec 2024 14:17:24 +0100 Subject: [PATCH] LPD-45145 Add timeout for flaky test --- .../layout-content-page-editor-web/mapping.spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/test/playwright/tests/layout-content-page-editor-web/mapping.spec.ts b/modules/test/playwright/tests/layout-content-page-editor-web/mapping.spec.ts index b1b93b573368e6..379042344637ac 100644 --- a/modules/test/playwright/tests/layout-content-page-editor-web/mapping.spec.ts +++ b/modules/test/playwright/tests/layout-content-page-editor-web/mapping.spec.ts @@ -750,9 +750,15 @@ test( await page.goto(`/web${site.friendlyUrlPath}${layout.friendlyUrlPath}`); + // Wait a second for the page to load to get the buttons + + await page.waitForTimeout(1000); + + const buttons = page.getByText('Go Somewhere'); + // Click first button and assert error - await page.getByText('Go Somewhere').first().click(); + await buttons.first().click(); await waitForAlert( page, @@ -768,7 +774,7 @@ test( // Click second button and assert success - await page.getByText('Go Somewhere').last().click(); + await buttons.last().click(); await expect( page.getByRole('heading', {name: String(secondObjectEntry.id)})