From c86fe01f59f578dda3efbf6f06916ba7c86c959a Mon Sep 17 00:00:00 2001 From: Satish Date: Wed, 1 Oct 2025 15:38:26 +0530 Subject: [PATCH] test: fix Playwright test timeouts in domain and data product selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Wait for initial page load before searching in selectDomain - Wait for initial page load before searching in selectDataProduct - Use data-testid selector instead of text filter in selectDataProduct - Add 15s timeout to data product click action Prevents race conditions where search interferes with initial page load, fixing "Target page, context or browser has been closed" timeout errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../src/main/resources/ui/playwright/utils/domain.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts index cbec2d4b169..25247400788 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts @@ -130,6 +130,10 @@ export const selectDomain = async (page: Page, domain: Domain['data']) => { .getByTestId('page-layout-v1') .getByPlaceholder('Search'); + await page.waitForSelector('[data-testid="loader"]', { + state: 'detached', + }); + await Promise.all([ searchBox.fill(domain.name), page.waitForResponse('/api/v1/search/query?q=*&index=domain_search_index*'), @@ -217,6 +221,10 @@ export const selectDataProduct = async ( .getByTestId('page-layout-v1') .getByPlaceholder('Search'); + await page.waitForSelector('[data-testid="loader"]', { + state: 'detached', + }); + await Promise.all([ searchBox.fill(dataProduct.name), page.waitForResponse( @@ -229,7 +237,7 @@ export const selectDataProduct = async ( }); await Promise.all([ - page.locator('td').filter({ hasText: dataProduct.displayName }).click(), + page.getByTestId(dataProduct.name).click({ timeout: 15000 }), page.waitForResponse('/api/v1/dataProducts/name/*'), ]);