Skip to content

Commit

Permalink
Merge branch 'develop' into rithviknishad/fix/blood-pressure-range-an…
Browse files Browse the repository at this point in the history
…d-recordable
  • Loading branch information
nihal467 committed Sep 13, 2024
2 parents 7cdc22a + d1bc4c8 commit d925879
Show file tree
Hide file tree
Showing 10 changed files with 301 additions and 150 deletions.
105 changes: 101 additions & 4 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const patientSpo2 = "15";
const patientRhythmType = "Regular";
const patientRhythm = "Normal Rhythm";
const patientEtco2 = "50";
const patientOxygenFlowRate = "40";
const patientBloodSugar = "52";
const patientInsulinDosage = "56";
const patientFluidBalance = "500";
const patientNetBalance = "1000";

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand All @@ -39,6 +45,88 @@ 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");
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed("Dummy Bed 2");
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.selectRoundType("Detailed Update");
cy.submitButton("Save and Continue");
cy.verifyNotification("Detailed Update log created successfully");
cy.closeNotification();
// Select two Section - First One is Respiratory Support
patientLogupdate.selectCriticalCareSection("Respiratory Support");
patientLogupdate.selectNoBilateralAirFlow();
patientLogupdate.typeEtco2(patientEtco2);
patientLogupdate.selectOxygenSupport();
patientLogupdate.typeOxygenFlowRate(patientOxygenFlowRate);
patientLogupdate.typeVentilatorSpo2(patientSpo2);
cy.submitButton("Update Details");
cy.verifyNotification("Respiratory Support details succesfully updated.");
cy.closeNotification();
// Second Section will be Blood Sugar
patientLogupdate.selectCriticalCareSection("Blood Sugar");
patientLogupdate.typeBloodSugar(patientBloodSugar);
patientLogupdate.typeInsulinDosage(patientInsulinDosage);
cy.get("#insulin_intake_frequency-option-BD").click();
cy.submitButton("Update Details");
cy.verifyNotification("Blood Sugar details succesfully updated.");
// Submit the form and verify the details
cy.submitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
patientEtco2,
patientOxygenFlowRate,
]);
cy.verifyContentPresence("#blood-sugar", [
patientBloodSugar,
patientInsulinDosage,
]);
// Go back and edit the data on a third section
patientLogupdate.clickGoBackConsultation();
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateUpdateLog(
"#dailyround-entry",
patientCategory,
);
patientLogupdate.selectCriticalCareSection("Dialysis");
patientLogupdate.typeFluidBalance(patientFluidBalance);
patientLogupdate.typeNetBalance(patientNetBalance);
cy.submitButton("Update Details");
cy.verifyNotification("Dialysis details succesfully updated.");
cy.closeNotification();
cy.submitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
//Reverify the editted and newly added data
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
patientEtco2,
patientOxygenFlowRate,
]);
cy.verifyContentPresence("#blood-sugar", [
patientBloodSugar,
patientInsulinDosage,
]);
cy.verifyContentPresence("#dialysis", [
patientFluidBalance,
patientNetBalance,
]);
});

it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient("Dummy Patient 12");
patientLogupdate.clickLogupdate();
Expand Down Expand Up @@ -77,7 +165,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Progress Note log created successfully");
cy.closeNotification();
// modify the relevant critical care log update
cy.contains("button", "Neurological Monitoring").click();
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");
Expand All @@ -91,7 +179,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
patientTemperature,
Expand Down Expand Up @@ -158,7 +249,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.closeNotification();
// edit the card and verify the data.
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
patientDiastolic,
Expand All @@ -179,7 +273,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.submitButton("Continue");
cy.verifyNotification("Brief Update log updated successfully");
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientModifiedDiastolic,
patientModifiedSystolic,
Expand Down
58 changes: 32 additions & 26 deletions cypress/e2e/users_spec/user_homepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ import { UserPage } from "../../pageobject/Users/UserSearch";

