From 13c4e00a51ebdc25601b69c9ca288c876643e58a Mon Sep 17 00:00:00 2001 From: Dhruv Parmar <83108871+dhruvjsx@users.noreply.github.com> Date: Mon, 19 May 2025 12:09:36 +0530 Subject: [PATCH] fixed BulkEditEntity flaky test (#21209) * fixed BulkEditEntity flaky test * fixed enter click issue * removed changes that does not belongs to me in pr * removed changes that does not belongs to me in pr * removed unwated code (cherry picked from commit c24a2dbdca9a8e9a99b0f53dc2373bdae1edb351) --- .../e2e/Features/BulkEditEntity.spec.ts | 16 +++------------- .../ui/playwright/utils/customProperty.ts | 10 ++++------ .../resources/ui/playwright/utils/importUtils.ts | 10 +++++----- .../main/resources/ui/src/utils/RouterUtils.ts | 1 + 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/BulkEditEntity.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/BulkEditEntity.spec.ts index 1ffc60342bd..e2e24974c90 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/BulkEditEntity.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/BulkEditEntity.spec.ts @@ -194,20 +194,10 @@ test.describe('Bulk Edit Entity', () => { // Verify Owners await expect( - page.getByRole('link', { - name: EntityDataClass.user1.responseData?.[ - 'displayName' - ][0].toUpperCase(), - exact: true, - }) + page.getByTestId(EntityDataClass.user1.responseData?.['displayName']) ).toBeVisible(); await expect( - page.getByRole('link', { - name: EntityDataClass.user2.responseData?.[ - 'displayName' - ][0].toUpperCase(), - exact: true, - }) + page.getByTestId(EntityDataClass.user2.responseData?.['displayName']) ).toBeVisible(); // Verify Tags @@ -588,10 +578,10 @@ test.describe('Bulk Edit Entity', () => { .locator('.inovua-react-toolkit-load-mask__background-layer') .waitFor({ state: 'detached' }); + await updateButtonResponse; await page.waitForSelector('.message-banner-wrapper', { state: 'detached', }); - await updateButtonResponse; await toastNotification(page, /details updated successfully/); // Verify Details updated diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts index d0c0b1e2866..cf47a893e2b 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts @@ -690,15 +690,13 @@ export const addCustomPropertiesForEntity = async ({ ); await page.click('[data-testid="create-button"]'); - + await page.waitForSelector('[data-testid="custom-property-form"]', { + state: 'detached', + }); + await page.waitForLoadState('networkidle'); const response = await createPropertyPromise; expect(response.status()).toBe(200); - - await page.waitForSelector('[data-testid="loader"]', { - state: 'detached', - }); - await expect( page.getByRole('row', { name: new RegExp(propertyName, 'i') }) ).toBeVisible(); 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 1b3b01c7398..5216fc90787 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/importUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/importUtils.ts @@ -39,13 +39,13 @@ export const createGlossaryTermRowDetails = () => { }; export const fillTextInputDetails = async (page: Page, text: string) => { - await page.keyboard.press('Enter'); + await page.keyboard.press('Enter', { delay: 100 }); - await page.locator('.ant-layout-content').getByRole('textbox').fill(text); - await page + const textboxLocator = page .locator('.ant-layout-content') - .getByRole('textbox') - .press('Enter', { delay: 100 }); + .getByRole('textbox'); + await textboxLocator.fill(text); + await textboxLocator.press('Enter', { delay: 100 }); }; export const fillDescriptionDetails = async ( diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts index 11a719bbf07..59a432cb28e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts @@ -50,6 +50,7 @@ import { PipelineType } from '../generated/api/services/ingestionPipelines/creat import { DataQualityPageTabs } from '../pages/DataQuality/DataQualityPage.interface'; import { IncidentManagerTabs } from '../pages/IncidentManager/IncidentManager.interface'; import { getPartialNameFromFQN } from './CommonUtils'; +import { getBasePath } from './HistoryUtils'; import { getServiceRouteFromServiceType } from './ServiceUtils'; import { getEncodedFqn } from './StringsUtils';