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/4] 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/4] 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() { From aeca6d10a52010421142707f6a6615d36ace459b Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:48:19 +0530 Subject: [PATCH 3/4] fixed the flaky test with nurse --- cypress/e2e/users_spec/UsersManage.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index c7d237efb43..de574526460 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -18,7 +18,7 @@ describe("Manage User", () => { const firstNameUserSkill = "Dev"; const lastNameUserSkill = "Doctor"; const usernameforworkinghour = "devdistrictadmin"; - const nurseUsername = "dummynurse1"; + const nurseUsername = "dummynurse4"; const doctorUsername = "devdoctor"; const doctorToDelete = "dummydoctor12"; const usernamerealname = "Dummy Doctor"; From e68cfab223547606689b634de8f676c7cb3b2dda Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:11:53 +0530 Subject: [PATCH 4/4] user credentials --- cypress/e2e/users_spec/UsersHomepage.cy.ts | 10 +++++----- cypress/e2e/users_spec/UsersManage.cy.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/users_spec/UsersHomepage.cy.ts b/cypress/e2e/users_spec/UsersHomepage.cy.ts index acc1639e003..a82b718047d 100644 --- a/cypress/e2e/users_spec/UsersHomepage.cy.ts +++ b/cypress/e2e/users_spec/UsersHomepage.cy.ts @@ -8,15 +8,15 @@ describe("User Homepage", () => { const userPage = new UserPage(); const loginPage = new LoginPage(); const currentuser = "devdistrictadmin"; - const firstName = "Dummy"; - const lastName = "Nurse"; + const firstName = "Dev"; + const lastName = "Staff"; const role = "Nurse"; const state = "Kerala"; const district = "Ernakulam"; - const phoneNumber = "8878825662"; - const altPhoneNumber = "8878825662"; + const phoneNumber = "9876543219"; + const altPhoneNumber = "9876543219"; const homeFacility = "Dummy Facility 40"; - const nurseUserName = "dummynurse1"; + const nurseUserName = "devstaff2"; const doctorUserName = "dev-doctor2"; before(() => { diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index de574526460..c7d237efb43 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -18,7 +18,7 @@ describe("Manage User", () => { const firstNameUserSkill = "Dev"; const lastNameUserSkill = "Doctor"; const usernameforworkinghour = "devdistrictadmin"; - const nurseUsername = "dummynurse4"; + const nurseUsername = "dummynurse1"; const doctorUsername = "devdoctor"; const doctorToDelete = "dummydoctor12"; const usernamerealname = "Dummy Doctor";