Skip to content

Commit

Permalink
Merge pull request #9613 from ohcnetwork/staging
Browse files Browse the repository at this point in the history
Production Release v24.53.0
  • Loading branch information
gigincg authored Dec 30, 2024
2 parents b0b2bfb + 7abac10 commit 84a33f5
Show file tree
Hide file tree
Showing 47 changed files with 2,155 additions and 2,891 deletions.
1 change: 1 addition & 0 deletions .github/workflows/label-merge-conflict.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Auto Label Conflicts

permissions:
contents: read
issues: write
pull-requests: write

Expand Down
8 changes: 0 additions & 8 deletions cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
patientDischarge.verifyDischargePatient();
// Verify the consultation dashboard reflection
cy.verifyContentPresence("#consultation-buttons", ["Recovered"]);
// Verify the dashboard and discharge information
cy.verifyContentPresence("#discharge-information", [
patientDischargeReason1,
patientDischargeAdvice,
patientMedicine,
]);
});

afterEach(() => {
Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ describe("Patient Discussion notes in the consultation page", () => {
const patientNurseReplyNote = "Test nurse reply Notes";
const discussionNotesSubscribeWarning =
"Please subscribe to notifications to get live updates on discussion notes.";
const discussionNotesSuccessMessage = "Note added successfully";

before(() => {
loginPage.loginByRole("districtAdmin");
Expand All @@ -34,8 +33,6 @@ describe("Patient Discussion notes in the consultation page", () => {
patientDoctorNotes.selectNurseDiscussion();
patientDoctorNotes.addDiscussionNotes(patientNurseNote);
patientDoctorNotes.postDiscussionNotes();
cy.verifyNotification(discussionNotesSuccessMessage);
cy.closeNotification();
// verify the auto-switching of tab to nurse notes if the user is a nurse
patientDoctorNotes.signout();
loginPage.loginManuallyAsNurse();
Expand All @@ -50,8 +47,6 @@ describe("Patient Discussion notes in the consultation page", () => {
// Post a reply comment to the message
patientDoctorNotes.addDiscussionNotes(patientNurseReplyNote);
patientDoctorNotes.postDiscussionNotes();
cy.verifyNotification(discussionNotesSuccessMessage);
cy.closeNotification();
patientDoctorNotes.verifyDiscussionMessage(patientNurseReplyNote);
});

Expand Down
83 changes: 9 additions & 74 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
import FacilityHome from "pageobject/Facility/FacilityHome";
import ManageUserPage from "pageobject/Users/ManageUserPage";
import UserProfilePage from "pageobject/Users/UserProfilePage";
import { advanceFilters } from "pageobject/utils/advanceFilterHelpers";

import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import { ManageUserPage } from "../../pageobject/Users/ManageUserPage";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";
import { UserPage } from "../../pageobject/Users/UserSearch";
import {
generateEmergencyPhoneNumber,
generatePhoneNumber,
} from "../../pageobject/utils/constants";
import { generatePhoneNumber } from "../../pageobject/utils/constants";

describe("User Creation", () => {
const userPage = new UserPage();
const loginPage = new LoginPage();
const userProfilePage = new UserProfilePage();
const manageUserPage = new ManageUserPage();
const userCreationPage = new UserCreationPage();
const manageUserPage = new ManageUserPage();
const facilityPage = new FacilityPage();
const facilityHome = new FacilityHome();
const phoneNumber = generatePhoneNumber();
const emergencyPhoneNumber = generateEmergencyPhoneNumber();
const fillFacilityName = "Dummy Facility 40";
const makeId = (length: number) => {
let result = "";
Expand Down Expand Up @@ -54,14 +48,6 @@ describe("User Creation", () => {
"Please select the local body",
];

const EXPECTED_PROFILE_ERROR_MESSAGES = [
"This field is required",
"This field is required",
"Please enter valid phone number",
];
const userName = "devdistrictadmin";
const firstName = "District Editted";
const lastName = "Cypress";
const gender = "Male";
const email = "[email protected]";
const password = "Test@123";
Expand All @@ -74,9 +60,6 @@ describe("User Creation", () => {
const district = "Ernakulam";
const role = "Doctor";
const homeFacility = "Dummy Shifting Center";
const weeklyWorkingHrs = "14";
const dob = "01011998";
const formattedDob = "01/01/1998";
const newUserDob = "25081999";

before(() => {
Expand All @@ -90,55 +73,6 @@ describe("User Creation", () => {
cy.awaitUrl("/users");
});

it("Update the existing user profile and verify its reflection", () => {
manageUserPage.navigateToProfile();
cy.verifyContentPresence("#username-profile-details", [userName]);
userProfilePage.clickEditProfileButton();
userCreationPage.clearFirstName();
userCreationPage.typeFirstName(firstName);
userCreationPage.clearLastName();
userCreationPage.typeLastName(lastName);
userProfilePage.selectGender(gender);
userProfilePage.clearPhoneNumber();
userProfilePage.typePhoneNumber(phoneNumber);
userProfilePage.clearAltPhoneNumber();
userProfilePage.typeWhatsappNumber(emergencyPhoneNumber);
userProfilePage.clearEmail();
userProfilePage.typeEmail(email);
userProfilePage.clearWorkingHours();
userProfilePage.typeWorkingHours(weeklyWorkingHrs);
userProfilePage.typeDateOfBirth(dob);
userProfilePage.interceptUpdateUsers();
userProfilePage.clickUpdateButton();
userProfilePage.verifyUpdateUsersResponse();
cy.verifyContentPresence("#contactno-profile-details", [
"+91" + phoneNumber,
]);
cy.verifyContentPresence("#whatsapp-profile-details", [
"+91" + emergencyPhoneNumber,
]);
cy.verifyContentPresence("#firstname-profile-details", [firstName]);
cy.verifyContentPresence("#lastname-profile-details", [lastName]);
cy.verifyContentPresence("#date_of_birth-profile-details", [formattedDob]);
cy.verifyContentPresence("#emailid-profile-details", [email]);
cy.verifyContentPresence("#gender-profile-details", [gender]);
cy.verifyContentPresence("#averageworkinghour-profile-details", [
weeklyWorkingHrs,
]);
});

it("Update the existing user profile Form Mandatory File Error", () => {
manageUserPage.navigateToProfile();
userProfilePage.clickEditProfileButton();
userCreationPage.clearFirstName();
userCreationPage.clearLastName();
userProfilePage.clearPhoneNumber();
userProfilePage.clearAltPhoneNumber();
userProfilePage.clearWorkingHours();
userProfilePage.clickUpdateButton();
cy.verifyErrorMessages(EXPECTED_PROFILE_ERROR_MESSAGES);
});

it("create new user and verify reflection", () => {
userCreationPage.clickAddUserButton();
userCreationPage.selectFacility(homeFacility);
Expand All @@ -147,14 +81,14 @@ describe("User Creation", () => {
userCreationPage.typeConfirmPassword(password);
userCreationPage.selectHomeFacility(homeFacility);
userPage.typeInPhoneNumber(phoneNumber);
userProfilePage.typeDateOfBirth(newUserDob);
manageUserPage.editDateOfBirth(newUserDob);
userCreationPage.selectUserType(role);
userProfilePage.typeQualification(qualification);
userProfilePage.typeDoctorYoE(experience);
userProfilePage.typeMedicalCouncilRegistration(regNo);
manageUserPage.editQualification(qualification, false);
manageUserPage.editDoctorYoE(experience, false);
manageUserPage.editMedicalCouncilRegistration(regNo, false);
userPage.typeInFirstName(newUserFirstName);
userPage.typeInLastName(newUserLastName);
userProfilePage.typeEmail(email);
manageUserPage.editEmail(email, false);
userCreationPage.selectGender(gender);
userCreationPage.selectState(state);
userCreationPage.selectDistrict(district);
Expand All @@ -178,6 +112,7 @@ describe("User Creation", () => {
});

it("view user redirection from facility page", () => {
loginPage.ensureLoggedIn();
facilityHome.navigateToFacilityHomepage();
facilityHome.typeFacilitySearch(fillFacilityName);
advanceFilters.verifyFilterBadgePresence(
Expand Down
Loading

0 comments on commit 84a33f5

Please sign in to comment.