Skip to content

Commit

Permalink
fix tag page flaky playwright test (#19150)
Browse files Browse the repository at this point in the history
* fix tag page flaky playwright failures

* removed commented code

(cherry picked from commit ceeba2a)
  • Loading branch information
Ashish8689 committed Dec 31, 2024
1 parent 564d33d commit db9c2bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
15 changes: 9 additions & 6 deletions openmetadata-ui/src/main/resources/ui/playwright/utils/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,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=${classificationName}**`
);
await sidebarClick(page, SidebarItem.TAGS);
await classificationResponse;

const fetchTags = page.waitForResponse('/api/v1/tags?*parent=*');
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;
Expand Down Expand Up @@ -350,7 +353,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;
Expand Down

0 comments on commit db9c2bc

Please sign in to comment.