Skip to content

Commit

Permalink
final test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrin2005 committed Dec 28, 2024
1 parent 564a461 commit 18fcf32
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 11 additions & 2 deletions cypress/e2e/patient_spec/PatientInvestigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,25 @@ describe("Patient Investigation Creation from Patient consultation page", () =>

it("Create a investigation for a patient and verify its reflection", () => {
patientPage.visitPatient(patientName);
cy.url().should("include", "/patient");

patientInvestigation.clickInvestigationTab();
cy.get("#consultation_tab_nav").should("exist");

patientInvestigation.clickLogLabResults();
cy.get("#log-lab-results").should("exist");

patientInvestigation.selectInvestigationOption([
"Haematology",
"Urine Test",
]);
cy.clickSubmitButton("Save Investigation");

cy.get("button")
.contains("Save Investigation")
.should("be.visible")
.click();
cy.verifyNotification("Please Enter at least one value");
cy.closeNotification();
// Temporary workflow for investigation since we dont have dummy data and moving away from existing module
});

afterEach(() => {
Expand Down
10 changes: 8 additions & 2 deletions cypress/pageobject/Patient/PatientInvestigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ class PatientInvestigation {
}

selectInvestigationOption(options: string[]) {
cy.get("#investigation-select").click();
// Click to open dropdown
cy.get("#investigation-select").should("exist").click();

// Select each option
options.forEach((option) => {
cy.get("[role='option']").contains(option).click();
cy.get("[role='option']").contains(option).should("be.visible").click();
});

// Click outside to close dropdown (if needed)
cy.get("body").click(0, 0);
}

clickLogLabResults() {
Expand Down

0 comments on commit 18fcf32

Please sign in to comment.