Skip to content

Commit

Permalink
cypress test to create progress note and edit it (#8479)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Sep 4, 2024
1 parent 6db5703 commit 83c56f0
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 8 deletions.
77 changes: 73 additions & 4 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate";
import PatientInvestigation from "../../pageobject/Patient/PatientInvestigation";
import PatientPrescription from "../../pageobject/Patient/PatientPrescription";

describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const loginPage = new LoginPage();
const patientConsultationPage = new PatientConsultationPage();
const patientPage = new PatientPage();
const patientLogupdate = new PatientLogupdate();
const patientInvestigation = new PatientInvestigation();
const patientPrescription = new PatientPrescription();
const domicilaryPatient = "Dummy Patient 11";
const patientCategory = "Moderate";
const additionalSymptoms = "Fever";
Expand Down Expand Up @@ -36,7 +40,72 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.awaitUrl("/patients");
});

it("Create a new log teleicu update for a domicilary care patient and verify the copy previous value function", () => {
it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient("Dummy Patient 12");
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 log created successfully");
cy.closeNotification();
// modify the relevant critical care log update
cy.contains("button", "Neurological Monitoring").click();
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.clickLogupdateCard("#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 log 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");
Expand All @@ -63,7 +132,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Telemedicine log created successfully");
});

it("Create a new log normal update for a domicilary care patient and edit it", () => {
it("Create a new Normal Log update for a domicilary care patient and edit it", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
Expand Down Expand Up @@ -118,7 +187,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
});

it("Create a new log normal update for a admission patient and verify its reflection in cards", () => {
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");
Expand Down Expand Up @@ -148,7 +217,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
});

it("Create a normal log update to verify MEWS Score Functionality", () => {
it("Create a Normal Log update to verify MEWS Score Functionality", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class PatientConsultationPage {
cy.searchAndSelectOption("#icd11-search", icdCode);
cy.get("#diagnosis-list")
.contains("Add as")
.focus()
.scrollIntoView()
.click()
.then(() => {
cy.get(`#${statusId}`).click();
Expand Down
5 changes: 2 additions & 3 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,10 @@ export const DailyRounds = (props: any) => {
{state.form.rounds_type === "DOCTORS_LOG" && (
<>
<div className="flex flex-col gap-10 divide-y-2 divide-dashed divide-secondary-600 border-t-2 border-dashed border-secondary-600 pt-6 md:col-span-2">
<div>
<div id="diagnosis-list">
<h3 className="mb-4 mt-8 text-lg font-semibold">
{t("diagnosis")}
</h3>
{/* */}
{diagnoses ? (
<EditDiagnosesBuilder
value={diagnoses}
Expand All @@ -798,7 +797,7 @@ export const DailyRounds = (props: any) => {
</div>
)}
</div>
<div>
<div id="investigation">
<h3 className="my-4 text-lg font-semibold">
{t("investigations")}
</h3>
Expand Down

0 comments on commit 83c56f0

Please sign in to comment.