From 6be5d78f71cc506f21f2c55099552287d50987ab Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 9 Oct 2024 03:15:09 +0530 Subject: [PATCH] advance filtering of the data only --- .../e2e/patient_spec/PatientHomepage.cy.ts | 23 +++++++++++++++++++ cypress/pageobject/Patient/PatientHome.ts | 4 ++++ src/Components/Patient/PatientFilter.tsx | 7 ++++++ 3 files changed, 34 insertions(+) diff --git a/cypress/e2e/patient_spec/PatientHomepage.cy.ts b/cypress/e2e/patient_spec/PatientHomepage.cy.ts index 0cf5936594d..bb07bd5581d 100644 --- a/cypress/e2e/patient_spec/PatientHomepage.cy.ts +++ b/cypress/e2e/patient_spec/PatientHomepage.cy.ts @@ -16,6 +16,29 @@ describe("Patient Homepage present functionalities", () => { cy.awaitUrl("/patients"); }); + it("Patient Details based advance filters applied in the patient tab", () => { + // Patient Filtering based on data + patientHome.clickPatientAdvanceFilters(); + cy.clickAndSelectOption("#gender-advancefilter", "Male"); + cy.clickAndSelectOption("#category-advancefilter", "Moderate"); + cy.get("#age_min").type("18"); + cy.get("#age_max").type("24"); + cy.clickAndMultiSelectOption( + "#last_consultation_admitted_bed_type_list", + "No bed assigned", + ); + cy.clickAndMultiSelectOption( + "#last_consultation__consent_types", + "No consents", + ); + cy.clickAndSelectOption("#telemedicine-advancefilter", "No"); + cy.clickAndSelectOption("#review-advancefilter", "No"); + cy.clickAndSelectOption("#medico-advancefilter", "Non-Medico-Legal"); + patientHome.clickPatientFilterApply(); + cy.get("a[data-cy='patient']").should("contain.text", "Dummy Patient"); + // Verify the presence of badges + }); + it("Export the live patient list based on a date range", () => { patientHome.clickPatientExport(); cy.verifyNotification("Please select a seven day period"); diff --git a/cypress/pageobject/Patient/PatientHome.ts b/cypress/pageobject/Patient/PatientHome.ts index d2f4efdc877..d8df033a0a8 100644 --- a/cypress/pageobject/Patient/PatientHome.ts +++ b/cypress/pageobject/Patient/PatientHome.ts @@ -41,5 +41,9 @@ class PatientHome { typePatientModifiedAfterDate(endDate: string) { cy.clickAndTypeDate("input[name='modified_date_end']", endDate); } + + clickPatientAdvanceFilters() { + cy.get("#advanced-filter").click(); + } } export default PatientHome; diff --git a/src/Components/Patient/PatientFilter.tsx b/src/Components/Patient/PatientFilter.tsx index f496a59df6d..b319bdce07f 100644 --- a/src/Components/Patient/PatientFilter.tsx +++ b/src/Components/Patient/PatientFilter.tsx @@ -292,6 +292,7 @@ export default function PatientFilter(props: any) {