Skip to content

Commit 0334d46

Browse files
committed
Fixed Entity spec (#26767)
1 parent 37b88f4 commit 0334d46

3 files changed

Lines changed: 44 additions & 19 deletions

File tree

openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Entity.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,12 +2078,15 @@ Object.entries(entities).forEach(([key, EntityClass]) => {
20782078
const columnFqn =
20792079
(entity as TableClass).entityResponseData.columns[0]
20802080
.fullyQualifiedName ?? '';
2081+
const tableFqn =
2082+
(entity as TableClass).entityResponseData.fullyQualifiedName ?? '';
20812083

20822084
for (const type of properties) {
20832085
await test.step(`Set ${type} custom property on column and verify in UI`, async () => {
20842086
await verifyTableColumnCustomPropertyPersistence({
20852087
page,
20862088
columnFqn,
2089+
tableFqn,
20872090
propertyName: customPropertyValue[type].property.name,
20882091
propertyType: type,
20892092
users,

openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,21 +1137,36 @@ export const validateColumnCustomProperty = async (
11371137
export const verifyTableColumnCustomPropertyPersistence = async ({
11381138
page,
11391139
columnFqn,
1140+
tableFqn,
11401141
propertyName,
11411142
propertyType,
11421143
users,
11431144
}: {
11441145
page: Page;
11451146
columnFqn: string;
1147+
tableFqn: string;
11461148
propertyName: string;
11471149
propertyType: string;
11481150
users: Record<string, string>;
11491151
}) => {
11501152
const testValue = getPropertyValues(propertyType, users).value;
1153+
const columnsProfileResponse = () =>
1154+
page.waitForResponse(
1155+
(response) =>
1156+
response
1157+
.url()
1158+
.includes(
1159+
`/api/v1/tables/name/${encodeURIComponent(tableFqn)}/columns`
1160+
) &&
1161+
response.url().includes('profile') &&
1162+
response.request().method() === 'GET',
1163+
{ timeout: 90_000 }
1164+
);
11511165

11521166
// 1. Navigate and Open Column Detail Panel
1153-
await page.goto(`/table/${columnFqn}`);
1154-
await page.waitForLoadState('networkidle');
1167+
const initialColumnsResponse = columnsProfileResponse();
1168+
await page.goto(`/table/${columnFqn}`, { waitUntil: 'domcontentloaded' });
1169+
await initialColumnsResponse;
11551170
await waitForAllLoadersToDisappear(page);
11561171
const sidePanel = page.locator('.column-detail-panel-container');
11571172
await expect(sidePanel).toBeVisible();
@@ -1197,23 +1212,15 @@ export const verifyTableColumnCustomPropertyPersistence = async ({
11971212
propertyName
11981213
);
11991214

1200-
// 5. Reload Page
1201-
const getColumnDetails = page.waitForResponse(
1202-
'/api/v1/tables/name/*/columns?*fields=*extension*'
1203-
);
1204-
const getTableColumnTypes = page.waitForResponse(
1205-
'/api/v1/metadata/types/name/tableColumn*'
1206-
);
1207-
await page.reload();
1208-
await getTableColumnTypes;
1209-
await getColumnDetails;
1210-
1211-
await page.waitForSelector(
1212-
'.column-detail-panel-container [data-testid="custom-properties-tab"]',
1213-
{
1214-
state: 'visible',
1215-
}
1216-
);
1215+
const reloadColumnsResponse = columnsProfileResponse();
1216+
await page.reload({ waitUntil: 'domcontentloaded' });
1217+
await reloadColumnsResponse;
1218+
await waitForAllLoadersToDisappear(page);
1219+
await expect(
1220+
page.locator(
1221+
'.column-detail-panel-container [data-testid="custom-properties-tab"]'
1222+
)
1223+
).toBeVisible();
12171224
await customPropertiesTab.click();
12181225
await expect(searchbar).toBeVisible();
12191226
await searchbar.fill(propertyName);

openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,17 @@ export const openColumnDetailPanel = async ({
10201020
)
10211021
: null;
10221022

1023+
const columnsProfileResponsePromise =
1024+
entityType === 'table'
1025+
? page.waitForResponse(
1026+
(response) =>
1027+
response.url().includes('/api/v1/tables/name/') &&
1028+
response.url().includes('/columns') &&
1029+
response.url().includes('profile') &&
1030+
response.request().method() === 'GET',
1031+
{ timeout: 90_000 }
1032+
)
1033+
: null;
10231034
if (entityType === 'MlModel') {
10241035
const columnName = page
10251036
.locator(`[${rowSelector}="${columnId}"]`)
@@ -1050,6 +1061,10 @@ export const openColumnDetailPanel = async ({
10501061
expect(apiResponse.status()).toBe(200);
10511062
}
10521063

1064+
if (columnsProfileResponsePromise) {
1065+
await columnsProfileResponsePromise;
1066+
}
1067+
10531068
const panelContainer = page.locator('.column-detail-panel');
10541069

10551070
// Wait for the panel content to be loaded

0 commit comments

Comments
 (0)