Skip to content

Commit

Permalink
Fixed the user management page cypress issue (#9384)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Dec 11, 2024
1 parent 113dddd commit 3ba5dc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/users_spec/UsersManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
12 changes: 4 additions & 8 deletions cypress/pageobject/Users/ManageUserPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 3ba5dc6

Please sign in to comment.