Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Develop to Staging v24.39.0 #8559

Merged
merged 6 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import { PatientDoctorNotes } from "../../pageobject/Patient/PatientDoctorNotes";

describe("Patient Discussion notes in the consultation page", () => {
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientDoctorNotes = new PatientDoctorNotes();
const patientName = "Dummy Patient 4";
const patientNurseNote = "Test nurse Notes";
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.loginAsDisctrictAdmin();
cy.saveLocalStorage();
});

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

it("Create a nurse note for a patient and verify both ID received the messages", () => {
// Create a doctor notes a with a district admin
patientPage.visitPatient(patientName);
patientDoctorNotes.visitDiscussionNotesPage();
cy.verifyNotification(discussionNotesSubscribeWarning);
cy.closeNotification();
// switch the switch to nurse note, as the bydefault is doctornotes
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
cy.get("p").contains("Sign Out").click();
loginPage.loginManuallyAsNurse();
loginPage.ensureLoggedIn();
cy.visit("/patients");
patientPage.visitPatient(patientName);
patientDoctorNotes.visitDiscussionNotesPage();
// verify the message is received from admin
cy.verifyNotification(discussionNotesSubscribeWarning);
cy.closeNotification();
patientDoctorNotes.verifyDiscussionMessage(patientNurseNote);
// Post a reply comment to the message
patientDoctorNotes.addDiscussionNotes(patientNurseReplyNote);
patientDoctorNotes.postDiscussionNotes();
cy.verifyNotification(discussionNotesSuccessMessage);
cy.closeNotification();
patientDoctorNotes.verifyDiscussionMessage(patientNurseReplyNote);
});

afterEach(() => {
cy.saveLocalStorage();
});
});
20 changes: 10 additions & 10 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.selectRoundType("Detailed Update");
cy.submitButton("Save and Continue");
cy.verifyNotification("Detailed Update log created successfully");
cy.verifyNotification("Detailed Update created successfully");
cy.closeNotification();
// Select two Section - First One is Respiratory Support
patientLogupdate.selectCriticalCareSection("Respiratory Support");
Expand Down Expand Up @@ -162,7 +162,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.closeNotification();
// Submit the doctors log update
cy.submitButton("Save and Continue");
cy.verifyNotification("Progress Note log created successfully");
cy.verifyNotification("Progress Note created successfully");
cy.closeNotification();
// modify the relevant critical care log update
patientLogupdate.selectCriticalCareSection("Neurological Monitoring");
Expand Down Expand Up @@ -192,7 +192,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Progress Note log updated successfully");
cy.verifyNotification("Progress Note updated successfully");
});

it("Create a new TeleIcu log update for a domicilary care patient", () => {
Expand All @@ -204,7 +204,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Telemedicine");
patientLogupdate.selectRoundType("Tele-medicine Log");
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
Expand All @@ -219,7 +219,7 @@ 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("Telemedicine log created successfully");
cy.verifyNotification("Tele-medicine Log created successfully");
});

