Skip to content

Commit

Permalink
Merge branch 'develop' into issue/9102/adjust_spo2_labels
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 authored Nov 19, 2024
2 parents ccdae9f + 570ed1e commit cb36e62
Show file tree
Hide file tree
Showing 27 changed files with 399 additions and 91 deletions.
33 changes: 33 additions & 0 deletions cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,39 @@ describe("Facility Creation", () => {
);
});

it("Should display error when district admin tries to create facility in a different district", () => {
facilityPage.visitCreateFacilityPage();
facilityPage.fillFacilityName(facilityName);
facilityPage.selectFacilityType(facilityType);
facilityPage.fillPincode("682001");
facilityPage.selectStateOnPincode("Kerala");
facilityPage.selectDistrictOnPincode("Kottayam");
facilityPage.selectLocalBody("Arpookara");
facilityPage.selectWard("5");
facilityPage.fillAddress(facilityAddress);
facilityPage.fillPhoneNumber(facilityNumber);
facilityPage.submitForm();
facilityPage.verifyErrorNotification(
"You do not have permission to perform this action.",
);
});

it("Access Restriction for Non-Admin Users to facility creation page", () => {
const nonAdminLoginMethods = [
loginPage.loginAsDevDoctor.bind(loginPage),
loginPage.loginAsStaff.bind(loginPage),
];

nonAdminLoginMethods.forEach((loginMethod) => {
loginMethod();
cy.visit("/facility/create");
facilityPage.verifyErrorNotification(
"You don't have permission to perform this action. Contact the admin",
);
cy.clearCookies();
});
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ describe("Facility Homepage Function", () => {
facilityNotify.verifyFacilityName(facilityName);
facilityNotify.fillNotifyText(notificationMessage);
facilityNotify.interceptPostNotificationReq();
cy.submitButton("Notify");
cy.clickSubmitButton("Notify");
facilityNotify.verifyPostNotificationReq();
cy.verifyNotification("Facility Notified");
cy.closeNotification();
cy.wait(2000);
// Verify the frontend error on empty message
facilityHome.clickFacilityNotifyButton();
facilityNotify.verifyFacilityName(facilityName);
cy.submitButton("Notify");
cy.clickSubmitButton("Notify");
facilityNotify.verifyErrorMessage(notificationErrorMsg);
// close pop-up and verify
facilityHome.verifyAndCloseNotifyModal();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/facility_spec/FacilityLocation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ describe("Location Management Section", () => {
facilityLocation.clickAddNewLocationButton();
facilityLocation.enterLocationName("Test Location with Beds");
facilityLocation.selectLocationType("OTHER");
cy.submitButton("Add Location");
cy.clickSubmitButton("Add Location");
cy.verifyNotification("Location created successfully");
cy.closeNotification();
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
facilityLocation.enterBedName("Bed 1");
facilityLocation.selectBedType("Regular");
cy.submitButton("Add Bed(s)");
cy.clickSubmitButton("Add Bed(s)");
cy.verifyNotification("1 Bed created successfully");
cy.closeNotification();
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
Expand Down
4 changes: 3 additions & 1 deletion cypress/e2e/hcx_spec/HcxClaims.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("HCX Claims configuration and approval workflow", () => {
firstInsuranceIdentifier,
patientInsurerName,
);
cy.submitButton("Save Details");
cy.clickSubmitButton("Save Details");
cy.verifyNotification("Patient updated successfully");
cy.closeNotification();
// Navigate to Consultation View and capture dynamic consultation ID
Expand Down Expand Up @@ -80,6 +80,8 @@ describe("HCX Claims configuration and approval workflow", () => {
// Raise a HCX Pre-auth
patientConsultationPage.clickManagePatientButton();
patientConsultationPage.clickClaimsButton();
cy.verifyAndClickElement("#edit-insurance-policy", "Edit Insurance Policy");
cy.clickCancelButton();
hcxClaims.selectEligiblePolicy(patientInsurerName);
hcxClaims.verifyPolicyEligibility();
cy.verifyNotification("Checking Policy Eligibility");
Expand Down
22 changes: 11 additions & 11 deletions cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
patientTreatmentPlan.typeSpecialInstruction(specialInstruction);
patientTreatmentPlan.fillTreatingPhysican(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
// the above submit should fail as IP number is missing
patientConsultationPage.typePatientNumber(patientIpNumber);
patientConsultationPage.selectBed("Dummy Bed 6");
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// Below code for the prescription module only present while creating a new consultation
patientPrescription.clickAddPrescription();
Expand All @@ -104,7 +104,7 @@ describe("Patient Consultation in multiple combination", () => {
patientPrescription.selectMedicine(medicineOne);
patientPrescription.enterDosage("3");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.wait(2000);
cy.verifyNotification("Medicine prescribed");
patientPrescription.clickReturnToDashboard();
Expand Down Expand Up @@ -189,7 +189,7 @@ describe("Patient Consultation in multiple combination", () => {
"#encounter_date",
"220220241230",
);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification(
"Create Diagnoses - Atleast one diagnosis is required",
);
Expand All @@ -198,7 +198,7 @@ describe("Patient Consultation in multiple combination", () => {
diagnosis4,
"add-icd11-diagnosis-as-confirmed",
);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// verify the data and death report
patientConsultationPage.verifyTextInConsultation(
Expand All @@ -215,7 +215,7 @@ describe("Patient Consultation in multiple combination", () => {
"#cause_of_death",
"Cause of Death",
);
cy.submitButton("Preview");
cy.clickSubmitButton("Preview");
cy.preventPrint();
patientDeathReport.clickPrintDeathReport();
cy.get("@verifyPrevent").should("be.called");
Expand Down Expand Up @@ -261,7 +261,7 @@ describe("Patient Consultation in multiple combination", () => {
// add telemedicine
patientTreatmentPlan.clickTelemedicineCheckbox();
patientTreatmentPlan.assignTelemedicineDoctor(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// verify the data reflection -
patientConsultationPage.verifyTextInConsultation(
Expand Down Expand Up @@ -312,7 +312,7 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
// no review after and no action
patientTreatmentPlan.fillTreatingPhysican(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Patient discharged successfully");
// verify the Discharge Reason, Diagnosis, treatment physican
patientConsultationPage.verifyTextInConsultation(
Expand Down Expand Up @@ -364,13 +364,13 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
patientTreatmentPlan.fillTreatingPhysican(doctorName);
// no review after and no action
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
// Create a shifting request
cy.closeNotification();
shiftCreation.typeCurrentFacilityPerson("Current Facility Person");
shiftCreation.typeCurrentFacilityPhone("9999999999");
shiftCreation.typeShiftReason("reason for shift");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Shift request created successfully");
});

Expand All @@ -386,7 +386,7 @@ describe("Patient Consultation in multiple combination", () => {
cy.get("#condition-verification-status-menu").click();
cy.get("#add-icd11-diagnosis-as-entered-in-error").click();
});
cy.submitButton("Update Consultation");
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.get("#diagnoses-view").should("not.contain.text", diagnosis5);
patientConsultationPage.verifyTextInConsultation(
Expand Down
18 changes: 9 additions & 9 deletions cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe("Patient Discharge based on multiple reason", () => {
patientPage.visitPatient("Dummy Patient 12");
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason4);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -52,8 +52,8 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.selectDischargeReason(patientDischargeReason3);
patientDischarge.typeDischargeNote(patientDeathCause);
patientDischarge.typeDoctorName(doctorName);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -77,8 +77,8 @@ describe("Patient Discharge based on multiple reason", () => {
// select a non-registered facility and perform the discharge
patientDischarge.typeReferringFacility(referringFreetextFacility);
cy.wait(2000);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
Expand All @@ -104,13 +104,13 @@ describe("Patient Discharge based on multiple reason", () => {
patientPrescription.selectMedicine(patientMedicine);
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.wait(2000);
cy.closeNotification();
// submit the discharge pop-up
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientInvestigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("Patient Investigation Creation from Patient consultation page", () =>
"Haematology",
"Urine Test",
]);
cy.submitButton("Save Investigation");
cy.clickSubmitButton("Save Investigation");
cy.verifyNotification("Please Enter at least one value");
cy.closeNotification();
// Temporary workflow for investigation since we dont have dummy data and moving away from existing module
Expand Down
Loading

0 comments on commit cb36e62

Please sign in to comment.