From 40ea811ee7d5916e432fadb877c3fee49af9cebc Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:43:00 +0530 Subject: [PATCH 1/2] fixed the user management flaky test --- cypress/e2e/users_spec/UsersManage.cy.ts | 1 + cypress/pageobject/Users/ManageUserPage.ts | 7 ++----- 2 files changed, 3 insertions(+), 5 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..cdf2b3d9307 100644 --- a/cypress/pageobject/Users/ManageUserPage.ts +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -193,12 +193,9 @@ 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) { From 1160d6e5437e1674e46abbaebfd7cc6e2e7815b9 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:10:38 +0530 Subject: [PATCH 2/2] fixed the id --- cypress/pageobject/Users/ManageUserPage.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cypress/pageobject/Users/ManageUserPage.ts b/cypress/pageobject/Users/ManageUserPage.ts index cdf2b3d9307..24c056a70eb 100644 --- a/cypress/pageobject/Users/ManageUserPage.ts +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -199,10 +199,9 @@ export class ManageUserPage { } verifyProfileWorkingHours(expectedHours: string) { - cy.get("#view-average_weekly_working_hours").should( - "contain.text", + cy.verifyContentPresence("#averageworkinghour-profile-details", [ expectedHours, - ); + ] as string[]); } navigateToManageUser() {