Skip to content

Commit 1c84c6d

Browse files
committed
fix(playwright): replace loader waits with API response awaits in right panel tab navigation (#27246)
(cherry picked from commit 011b482)
1 parent 7e530d1 commit 1c84c6d

4 files changed

Lines changed: 25 additions & 5 deletions

File tree

openmetadata-ui/src/main/resources/ui/playwright/e2e/PageObject/Explore/CustomPropertiesPageObject.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ export class CustomPropertiesPageObject extends RightPanelBase {
5252
* @returns CustomPropertiesPageObject for method chaining
5353
*/
5454
async navigateToCustomPropertiesTab(): Promise<CustomPropertiesPageObject> {
55+
const typeResponse = this.page.waitForResponse(
56+
(resp) =>
57+
resp.url().includes('/metadata/types/name/') &&
58+
resp.url().includes('fields=customProperties') &&
59+
resp.request().method() === 'GET'
60+
);
5561
await this.rightPanel.navigateToTab(RIGHT_PANEL_TAB.CUSTOM_PROPERTIES);
62+
await typeResponse;
5663
await this.waitForLoadersToDisappear();
5764
return this;
5865
}

openmetadata-ui/src/main/resources/ui/playwright/e2e/PageObject/Explore/DataQualityPageObject.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ export class DataQualityPageObject extends RightPanelBase {
8383
* @returns DataQualityPageObject for method chaining
8484
*/
8585
async navigateToDataQualityTab(): Promise<DataQualityPageObject> {
86+
const testCasesResponse = this.page.waitForResponse(
87+
(resp) =>
88+
resp.url().includes('/dataQuality/testCases/search/list') &&
89+
resp.request().method() === 'GET'
90+
);
8691
await this.rightPanel.navigateToTab('data quality');
92+
await testCasesResponse;
8793
await this.waitForLoadersToDisappear();
8894
return this;
8995
}

openmetadata-ui/src/main/resources/ui/playwright/e2e/PageObject/Explore/LineagePageObject.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ export class LineagePageObject extends RightPanelBase {
7676
* @returns LineagePageObject for method chaining
7777
*/
7878
async navigateToLineageTab(): Promise<LineagePageObject> {
79+
const lineageResponse = this.page.waitForResponse(
80+
(resp) =>
81+
resp.url().includes('/lineage/getLineage') &&
82+
resp.request().method() === 'GET'
83+
);
7984
await this.rightPanel.navigateToTab('lineage');
85+
await lineageResponse;
8086
await this.waitForLoadersToDisappear();
8187
return this;
8288
}

openmetadata-ui/src/main/resources/ui/playwright/e2e/PageObject/Explore/RightPanelPageObject.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
*/
1313

1414
import { expect, Locator, Page } from '@playwright/test';
15+
import { EntityClass } from '../../../support/entity/EntityClass';
16+
import { waitForAllLoadersToDisappear } from '../../../utils/entity';
1517
import { OverviewPageObject } from './OverviewPageObject';
1618
import { SchemaPageObject } from './SchemaPageObject';
1719
import { LineagePageObject } from './LineagePageObject';
1820
import { DataQualityPageObject } from './DataQualityPageObject';
1921
import { CustomPropertiesPageObject } from './CustomPropertiesPageObject';
20-
import { EntityClass } from '../../../support/entity/EntityClass';
2122

2223
/** Tab names for data-driven visibility and content assertions. Must match UI labels (e.g. "Custom Property"). */
2324
export const RIGHT_PANEL_TAB = {
@@ -60,7 +61,7 @@ export const RIGHT_PANEL_ASSET_TYPES = [
6061
'Metric',
6162
] as const;
6263

63-
export type AssetType = typeof RIGHT_PANEL_ASSET_TYPES[number] | string;
64+
export type AssetType = (typeof RIGHT_PANEL_ASSET_TYPES)[number] | string;
6465

6566
// Interface for entities that have children
6667
interface EntityWithChildren extends EntityClass {
@@ -935,7 +936,7 @@ export class RightPanelPageObject {
935936
await expect(this.panelLoaders).toHaveCount(0, { timeout });
936937

937938
// Step 3: Wait for any remaining loaders on the page (fallback)
938-
await this.pageLoader.waitFor({ state: 'detached', timeout });
939+
await this.waitForLoadersToDisappear(timeout);
939940

940941
// Step 4: Ensure panel is still visible and stable
941942
await this.getSummaryPanel().waitFor({ state: 'visible' });
@@ -1021,8 +1022,8 @@ export class RightPanelPageObject {
10211022
/**
10221023
* Wait for all loaders to disappear
10231024
*/
1024-
async waitForLoadersToDisappear() {
1025-
await this.pageLoader.waitFor({ state: 'detached' });
1025+
async waitForLoadersToDisappear(timeout?: number) {
1026+
await waitForAllLoadersToDisappear(this.page, 'loader', timeout);
10261027
}
10271028

10281029
/**

0 commit comments

Comments
 (0)