Skip to content

Commit

Permalink
Merge branch 'develop' into doctor-notes-enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
UdaySagar-Git authored Dec 19, 2024
2 parents ab45147 + c1890ed commit 5bb768f
Show file tree
Hide file tree
Showing 44 changed files with 1,091 additions and 604 deletions.
1 change: 0 additions & 1 deletion cypress/e2e/assets_spec/AssetHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ rolesToTest.forEach((role) => {
it("Export the list of assets in CSV & Json", () => {
if (role === "districtAdmin") {
assetHome.selectAssetImportButton("click");
cy.wait(2000);
assetHome.selectJsonExportButton();
assetHome.selectAssetImportButton("click");
assetHome.selectCsvExportButton();
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ describe("Facility Creation with multiple user roles", () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.restoreLocalStorage();
cy.awaitUrl("/facility");
});

it("Create a new facility with all fields | Edit Existing Data | Verify its reflection", () => {
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ describe("Facility Homepage Function", () => {
});

it("Verify the bed capacity badge reflection", () => {
facilityHome.interceptFacilitySearchReq();
facilityHome.typeFacilitySearch(facilityWithNoAvailableBeds);
facilityHome.verifyFacilitySearchReq();
facilityHome.assertFacilityInCard(facilityWithNoAvailableBeds);
cy.url().then((url) => {
const facilityUrl = url.toString();
Expand Down
13 changes: 9 additions & 4 deletions cypress/e2e/facility_spec/FacilityInventory.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ describe("Inventory Management Section", () => {

it("Add New Inventory | Modify data and delete last entry ", () => {
// add a new item
facilityPage.interceptManageInventoryItem();
facilityPage.clickManageInventory();
facilityPage.verifyManageInventoryItem();
facilityPage.fillInventoryDetails("PPE", "Add Stock", "10");
facilityPage.clickAddInventory();
facilityPage.verifySuccessNotification("Inventory created successfully");
cy.closeNotification();
facilityPage.clickManageInventory();
// modify the new item
facilityPage.fillInventoryDetails("PPE", "Use Stock", "5");
facilityPage.clickAddInventory();
facilityPage.verifySuccessNotification("Inventory created successfully");
facilityPage.verifySuccessNotification(
"Inventory use stock updated successfully",
);
// verify the new modification
facilityPage.verifyPpeQuantity("PPE");
facilityPage.verifyPpeQuantity("5");
Expand All @@ -43,7 +48,6 @@ describe("Inventory Management Section", () => {
// verify the last entry deletion
facilityPage.verifyStockInRow("#row-0", "Added Stock");
facilityPage.verifyStockInRow("#row-1", "Used Stock");
cy.wait(3000);
facilityHome.navigateBack();
facilityPage.verifyPpeQuantity("PPE");
});
Expand All @@ -57,9 +61,10 @@ describe("Inventory Management Section", () => {
cy.closeNotification();
// Verify Backend minimum badge
facilityPage.verifyBadgeWithText(".badge-danger", "Low Stock");
facilityPage.interceptMinimumQuantity();
// modify with manual minimum badge
facilityPage.clickAddMinimumQuanitity();
cy.wait(3000);
facilityPage.clickAddMinimumQuantity();
facilityPage.verifyMinimumQuantity();
cy.get("body").then(($body) => {
if ($body.find("#update-minimum-quantity").is(":visible")) {
// If the 'update-minimum-quantity' element is visible, click it
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ describe("Patient Consultation in multiple combination", () => {
patientPrescription.selectMedicine(medicineOne);
patientPrescription.enterDosage("3");
patientPrescription.selectDosageFrequency("Twice daily");
patientPrescription.interceptPrescriptions();
cy.clickSubmitButton("Submit");
cy.wait(2000);
patientPrescription.verifyPrescription();
cy.verifyNotification("Medicine prescribed");
patientPrescription.clickReturnToDashboard();
// Verify the data's across the dashboard
Expand Down Expand Up @@ -376,7 +377,9 @@ describe("Patient Consultation in multiple combination", () => {

it("Edit created consultation to existing patient", () => {
patientPage.visitPatient("Dummy Patient Thirteen");
patientConsultationPage.interceptConsultation();
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.verifyConsultation();
patientConsultationPage.typePatientIllnessHistory("editted");
patientConsultationPage.selectPatientDiagnosis(
diagnosis5,
Expand Down
12 changes: 8 additions & 4 deletions cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason4);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -53,7 +55,9 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.typeDischargeNote(patientDeathCause);
patientDischarge.typeDoctorName(doctorName);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -76,10 +80,10 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.clickClearButton();
// select a non-registered facility and perform the discharge
patientDischarge.typeReferringFacility(referringFreetextFacility);
cy.wait(2000);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -106,12 +110,12 @@ describe("Patient Discharge based on multiple reason", () => {
patientPrescription.selectDosageFrequency("Twice daily");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.wait(2000);
cy.closeNotification();
// submit the discharge pop-up
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ describe("Patient Homepage present functionalities", () => {
.then((patientOne: string) => {
firstPatientPageOne = patientOne.trim();
pageNavigation.navigateToNextPage();
cy.wait(2000);
pageNavigation.verifyCurrentPageNumber(2);
cy.get('[data-cy="patient"]')
.first()
Expand Down
38 changes: 30 additions & 8 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const patientInvestigation = new PatientInvestigation();
const patientPrescription = new PatientPrescription();
const patientCategory = "Moderate";
const patientModifiedCategory = "Critical";
const additionalSymptoms = "Fever";
const physicalExamination = "physical examination details";
const otherExamination = "Other";
Expand Down Expand Up @@ -58,7 +59,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientPage.verifyGetPatientResponse();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Tele-medicine Log");
patientLogupdate.selectPatientCategory(patientCategory);
Expand All @@ -80,11 +83,15 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {

it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient(patientOne);
patientLogupdate.interceptConsultationBed();
patientLogupdate.clickLogupdate();
patientLogupdate.verifyConsultationBed();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed(bedOne);
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientPage.verifyGetPatientResponse();
// Only will be using random non-unique progress note fields
patientLogupdate.selectRoundType("Progress Note");
patientLogupdate.selectPatientCategory(patientCategory);
Expand Down Expand Up @@ -112,15 +119,18 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Submit the doctors log update
patientLogupdate.interceptDailyRounds();
cy.clickSubmitButton("Save and Continue");
cy.wait(2000);
patientLogupdate.verifyDailyRounds();
cy.verifyNotification("Progress Note created successfully");
cy.closeNotification();
// modify the relevant critical care log update
patientLogupdate.selectCriticalCareSection("Neurological Monitoring");
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.get("#left_pupil_light_reaction-option-FIXED").click();
patientLogupdate.interceptpatchDailyRounds();
cy.clickSubmitButton("Update Details");
patientLogupdate.verifypatchDailyRounds();
cy.verifyNotification(
"Neurological Monitoring details succesfully updated.",
);
Expand All @@ -141,6 +151,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
// verify the edit functionality
patientLogupdate.clickUpdateDetail();
patientLogupdate.verifyPatientCategory(patientCategory);
patientLogupdate.verifyRoundType("Progress Note");
patientLogupdate.selectPatientCategory(patientModifiedCategory);
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.clickSubmitButton("Continue");
Expand All @@ -156,7 +169,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.selectRoundType("Detailed Update");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.interceptDailyRounds();
cy.clickSubmitButton("Save and Continue");
patientLogupdate.verifyDailyRounds();
cy.verifyNotification("Detailed Update created successfully");
cy.closeNotification();
// Select two Section - First One is Respiratory Support
Expand Down Expand Up @@ -235,9 +250,12 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed(bedThree);
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientPage.verifyGetPatientResponse();
patientLogupdate.verifyRoundType("Brief Update");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
Expand All @@ -251,9 +269,11 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
patientConsultationPage.interceptConsultation();
cy.clickSubmitButton("Save");
cy.wait(2000);
patientConsultationPage.verifyConsultation();
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
Expand All @@ -267,11 +287,13 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.verifyRoundType("Brief Update"); // Verify the default round type
patientLogupdate.selectRoundType("Brief Update");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
Expand Down Expand Up @@ -303,10 +325,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientRhythm,
]);
patientLogupdate.clickUpdateDetail();
patientLogupdate.clearIntoElementById("#systolic");
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.clearIntoElementById("#diastolic");
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
patientLogupdate.verifyPatientCategory(patientCategory);
patientLogupdate.verifyRoundType("Brief Update");
patientLogupdate.typeSystolic(patientModifiedSystolic, true);
patientLogupdate.typeDiastolic(patientModifiedDiastolic, true);
cy.clickSubmitButton("Continue");
cy.verifyNotification("Brief Update updated successfully");
cy.contains("button", "Log Updates").click();
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/patient_spec/PatientPrescription.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ describe("Patient Medicine Administration", () => {
cy.closeNotification();
// Administer the medicine in edit form
patientPrescription.clickAdministerButton();
cy.wait(2000);
patientPrescription.enterAdministerDosage(medicineBaseDosage);
patientPrescription.enterAdministerNotes(medicineAdministerNote);
cy.clickSubmitButton("Administer Medicine");
Expand Down
Loading

0 comments on commit 5bb768f

Please sign in to comment.