describe("User Homepage", () => {
const userPage = new UserPage();
const usernameToTest = "devdoctor";
const currentuser = "devdistrictadmin";
const loginPage = new LoginPage();
const phone_number = "9876543219";
const alt_phone_number = "9876543219";
const currentuser = "devdistrictadmin";
const firstName = "Dummy";
const lastName = "Nurse";
const role = "Nurse";
const state = "Kerala";
const district = "Ernakulam";
const phoneNumber = "8878825662";
const altPhoneNumber = "8878825662";
const homeFacility = "Dummy Facility 40";
const nurseUserName = "dummynurse1";
const doctorUserName = "devdoctor";

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand All @@ -22,33 +29,32 @@ describe("User Homepage", () => {

it("User advance filter functionality", () => {
userPage.clickAdvancedFilters();
userPage.typeInFirstName("Dev");
userPage.typeInLastName("Doctor");
userPage.selectRole("Doctor");
userPage.selectState("Kerala");
userPage.selectDistrict("Ernakulam");
userPage.typeInPhoneNumber(phone_number);
userPage.typeInAltPhoneNumber(alt_phone_number);
userPage.selectHomeFacility("Dummy Facility 40");
userPage.typeInFirstName(firstName);
userPage.typeInLastName(lastName);
userPage.selectRole(role);
userPage.selectState(state);
userPage.selectDistrict(district);
userPage.typeInPhoneNumber(phoneNumber);
userPage.typeInAltPhoneNumber(altPhoneNumber);
userPage.selectHomeFacility(homeFacility);
userPage.applyFilter();
userPage.verifyUrlafteradvancefilter();
userPage.checkUsernameText(usernameToTest);
userPage.verifyDataTestIdText("First Name", "First Name: Dev");
userPage.verifyDataTestIdText("Last Name", "Last Name: Doctor");
userPage.checkUsernameText(nurseUserName);
// Verify the badges related to the data
userPage.verifyDataTestIdText("First Name", `First Name: ${firstName}`);
userPage.verifyDataTestIdText("Last Name", `Last Name: ${lastName}`);
userPage.verifyDataTestIdText(
"Phone Number",
"Phone Number: +919876543219",
`Phone Number: +91${phoneNumber}`,
);
userPage.verifyDataTestIdText(
"WhatsApp no.",
"WhatsApp no.: +919876543219",
`WhatsApp no.: +91${altPhoneNumber}`,
);
userPage.verifyDataTestIdText("Role", "Role: Doctor");
userPage.verifyDataTestIdText("Role", `Role: ${role}`);
userPage.verifyDataTestIdText(
"Home Facility",
"Home Facility: Dummy Facility 40",
`Home Facility: ${homeFacility}`,
);
userPage.verifyDataTestIdText("District", "District: Ernakulam");
userPage.clearFilters();
userPage.verifyDataTestIdNotVisible("First Name");
userPage.verifyDataTestIdNotVisible("Last Name");
Expand All @@ -61,14 +67,14 @@ describe("User Homepage", () => {

it("Search by username", () => {
userPage.checkSearchInputVisibility();
userPage.typeInSearchInput(usernameToTest);
userPage.checkUrlForUsername(usernameToTest);
userPage.checkUsernameText(usernameToTest);
userPage.typeInSearchInput(doctorUserName);
userPage.checkUrlForUsername(doctorUserName);
userPage.checkUsernameText(doctorUserName);
userPage.checkUsernameBadgeVisibility(true);
userPage.clearSearchInput();
userPage.checkUsernameBadgeVisibility(false);
userPage.typeInSearchInput(usernameToTest);
userPage.checkUsernameText(usernameToTest);
userPage.typeInSearchInput(doctorUserName);
userPage.checkUsernameText(doctorUserName);
userPage.clickRemoveIcon();
userPage.checkUsernameBadgeVisibility(false);
userPage.checkUsernameText(currentuser);
Expand Down
57 changes: 56 additions & 1 deletion cypress/pageobject/Patient/PatientLogupdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,20 @@ class PatientLogupdate {
cy.get("#rhythm_detail").click().type(rhythm);
}

clickLogupdateCard(element, patientCategory) {
clickLogUpdateViewDetails(element, patientCategory) {
cy.get(element).scrollIntoView();
cy.verifyContentPresence(element, [patientCategory]);
cy.get(element).first().contains("View Details").click();
cy.wait(3000);
}

clickLogUpdateUpdateLog(element, patientCategory) {
cy.get(element).scrollIntoView();
cy.verifyContentPresence(element, [patientCategory]);
cy.get(element).first().contains("Update Log").click();
cy.wait(3000);
}

clickUpdateDetail() {
cy.verifyAndClickElement("#consultation-preview", "Update Details");
cy.wait(3000);
Expand All @@ -90,5 +97,53 @@ class PatientLogupdate {
cy.get("#consultation_tab_nav").scrollIntoView();
cy.verifyAndClickElement("#consultation_tab_nav", "Vitals");
}

selectNoBilateralAirFlow() {
cy.get("#bilateral_air_entry-option-false").click();
}

typeEtco2(etco2: string) {
cy.get("#etco2-range-input").type(etco2);
}

selectOxygenSupport() {
cy.get("#respiratory_support-option-OXYGEN_SUPPORT").click();
}

selectNonBreathingModality() {
cy.get("#ventilator_oxygen_modality-option-NON_REBREATHING_MASK").click();
}

typeOxygenFlowRate(flowRate: string) {
cy.get("#oxygen_flow_rate-range-input").type(flowRate);
}

typeVentilatorSpo2(spo2: string) {
cy.get("#ventilator_spo2-range-input").type(spo2);
}

selectCriticalCareSection(sectionName: string) {
cy.contains("button", sectionName).click();
}

typeBloodSugar(bloodSugar: string) {
cy.get("#blood_sugar_level-range-input").type(bloodSugar);
}

typeInsulinDosage(insulinDosage: string) {
cy.get("#insulin_intake_dose-range-input").type(insulinDosage);
}

clickGoBackConsultation() {
cy.get("#back-to-consultation").click();
}

typeFluidBalance(fluid: string) {
cy.get("#dialysis_fluid_balance-range-input").type(fluid);
}

typeNetBalance(netBalance: string) {
cy.get("#dialysis_net_balance-range-input").type(netBalance);
}
}
export default PatientLogupdate;
10 changes: 0 additions & 10 deletions cypress/pageobject/Users/UserSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ export class UserPage {
cy.url().should("include", `username=${username}`);
}

verifyUrlafteradvancefilter() {
cy.url()
.should("include", "first_name=Dev")
.and("include", "last_name=Doctor")
.and("include", "phone_number=%2B919876543219")
.and("include", "alt_phone_number=%2B919876543219")
.and("include", "user_type=Doctor")
.and("include", "district=7");
}

checkUsernameText(username: string) {
cy.get(this.usernameText).should("have.text", username);
}
Expand Down
Loading

0 comments on commit d925879

Please sign in to comment.