From ae35f19c5ed899bd4ea4c0cb47ced7687c6d202f Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Tue, 18 Feb 2025 14:31:24 +0530 Subject: [PATCH] Playwright: Fix the failing playwright tests on main (#19832) * Fix the failing playwright tests on main * Fix the GlossaryBulkImportExport test (cherry picked from commit 982b530ee5e8a099a6123c29033daef00f631648) --- .../resources/ui/playwright/e2e/Features/QueryEntity.spec.ts | 4 +++- .../main/resources/ui/playwright/e2e/Pages/TestSuite.spec.ts | 4 +++- .../src/main/resources/ui/playwright/utils/entity.ts | 2 +- .../src/main/resources/ui/playwright/utils/importUtils.ts | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/QueryEntity.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/QueryEntity.spec.ts index f2f653128712..b35180a99e1b 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/QueryEntity.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/QueryEntity.spec.ts @@ -106,7 +106,9 @@ test('Query Entity', async ({ page }) => { }); await test.step('Update owner, description and tag', async () => { - const ownerListResponse = page.waitForResponse('/api/v1/users?*'); + const ownerListResponse = page.waitForResponse( + '/api/v1/search/query?q=*isBot:false*index=user_search_index*' + ); await page .getByTestId( 'entity-summary-resizable-right-panel-container entity-resizable-panel-container' diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestSuite.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestSuite.spec.ts index 99842af0227a..1d0540775d21 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestSuite.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestSuite.spec.ts @@ -201,7 +201,9 @@ test('Logical TestSuite', async ({ page }) => { await page.waitForSelector("[data-testid='select-owner-tabs']", { state: 'visible', }); - const getOwnerList = page.waitForResponse('/api/v1/users?*isBot=false*'); + const getOwnerList = page.waitForResponse( + '/api/v1/search/query?q=*isBot:false*index=user_search_index*' + ); await page.click('.ant-tabs [id*=tab-users]'); await getOwnerList; await page.waitForSelector(`[data-testid="loader"]`, { diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts index d503fc1752b1..3ac93c5339c6 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts @@ -59,7 +59,7 @@ export const addOwner = async ({ await page.getByTestId(initiatorId).click(); if (type === 'Users') { const userListResponse = page.waitForResponse( - '/api/v1/users?limit=*&isBot=false*' + '/api/v1/search/query?q=*isBot:false*index=user_search_index*' ); await page.getByRole('tab', { name: type }).click(); await userListResponse; diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/importUtils.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/importUtils.ts index 3096c2062347..e5906f554469 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/importUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/importUtils.ts @@ -63,7 +63,7 @@ export const fillOwnerDetails = async (page: Page, owners: string[]) => { .press('Enter', { delay: 100 }); const userListResponse = page.waitForResponse( - '/api/v1/users?limit=*&isBot=false*' + '/api/v1/search/query?q=*isBot:false*index=user_search_index*' ); await page.getByRole('tab', { name: 'Users' }).click(); await userListResponse; @@ -75,7 +75,7 @@ export const fillOwnerDetails = async (page: Page, owners: string[]) => { await page.locator('[data-testid="owner-select-users-search-bar"]').clear(); await page.keyboard.type(owner); await page.waitForResponse( - `/api/v1/search/query?q=*${owner}*%20AND%20isBot:false&from=0&size=25&index=user_search_index` + `/api/v1/search/query?q=*${owner}*%20AND%20isBot:false*index=user_search_index*` ); await page.getByRole('listitem', { name: owner }).click();