it("Create a new Normal Log update for a domicilary care patient and edit it", () => {
Expand All @@ -245,7 +245,7 @@ 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("Brief Update log created successfully");
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
// edit the card and verify the data.
cy.contains("button", "Daily Rounds").click();
Expand All @@ -271,7 +271,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickClearButtonInElement("#diastolic");
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Brief Update log updated successfully");
cy.verifyNotification("Brief Update updated successfully");
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
Expand Down Expand Up @@ -307,7 +307,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.wait(2000);
cy.verifyNotification("Brief Update log created successfully");
cy.verifyNotification("Brief Update created successfully");
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
Expand All @@ -330,7 +330,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeRespiratory(patientRespiratory);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.verifyNotification("Brief Update log created successfully");
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
cy.verifyContentPresence("#consultation-buttons", ["9"]);
// Verify the Incomplete data will give blank info
Expand All @@ -340,7 +340,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
cy.submitButton("Save");
cy.verifyNotification("Brief Update log created successfully");
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
cy.verifyContentPresence("#consultation-buttons", ["-"]);
});
Expand Down
48 changes: 0 additions & 48 deletions cypress/e2e/patient_spec/PatientManage.cy.ts

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/pageobject/Asset/AssetFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export class AssetFilters {
facilityName: string,
assetStatus: string,
assetClass: string,
assetLocation: string
assetLocation: string,
) {
cy.contains("Advanced Filters").click();
cy.get("input[name='Facilities']")
Expand Down
4 changes: 2 additions & 2 deletions cypress/pageobject/Asset/AssetSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class AssetSearchPage {
verifyBadgeContent(expectedText: string) {
cy.get("[data-testid='Name/Serial No./QR ID']").should(
"contain",
expectedText
expectedText,
);
}

Expand Down Expand Up @@ -54,7 +54,7 @@ export class AssetSearchPage {
verifyAssetListContains(dummyCameraText: string) {
cy.get("[data-testid='created-asset-list']").should(
"contain",
dummyCameraText
dummyCameraText,
);
}
}
6 changes: 6 additions & 0 deletions cypress/pageobject/Login/LoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ class LoginPage {
cy.get("button").contains("Login").click();
}

loginManuallyAsNurse(): void {
cy.get("input[id='username']").click().type("dummynurse1");
cy.get("input[id='password']").click().type("Coronasafe@123");
cy.get("button").contains("Login").click();
}

login(username: string, password: string): void {
cy.loginByApi(username, password);
}
Expand Down
26 changes: 0 additions & 26 deletions cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,30 +110,4 @@ export class PatientConsultationPage {
);
cy.wait(3000);
}

visitShiftRequestPage() {
cy.get("#create_shift_request").click();
}

createShiftRequest() {
cy.intercept("POST", "**/api/v1/shift/").as("createShiftRequest");
cy.get("#submit").click();
cy.wait("@createShiftRequest").its("response.statusCode").should("eq", 201);
}

visitDoctorNotesPage() {
cy.get("#patient_doctor_notes").scrollIntoView();
cy.get("#patient_doctor_notes").click();
}

addDoctorsNotes(notes: string) {
cy.get("#doctor_notes_textarea").scrollIntoView();
cy.get("#doctor_notes_textarea").click().type(notes);
}

postDoctorNotes() {
cy.intercept("POST", "**/api/v1/patient/*/notes").as("postDoctorNotes");
cy.get("#add_doctor_note_button").click();
cy.wait("@postDoctorNotes").its("response.statusCode").should("eq", 201);
}
}
1 change: 1 addition & 0 deletions cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class PatientPage {
cy.get("#name").click().type(patientName);
cy.intercept("GET", "**/api/v1/consultation/**").as("getPatient");
cy.get("#patient-name-list").contains(patientName).click();
cy.wait(2000);
cy.wait("@getPatient").its("response.statusCode").should("eq", 200);
cy.get("#patient-name-consultation")
.should("be.visible")
Expand Down
29 changes: 29 additions & 0 deletions cypress/pageobject/Patient/PatientDoctorNotes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
export class PatientDoctorNotes {
visitDiscussionNotesPage() {
cy.get("#patient_discussion_notes").scrollIntoView();
cy.get("#patient_discussion_notes").click();
}

addDiscussionNotes(notes: string) {
cy.wait(2000);
cy.get("#discussion_notes_textarea").scrollIntoView();
cy.get("#discussion_notes_textarea").click().type(notes);
}

selectNurseDiscussion() {
cy.get("#patient-note-tab-Nurses").scrollIntoView();
cy.get("#patient-note-tab-Nurses").click();
}

verifyDiscussionMessage(text: string) {
cy.get("#patient-notes-list").contains(text);
}

postDiscussionNotes() {
cy.intercept("POST", "**/api/v1/patient/*/notes").as("postDiscussionNotes");
cy.get("#add_doctor_note_button").click();
cy.wait("@postDiscussionNotes")
.its("response.statusCode")
.should("eq", 201);
}
}
2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientInsurance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class PatientInsurance {
typePatientInsuranceDetail(
containerId: string,
fieldId: string,
value: string
value: string,
) {
cy.get(`#${containerId}`).within(() => {
cy.get(`#${fieldId}`).click().type(value);
Expand Down
4 changes: 2 additions & 2 deletions cypress/pageobject/Patient/PatientMedicalHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PatientMedicalHistory {
patientSymptoms4,
patientSymptoms5,
patientSymptoms6,
patientSymptoms7
patientSymptoms7,
) {
cy.get("[data-testid=patient-details]").then(($dashboard) => {
cy.url().should("include", "/facility/");
Expand All @@ -51,7 +51,7 @@ class PatientMedicalHistory {
verifyNoSymptosPresent(patientSymptoms1: string) {
cy.get("[data-testid=patient-details]").should(
"not.contain",
patientSymptoms1
patientSymptoms1,
);
}
}
Expand Down
Loading
Loading