From 3ba5dc6a7030fe6e81a164078483eb3f251e7601 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:25:52 +0530 Subject: [PATCH] Fixed the user management page cypress issue (#9384) --- cypress/e2e/users_spec/UsersManage.cy.ts | 1 + cypress/pageobject/Users/ManageUserPage.ts | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index 39075b8b96f..c7d237efb43 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -305,6 +305,7 @@ describe("Manage User", () => { manageUserPage.clickSubmit(); // verify the data is reflected in the page manageUserPage.verifyWorkingHours(workinghour); + manageUserPage.navigateToProfile(); manageUserPage.verifyProfileWorkingHours(workinghour); }); diff --git a/cypress/pageobject/Users/ManageUserPage.ts b/cypress/pageobject/Users/ManageUserPage.ts index 92e2008bfd8..24c056a70eb 100644 --- a/cypress/pageobject/Users/ManageUserPage.ts +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -193,19 +193,15 @@ export class ManageUserPage { } verifyWorkingHours(expectedHours: string) { - cy.get("input[name='weekly_working_hours']").scrollIntoView(); - cy.get("input[name='weekly_working_hours']").should("be.visible"); - cy.get("input[name='weekly_working_hours']").should( - "have.value", + cy.verifyContentPresence("#view-average_weekly_working_hours", [ expectedHours, - ); + ] as string[]); } verifyProfileWorkingHours(expectedHours: string) { - cy.get("#view-average_weekly_working_hours").should( - "contain.text", + cy.verifyContentPresence("#averageworkinghour-profile-details", [ expectedHours, - ); + ] as string[]); } navigateToManageUser() {