diff --git a/cypress/e2e/patient_spec/patient_logupdate.cy.ts b/cypress/e2e/patient_spec/patient_logupdate.cy.ts new file mode 100644 index 00000000000..abff3089445 --- /dev/null +++ b/cypress/e2e/patient_spec/patient_logupdate.cy.ts @@ -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(); + }); +}); diff --git a/package-lock.json b/package-lock.json index 497be83b96f..d17d617306f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,7 +87,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", @@ -8849,21 +8849,20 @@ "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/cypress": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.0.tgz", - "integrity": "sha512-oh6U7h9w8wwHfzNDJQ6wVcAeXu31DlIYlNOBvfd6U4CcB8oe4akawQmH+QJVOMZlM42eBoCne015+svVqdwdRQ==", + "version": "13.6.6", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.6.tgz", + "integrity": "sha512-S+2S9S94611hXimH9a3EAYt81QM913ZVA03pUmGDfLTFa5gyp85NJ8dJGSlEAEmyRsYkioS1TtnWtbv/Fzt11A==", "dev": true, "hasInstallScript": true, "dependencies": { "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^18.17.5", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", "blob-util": "^2.0.2", "bluebird": "^3.7.2", - "buffer": "^5.6.0", + "buffer": "^5.7.1", "cachedir": "^2.3.0", "chalk": "^4.1.0", "check-more-types": "^2.24.0", @@ -8881,7 +8880,7 @@ "figures": "^3.2.0", "fs-extra": "^9.1.0", "getos": "^3.2.1", - "is-ci": "^3.0.0", + "is-ci": "^3.0.1", "is-installed-globally": "~0.4.0", "lazy-ass": "^1.6.0", "listr2": "^3.8.3", @@ -8937,15 +8936,6 @@ "cypress-split-preview": "bin/preview.js" } }, - "node_modules/cypress/node_modules/@types/node": { - "version": "18.18.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", - "integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, "node_modules/cypress/node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", diff --git a/package.json b/package.json index 7c5ab561332..de7ddf87c4c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx index 1d9be149be6..e91ce645626 100644 --- a/src/Components/Patient/PatientInfoCard.tsx +++ b/src/Components/Patient/PatientInfoCard.tsx @@ -492,7 +492,10 @@ export default function PatientInfoCard(props: { {patient.is_active && consultation?.id && !consultation?.discharge_date && ( -