Skip to content

Commit

Permalink
Merge branch 'develop' into sainak/fix/remove-cover-tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak authored Sep 24, 2024
2 parents 7105ddd + 7878cd6 commit d97d090
Show file tree
Hide file tree
Showing 46 changed files with 1,116 additions and 363 deletions.
56 changes: 56 additions & 0 deletions cypress/e2e/patient_spec/PatientBedManagement.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";

describe("Patient swtich bed functionality", () => {
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientLogupdate = new PatientLogupdate();
const patientConsultationPage = new PatientConsultationPage();
const switchBedOne = "Dummy Bed 4";
const switchBedTwo = "Dummy Bed 1";
const switchBedThree = "Dummy Bed 3";
const switchPatientOne = "Dummy Patient 6";
const switchPatientTwo = "Dummy Patient 7";

before(() => {
loginPage.loginAsDisctrictAdmin();
cy.saveLocalStorage();
});

beforeEach(() => {
cy.restoreLocalStorage();
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/patients");
});

it("Assign a bed for a admitted patient from update consultation page", () => {
// Open the update consultation page and assign a bed
patientPage.visitPatient(switchPatientTwo);
patientConsultationPage.clickEditConsultationButton();
patientLogupdate.selectBed(switchBedThree);
// verify the notification
cy.verifyNotification("Bed allocated successfully");
});

it("Assign a bed for a admitted patient from patient dashboard", () => {
// Assign a bed to a patient
patientPage.visitPatient(switchPatientOne);
patientLogupdate.clickSwitchBed();
patientLogupdate.selectBed(switchBedOne);
cy.verifyNotification("Bed allocated successfully");
// Clear the bed and reassign
patientLogupdate.clickSwitchBed();
cy.get("#clear-button").click();
patientLogupdate.selectBed(switchBedTwo);
cy.verifyNotification("Bed allocated successfully");
// verify the card is reflected
patientLogupdate.clickSwitchBed();
cy.verifyContentPresence("#previousbed-list", [switchBedOne, switchBedTwo]);
});

afterEach(() => {
cy.saveLocalStorage();
});
});
42 changes: 42 additions & 0 deletions cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import PatientHome from "../../pageobject/Patient/PatientHome";

describe("Patient Homepage present functionalities", () => {
const loginPage = new LoginPage();
const patientHome = new PatientHome();

before(() => {
loginPage.loginAsDisctrictAdmin();
cy.saveLocalStorage();
});

beforeEach(() => {
cy.restoreLocalStorage();
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/patients");
});

it("Verify the functionality of the patient tab pagination", () => {
let firstPatientPageOne: string;
cy.get('[data-cy="patient"]')
.first()
.invoke("text")
.then((patientOne: string) => {
firstPatientPageOne = patientOne.trim();
patientHome.clickNextPage();
patientHome.verifySecondPageUrl();
cy.get('[data-cy="patient"]')
.first()
.invoke("text")
.then((patientTwo: string) => {
const firstPatientPageTwo = patientTwo.trim();
expect(firstPatientPageOne).not.to.eq(firstPatientPageTwo);
patientHome.clickPreviousPage();
});
});
});

afterEach(() => {
cy.saveLocalStorage();
});
});
224 changes: 115 additions & 109 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const patientLogupdate = new PatientLogupdate();
const patientInvestigation = new PatientInvestigation();
const patientPrescription = new PatientPrescription();
const domicilaryPatient = "Dummy Patient 11";
const patientCategory = "Moderate";
const additionalSymptoms = "Fever";
const physicalExamination = "physical examination details";
Expand All @@ -33,6 +32,13 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const patientInsulinDosage = "56";
const patientFluidBalance = "500";
const patientNetBalance = "1000";
const patientOne = "Dummy Patient 9";
const bedOne = "Dummy Bed 5";
const patientTwo = "Dummy Patient 10";
const bedTwo = "Dummy Bed 2";
const patientThree = "Dummy Patient 8";
const bedThree = "Dummy Bed 3";
const domicilaryPatient = "Dummy Patient 11";

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand All @@ -45,15 +51,110 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.awaitUrl("/patients");
});

