diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts index 0715b5e7ef26..fcbcc3430a07 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts @@ -303,7 +303,6 @@ ALL_ENTITIES.forEach(({ key, makeInstance }) => { const { apiContext, afterAction } = await createNewPage(browser); if (makeInstance !== null) { - await mainEntity.cleanupCustomProperty(apiContext); await mainEntity.delete(apiContext); if (key === 'entity_dataProduct') { for (const domain of (mainEntity as DataProduct).getDomains()) { @@ -495,9 +494,9 @@ ALL_ENTITIES.forEach(({ key, makeInstance }) => { await editButton.click(); await page.locator("pre[role='presentation']").last().click(); - await page.keyboard.type( - "SELECT id, name, email\nFROM users\nWHERE active = true\nAND department = 'engineering'\nORDER BY created_at DESC\nLIMIT 100" - ); + const value = + "SELECT id, name, email\nFROM users\nWHERE active = true\nAND department = 'engineering'\nORDER BY created_at DESC\nLIMIT 100"; + await page.keyboard.type(value + '\n' + value); const patchResponse = page.waitForResponse( `/api/v1/${entity.entityApiType}/*` diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts index 935b4a82f022..8167cefb7ad9 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts @@ -64,7 +64,7 @@ import { DataProduct } from '../domain/DataProduct'; import { Domain } from '../domain/Domain'; import { GlossaryTerm } from '../glossary/GlossaryTerm'; import { TagClass } from '../tag/TagClass'; -import { EntityTypeEndpoint, ENTITY_PATH } from './Entity.interface'; +import { EntityTypeEndpoint } from './Entity.interface'; export class EntityClass { type = ''; @@ -114,30 +114,6 @@ export class EntityClass { } } - async cleanupCustomProperty(apiContext: APIRequestContext) { - // Delete custom property only for supported entities - if (CustomPropertySupportedEntityList.includes(this.endpoint)) { - await this.cleanupUser?.(apiContext); - const entitySchemaResponse = await apiContext.get( - `/api/v1/metadata/types/name/${ - ENTITY_PATH[this.endpoint as keyof typeof ENTITY_PATH] - }` - ); - const entitySchema = await entitySchemaResponse.json(); - await apiContext.patch(`/api/v1/metadata/types/${entitySchema.id}`, { - data: [ - { - op: 'remove', - path: '/customProperties', - }, - ], - headers: { - 'Content-Type': 'application/json-patch+json', - }, - }); - } - } - async domain( page: Page, domain1: Domain['responseData'], diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityDataClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityDataClass.ts index ee416ae7ded8..bb5cae8f018a 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityDataClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityDataClass.ts @@ -208,27 +208,6 @@ export class EntityDataClass { } } - static async cleanupCustomPropertyData( - apiContext: APIRequestContext, - entityType: string - ) { - const entitySchemaResponse = await apiContext.get( - `/api/v1/metadata/types/name/${entityType}` - ); - const entitySchema = await entitySchemaResponse.json(); - await apiContext.patch(`/api/v1/metadata/types/${entitySchema.id}`, { - data: [ - { - op: 'remove', - path: '/customProperties', - }, - ], - headers: { - 'Content-Type': 'application/json-patch+json', - }, - }); - } - static async preRequisitesForTests(apiContext: APIRequestContext) { // Add pre-requisites for tests const promises = [ @@ -375,12 +354,6 @@ export class EntityDataClass { this.worksheet2.delete(apiContext), ]; - for (const entityType of Object.values(CUSTOM_PROPERTIES_ENTITIES).map( - (entity) => entity.name - )) { - await this.cleanupCustomPropertyData(apiContext, entityType); - } - return await Promise.allSettled(promises); } 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 4d6408ac00be..c2e1040d6860 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts @@ -1145,7 +1145,7 @@ export const verifyTableColumnCustomPropertyPersistence = async ({ .includes( `/api/v1/tables/name/${encodeURIComponent(tableFqn)}/columns` ) && - response.url().includes('profile') && + response.url().includes('fields') && response.request().method() === 'GET', // TODO: Reduce timeout once the latency issue is fixed { timeout: 150_000 } diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/customizeNavigation.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/customizeNavigation.ts index 2dfc7618e9a9..3660fdfa6a5a 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/customizeNavigation.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/customizeNavigation.ts @@ -71,15 +71,7 @@ export const validateLeftSidebarWithHiddenItems = async ( .locator(`[data-testid^="app-bar-item-"]`) .first(); - try { - // Wait for at least one child to be visible (with timeout) - await anyChildInDropdown.waitFor({ state: 'visible', timeout: 3000 }); - } catch { - // If no children are visible, the dropdown might not have expanded - // Wait a bit more and continue - // eslint-disable-next-line playwright/no-wait-for-timeout -- dropdown expansion fallback delay - await page.waitForTimeout(500); - } + await expect(anyChildInDropdown).toBeVisible(); // Ensure at least one child is visible before proceeding const childElement = page .locator(`[data-testid="app-bar-item-${items[1]}"]`) @@ -103,15 +95,15 @@ export const validateLeftSidebarWithHiddenItems = async ( } await page.click(`[data-testid="${items[0]}"]`); - - await page.mouse.move(1280, 0); // Move mouse to top right corner - - continue; } + const isNested = Object.keys(SIDEBAR_LIST_ITEMS).includes(item); + if (hiddenItems.includes(item)) { await expect( - page.getByTestId('left-sidebar').getByTestId(`app-bar-item-${item}`) + page.getByTestId(`app-bar-item-${item}`) ).not.toBeVisible(); + } else if (isNested) { + await expect(page.getByTestId(`app-bar-item-${item}`)).toBeVisible(); } else { await expect( page.getByTestId('left-sidebar').getByTestId(`app-bar-item-${item}`) 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 d967e1269b40..8b08f4badec1 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts @@ -1647,45 +1647,19 @@ export const selectDomainFromNavbar = async ( const domainDropdown = page.getByTestId('domain-dropdown'); const domainTree = page.getByTestId('domain-selectable-tree'); const searchTerm = domain.displayName ?? domain.name; - const domainOption = page.getByTestId(`tag-${domain.fullyQualifiedName}`); - const openDropdown = async () => { - await domainDropdown.click(); - await domainTree.waitFor({ state: 'visible' }); - }; - - await openDropdown(); - - const searchBar = domainTree.locator('input[placeholder]').first(); - - await expect - .poll( - async () => { - if (!(await domainTree.isVisible().catch(() => false))) { - await openDropdown(); - } - - const isSearchBarVisible = await searchBar - .isVisible() - .catch(() => false); + await domainDropdown.click(); + await page + .getByTestId('domain-selectable-tree') + .waitFor({ state: 'visible' }); - if (isSearchBarVisible) { - await searchBar.focus(); - await searchBar.press('Control+a'); - await searchBar.pressSequentially(searchTerm); - } + await domainTree.getByTestId('searchbar').waitFor({ state: 'visible' }); - return await domainOption.isVisible().catch(() => false); - }, - { - timeout: 60000, - intervals: [1000, 2000, 5000], - message: `Timed out waiting for domain ${searchTerm} to appear in navbar selector`, - } - ) - .toBe(true); + await domainTree.getByTestId('searchbar').click(); + await page.keyboard.press('Control+a'); + await domainTree.getByTestId('searchbar').pressSequentially(searchTerm); - await domainOption.click(); + await page.getByTestId(`tag-${domain.fullyQualifiedName}`).click(); await waitForAllLoadersToDisappear(page); };