From cd5d8dfa06bf48fda204c5228c201a2a75c35bf6 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Thu, 20 Jun 2024 16:41:15 +0530 Subject: [PATCH] fix user cypress failure (#16728) --- .../resources/ui/cypress/common/Entities/UserClass.ts | 3 --- .../src/main/resources/ui/playwright/utils/user.ts | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/UserClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/UserClass.ts index 548ebad1025..903c469e99d 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/UserClass.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/UserClass.ts @@ -197,14 +197,11 @@ class UsersTestClass { cy.get('[data-testid="inline-save-btn"]').click(); verifyResponseStatusCode('@updateTeam', 200); - cy.get('.ant-collapse-expand-icon > .anticon > svg').click(); cy.get('[data-testid="edit-description"]').click(); cy.get(descriptionBox).clear(); interceptURL('PATCH', '/api/v1/users/*', 'patchDescription'); cy.get('[data-testid="save"]').should('be.visible').click(); verifyResponseStatusCode('@patchDescription', 200); - cy.get('.ant-collapse-expand-icon > .anticon > svg').scrollIntoView(); - cy.get('.ant-collapse-expand-icon > .anticon > svg').click(); } } diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/user.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/user.ts index 4a297ab61b4..a0cd98f71f7 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/user.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/user.ts @@ -143,11 +143,11 @@ export const restoreUserProfilePage = async (page: Page, fqn: string) => { await restoreResponse; - await expect(page.getByRole('alert')).toHaveText( + await expect(page.getByRole('alert').first()).toHaveText( /User restored successfully/ ); - await page.getByLabel('close').click(); + await page.getByLabel('close').first().click(); await nonDeletedUserChecks(page); }; @@ -175,9 +175,9 @@ export const hardDeleteUserProfilePage = async ( await deleteResponse; - await expect(page.locator('.Toastify__toast-body')).toHaveText( + await expect(page.getByRole('alert').first()).toHaveText( /deleted successfully!/ ); - await page.click('.Toastify__close-button'); + await page.getByLabel('close').first().click(); };