mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-07 06:46:35 +00:00
test: fix Playwright test timeouts in domain and data product selection
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
adf6967c40
commit
c86fe01f59
@ -130,6 +130,10 @@ export const selectDomain = async (page: Page, domain: Domain['data']) => {
|
|||||||
.getByTestId('page-layout-v1')
|
.getByTestId('page-layout-v1')
|
||||||
.getByPlaceholder('Search');
|
.getByPlaceholder('Search');
|
||||||
|
|
||||||
|
await page.waitForSelector('[data-testid="loader"]', {
|
||||||
|
state: 'detached',
|
||||||
|
});
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
searchBox.fill(domain.name),
|
searchBox.fill(domain.name),
|
||||||
page.waitForResponse('/api/v1/search/query?q=*&index=domain_search_index*'),
|
page.waitForResponse('/api/v1/search/query?q=*&index=domain_search_index*'),
|
||||||
@ -217,6 +221,10 @@ export const selectDataProduct = async (
|
|||||||
.getByTestId('page-layout-v1')
|
.getByTestId('page-layout-v1')
|
||||||
.getByPlaceholder('Search');
|
.getByPlaceholder('Search');
|
||||||
|
|
||||||
|
await page.waitForSelector('[data-testid="loader"]', {
|
||||||
|
state: 'detached',
|
||||||
|
});
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
searchBox.fill(dataProduct.name),
|
searchBox.fill(dataProduct.name),
|
||||||
page.waitForResponse(
|
page.waitForResponse(
|
||||||
@ -229,7 +237,7 @@ export const selectDataProduct = async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.locator('td').filter({ hasText: dataProduct.displayName }).click(),
|
page.getByTestId(dataProduct.name).click({ timeout: 15000 }),
|
||||||
page.waitForResponse('/api/v1/dataProducts/name/*'),
|
page.waitForResponse('/api/v1/dataProducts/name/*'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user