it("Create a basic critical care log update for a admitted patient and edit it", () => {
patientPage.visitPatient("Dummy Patient 10");
it("Create a new TeleIcu log update for a domicilary care patient", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Tele-medicine Log");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
patientLogupdate.typeTemperature(patientTemperature);
patientLogupdate.typeRespiratory(patientRespiratory);
patientLogupdate.typeSpo2(patientSpo2);
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.verifyNotification("Tele-medicine Log created successfully");
});

it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient(patientOne);
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed("Dummy Bed 2");
patientLogupdate.selectBed(bedOne);
cy.closeNotification();
patientLogupdate.clickLogupdate();
// Only will be using random non-unique progress note fields
patientLogupdate.selectRoundType("Progress Note");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.typeTemperature(patientTemperature);
// add diagnosis
patientConsultationPage.selectPatientDiagnosis(
"1A06",
"add-icd11-diagnosis-as-differential",
);
// add a investigation for the patient
patientInvestigation.clickAddInvestigation();
patientInvestigation.selectInvestigation("Vitals (GROUP)");
patientInvestigation.clickInvestigationCheckbox();
patientInvestigation.selectInvestigationFrequency("6");
// add a medicine for the patient
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Submit the doctors log update
cy.submitButton("Save and Continue");
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();
cy.submitButton("Update Details");
cy.verifyNotification(
"Neurological Monitoring details succesfully updated.",
);
cy.closeNotification();
// Final Submission of the form
cy.submitButton("Complete");
cy.verifyNotification("Progress Note Log Update filed successfully");
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
patientTemperature,
]);
// verify the edit functionality
patientLogupdate.clickUpdateDetail();
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Progress Note updated successfully");
});

it("Create a basic critical care log update for a admitted patient and edit it", () => {
patientPage.visitPatient(patientTwo);
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed(bedTwo);
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.selectRoundType("Detailed Update");
patientLogupdate.selectPatientCategory(patientCategory);
cy.submitButton("Save and Continue");
cy.verifyNotification("Detailed Update created successfully");
cy.closeNotification();
Expand Down Expand Up @@ -127,88 +228,19 @@ 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("Dummy Patient 12");
it("Create a new Normal update for a admission patient and verify its reflection in cards", () => {
patientPage.visitPatient(patientThree);
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed("Dummy Bed 4");
cy.closeNotification();
patientLogupdate.clickLogupdate();
// Only will be using random non-unique progress note fields
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.selectRoundType("Progress Note");
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.typeTemperature(patientTemperature);
// add diagnosis
patientConsultationPage.selectPatientDiagnosis(
"1A06",
"add-icd11-diagnosis-as-differential",
);
// add a investigation for the patient
patientInvestigation.clickAddInvestigation();
patientInvestigation.selectInvestigation("Vitals (GROUP)");
patientInvestigation.clickInvestigationCheckbox();
patientInvestigation.selectInvestigationFrequency("6");
// add a medicine for the patient
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Submit the doctors log update
cy.submitButton("Save and Continue");
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();
cy.submitButton("Update Details");
cy.verifyNotification(
"Neurological Monitoring details succesfully updated.",
);
cy.closeNotification();
// Final Submission of the form
cy.submitButton("Complete");
cy.verifyNotification("Progress Note Log Update filed successfully");
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
patientTemperature,
]);
// verify the edit functionality
patientLogupdate.clickUpdateDetail();
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Progress Note updated successfully");
});

it("Create a new TeleIcu log update for a domicilary care patient", () => {
patientPage.visitPatient("Dummy Patient 11");
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
patientLogupdate.selectBed(bedThree);
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Tele-medicine Log");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.clickAddSymptom();
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
Expand All @@ -219,7 +251,11 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.verifyNotification("Tele-medicine Log created successfully");
cy.wait(2000);
cy.verifyNotification("Brief Update created successfully");
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
});

it("Create a new Normal Log update for a domicilary care patient and edit it", () => {
Expand Down Expand Up @@ -283,36 +319,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
});

it("Create a new Normal update for a admission patient and verify its reflection in cards", () => {
patientPage.visitPatient("Dummy Patient 13");
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed("Dummy Bed 6");
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.clickAddSymptom();
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
patientLogupdate.typeTemperature(patientTemperature);
patientLogupdate.typeRespiratory(patientRespiratory);
patientLogupdate.typeSpo2(patientSpo2);
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.wait(2000);
cy.verifyNotification("Brief Update created successfully");
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
});

it("Create a Normal Log update to verify MEWS Score Functionality", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
Expand Down
14 changes: 14 additions & 0 deletions cypress/pageobject/Patient/PatientHome.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class PatientHome {
clickNextPage() {
cy.get("#next-pages").click();
}

verifySecondPageUrl() {
cy.url().should("include", "/patients?page=2");
}

clickPreviousPage() {
cy.get("#prev-pages").click();
}
}
export default PatientHome;
Loading

0 comments on commit d97d090

Please sign in to comment.