fix user cypress failure (#16728)

This commit is contained in:
Ashish Gupta 2024-06-20 16:41:15 +05:30 committed by GitHub
parent 1ad1d820d8
commit cd5d8dfa06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View File

@ -197,14 +197,11 @@ class UsersTestClass {
cy.get('[data-testid="inline-save-btn"]').click(); cy.get('[data-testid="inline-save-btn"]').click();
verifyResponseStatusCode('@updateTeam', 200); verifyResponseStatusCode('@updateTeam', 200);
cy.get('.ant-collapse-expand-icon > .anticon > svg').click();
cy.get('[data-testid="edit-description"]').click(); cy.get('[data-testid="edit-description"]').click();
cy.get(descriptionBox).clear(); cy.get(descriptionBox).clear();
interceptURL('PATCH', '/api/v1/users/*', 'patchDescription'); interceptURL('PATCH', '/api/v1/users/*', 'patchDescription');
cy.get('[data-testid="save"]').should('be.visible').click(); cy.get('[data-testid="save"]').should('be.visible').click();
verifyResponseStatusCode('@patchDescription', 200); verifyResponseStatusCode('@patchDescription', 200);
cy.get('.ant-collapse-expand-icon > .anticon > svg').scrollIntoView();
cy.get('.ant-collapse-expand-icon > .anticon > svg').click();
} }
} }

View File

@ -143,11 +143,11 @@ export const restoreUserProfilePage = async (page: Page, fqn: string) => {
await restoreResponse; await restoreResponse;
await expect(page.getByRole('alert')).toHaveText( await expect(page.getByRole('alert').first()).toHaveText(
/User restored successfully/ /User restored successfully/
); );
await page.getByLabel('close').click(); await page.getByLabel('close').first().click();
await nonDeletedUserChecks(page); await nonDeletedUserChecks(page);
}; };
@ -175,9 +175,9 @@ export const hardDeleteUserProfilePage = async (
await deleteResponse; await deleteResponse;
await expect(page.locator('.Toastify__toast-body')).toHaveText( await expect(page.getByRole('alert').first()).toHaveText(
/deleted successfully!/ /deleted successfully!/
); );
await page.click('.Toastify__close-button'); await page.getByLabel('close').first().click();
}; };