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

New Cypress Test | Normal Log Update for Admission and Non- Admission Patients | Patient Consultation Module #7398

Closed
wants to merge 1 commit into from
Closed
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
108 changes: 108 additions & 0 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";

describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const loginPage = new LoginPage();
const patientConsultationPage = new PatientConsultationPage();

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

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

it("Create a new log normal update for a domicilary care patient", () => {
cy.get("#name").type("Dummy Patient 11");
cy.get("[data-cy='patient']").contains("Dummy Patient 11").click();
patientConsultationPage.clickEditConsultationButton();
cy.wait(5000);
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.get("#log-update").contains("Log Update").click();
cy.get("#physical_examination_info")
.click()
.type("Physical Examination Info");
cy.clickAndSelectOption("#patient_category", "Abnormal");
cy.get("#other_details").click().type("Physical Examination Info");
cy.clickAndMultiSelectOption("#additional_symptoms", "ASYMPTOMATIC");
cy.searchAndSelectOption("#systolic", "119");
cy.searchAndSelectOption("#diastolic", "150");
cy.searchAndSelectOption("#pulse", "152");
cy.searchAndSelectOption("#temperature", "95.6");
cy.searchAndSelectOption("#resp", "150");
cy.searchAndSelectOption("#ventilator_spo2", "15");
cy.clickAndSelectOption("#rhythm", "Regular");
cy.get("#rhythm_detail").click().type("Physical Examination Info");
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Consultation Updates details created successfully");
});

it("Create a new log teleicu update for a domicilary care patient", () => {
cy.get("#name").type("Dummy Patient 11");
cy.get("[data-cy='patient']").contains("Dummy Patient 11").click();
patientConsultationPage.clickEditConsultationButton();
cy.wait(5000);
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.get("#log-update").contains("Log Update").click();
cy.get("#physical_examination_info")
.click()
.type("Physical Examination Info");
cy.clickAndSelectOption("#patient_category", "Abnormal");
cy.clickAndSelectOption("#rounds_type", "Telemedicine");
cy.get("#other_details").click().type("Physical Examination Info");
cy.clickAndMultiSelectOption("#additional_symptoms", "ASYMPTOMATIC");
cy.searchAndSelectOption("#systolic", "119");
cy.searchAndSelectOption("#diastolic", "150");
cy.searchAndSelectOption("#pulse", "152");
cy.searchAndSelectOption("#temperature", "95.6");
cy.searchAndSelectOption("#resp", "150");
cy.searchAndSelectOption("#ventilator_spo2", "15");
cy.clickAndSelectOption("#rhythm", "Regular");
cy.get("#rhythm_detail").click().type("Physical Examination Info");
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Consultation Updates details created successfully");
});

it("Create a new log normal update for a admission patient", () => {
cy.get("#name").type("Dummy Patient 13");
cy.get("[data-cy='patient']").contains("Dummy Patient 13").click();
cy.get("#log-update").contains("Log Update").click();
cy.verifyNotification("Please assign a bed to the patient");
cy.searchAndSelectOption("input[name='bed']", "Dummy Bed 6");
cy.submitButton("Move to bed");
cy.get("#log-update").contains("Log Update").click();
cy.closeNotification();
cy.clickAndSelectOption("#patient_category", "Abnormal");
cy.get("#physical_examination_info")
.click()
.type("Physical Examination Info");
cy.get("#other_details").click().type("Physical Examination Info");
cy.clickAndMultiSelectOption("#additional_symptoms", "ASYMPTOMATIC");
cy.searchAndSelectOption("#systolic", "119");
cy.searchAndSelectOption("#diastolic", "150");
cy.searchAndSelectOption("#pulse", "152");
cy.searchAndSelectOption("#temperature", "95.6");
cy.searchAndSelectOption("#resp", "150");
cy.searchAndSelectOption("#ventilator_spo2", "15");
cy.clickAndSelectOption("#rhythm", "Regular");
cy.get("#rhythm_detail").click().type("Physical Examination Info");
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Consultation Updates details created successfully");
});

afterEach(() => {
cy.saveLocalStorage();
});
});
22 changes: 6 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"@typescript-eslint/parser": "^5.61.0",
"@vitejs/plugin-react-swc": "^3.6.0",
"autoprefixer": "^10.4.14",
"cypress": "^13.5.0",
"cypress": "^13.6.6",
"cypress-localstorage-commands": "^2.2.3",
"cypress-split": "^1.20.1",
"eslint": "^8.44.0",
Expand Down
5 changes: 4 additions & 1 deletion src/Components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,10 @@ export default function PatientInfoCard(props: {
{patient.is_active &&
consultation?.id &&
!consultation?.discharge_date && (
<div className="h-10 min-h-[40px] w-full min-w-[170px] lg:w-auto">
<div
className="h-10 min-h-[40px] w-full min-w-[170px] lg:w-auto"
id="log-update"
>
<ButtonV2
variant={
!(consultation?.facility !== patient.facility) &&
Expand Down
Loading