From ceeba2ad752b5e4df00bb89cee31faf1db3f4f73 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Tue, 31 Dec 2024 17:12:15 +0530 Subject: [PATCH] fix tag page flaky playwright test (#19150) * fix tag page flaky playwright failures * removed commented code --- .../ui/playwright/support/tag/TagClass.ts | 1 + .../src/main/resources/ui/playwright/utils/tag.ts | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/tag/TagClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/tag/TagClass.ts index 4d15a077f80..b0c86b70805 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/tag/TagClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/tag/TagClass.ts @@ -66,6 +66,7 @@ export class TagClass { async visitPage(page: Page) { await visitClassificationPage( page, + this.responseData.classification.name, this.responseData.classification.displayName ); await page.getByTestId(this.data.name).click(); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts index 34db611d365..cffea876f52 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts @@ -39,23 +39,26 @@ export const TAG_INVALID_NAMES = { export const visitClassificationPage = async ( page: Page, - classificationName: string + classificationName: string, + classificationDisplayName: string ) => { await redirectToHomePage(page); const classificationResponse = page.waitForResponse( '/api/v1/classifications?**' ); - const fetchTags = page.waitForResponse('/api/v1/tags?*parent=*'); + const fetchTags = page.waitForResponse( + `/api/v1/tags?*parent=${classificationName}**` + ); await sidebarClick(page, SidebarItem.TAGS); await classificationResponse; await page - .locator(`[data-testid="side-panel-classification"]`) - .filter({ hasText: classificationName }) + .getByTestId('data-summary-container') + .getByText(classificationDisplayName) .click(); await expect(page.locator('.activeCategory')).toContainText( - classificationName + classificationDisplayName ); await fetchTags; @@ -351,7 +354,7 @@ export const editTagPageDescription = async (page: Page, tag: TagClass) => { }; export const verifyCertificationTagPageUI = async (page: Page) => { - await visitClassificationPage(page, 'Certification'); + await visitClassificationPage(page, 'Certification', 'Certification'); const res = page.waitForResponse(`/api/v1/tags/name/*`); await page.getByTestId('Gold').click(); await res;