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) {