From 42c684a24fbf19c263e16c67df4ec80012e69c4b Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:50:19 +0530 Subject: [PATCH] Modified Cypress test to include bed number selection in consultation test (#8383) * added bed number selection to the consultation test * fix the lint error * revert vite * revert vite --- cypress/e2e/patient_spec/patient_consultation.cy.ts | 1 + cypress/pageobject/Patient/PatientConsultation.ts | 4 ++++ src/Components/Common/BedSelect.tsx | 1 + 3 files changed, 6 insertions(+) diff --git a/cypress/e2e/patient_spec/patient_consultation.cy.ts b/cypress/e2e/patient_spec/patient_consultation.cy.ts index eef98a5e3ce..9c9256e11ef 100644 --- a/cypress/e2e/patient_spec/patient_consultation.cy.ts +++ b/cypress/e2e/patient_spec/patient_consultation.cy.ts @@ -95,6 +95,7 @@ describe("Patient Consultation in multiple combination", () => { cy.submitButton("Create Consultation"); // the above submit should fail as IP number is missing patientConsultationPage.typePatientNumber(patientIpNumber); + patientConsultationPage.selectBed("Dummy Bed 1"); cy.submitButton("Create Consultation"); cy.verifyNotification("Consultation created successfully"); // Below code for the prescription module only present while creating a new consultation diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index 31b1fd6cb68..dc5d9e2b2bb 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -28,6 +28,10 @@ export class PatientConsultationPage { cy.searchAndSelectOption("#referred_to", referance); } + selectBed(bedNo: string) { + cy.searchAndSelectOption("#bed", bedNo); + } + selectPatientWard(ward: string) { cy.searchAndSelectOption("#transferred_from_location", ward); } diff --git a/src/Components/Common/BedSelect.tsx b/src/Components/Common/BedSelect.tsx index 5c31055a3a4..7ed741061ee 100644 --- a/src/Components/Common/BedSelect.tsx +++ b/src/Components/Common/BedSelect.tsx @@ -65,6 +65,7 @@ export const BedSelect = (props: BedSelectProps) => { return (