From ed070996440240e0dfaaf48fbab7d77a37e84d08 Mon Sep 17 00:00:00 2001 From: rash-27 Date: Sun, 24 Mar 2024 03:52:08 +0530 Subject: [PATCH] update cypress tests --- cypress/e2e/patient_spec/patient_registration.cy.ts | 9 ++++++--- cypress/pageobject/Patient/PatientCreation.ts | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/patient_spec/patient_registration.cy.ts b/cypress/e2e/patient_spec/patient_registration.cy.ts index 6177b38526a..b973b217c67 100644 --- a/cypress/e2e/patient_spec/patient_registration.cy.ts +++ b/cypress/e2e/patient_spec/patient_registration.cy.ts @@ -82,7 +82,7 @@ describe("Patient Creation with consultation", () => { // Patient Details page patientPage.typePatientPhoneNumber(phone_number); patientPage.typePatientEmergencyNumber(emergency_phone_number); - patientPage.typePatientDateOfBirth(patientDateOfBirth); + patientPage.typePatientAge(age); patientPage.typePatientName(patientOneName); patientPage.selectPatientGender(patientOneGender); patientPage.typePatientAddress(patientOneAddress); @@ -120,7 +120,8 @@ describe("Patient Creation with consultation", () => { emergency_phone_number, yearOfBirth, patientOneBloodGroup, - patientOccupation + patientOccupation, + "Year of Birth" ); patientMedicalHistory.verifyPatientMedicalDetails( patientOnePresentHealth, @@ -148,6 +149,7 @@ describe("Patient Creation with consultation", () => { // change the gender to female and input data to related changed field cy.wait(3000); patientPage.selectPatientGender(patientOneUpdatedGender); + patientPage.typePatientDateOfBirth(patientDateOfBirth); patientPage.clickPatientAntenatalStatusYes(); patientPage.selectPatientBloodGroup(patientOneUpdatedBloodGroup); // Edit the patient consultation , select none medical history and multiple health ID @@ -208,7 +210,8 @@ describe("Patient Creation with consultation", () => { emergency_phone_number, yearOfBirth, patientOneUpdatedBloodGroup, - patientOccupation + patientOccupation, + "Date of Birth" ); // Verify No medical history patientMedicalHistory.verifyNoSymptosPresent("Diabetes"); diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts index 97f01baee06..e82a11facf2 100644 --- a/cypress/pageobject/Patient/PatientCreation.ts +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -46,14 +46,15 @@ export class PatientPage { } typePatientDateOfBirth(dateOfBirth: string) { + cy.clickAndSelectOption("#ageOrDob-selector", "D.O.B"); cy.get("#date_of_birth").scrollIntoView(); cy.get("#date_of_birth").should("be.visible").click(); cy.get("#date-input").click().type(dateOfBirth); } - typePatientAge(age: string) { + typePatientAge(age: number) { cy.clickAndSelectOption("#ageOrDob-selector", "Age"); cy.submitButton("Confirm"); - cy.get("#age-div").click().type(age); + cy.get("#age").clear().type(age); } typePatientName(patientName: string) { @@ -143,7 +144,8 @@ export class PatientPage { emergencyPhoneNumber, yearOfBirth, bloodGroup, - occupation + occupation, + DobOrAge ) { cy.url().should("include", "/facility/"); cy.get("[data-testid=patient-dashboard]").then(($dashboard) => { @@ -155,6 +157,7 @@ export class PatientPage { expect($dashboard).to.contain(yearOfBirth); expect($dashboard).to.contain(bloodGroup); expect($dashboard).to.contain(occupation); + expect($dashboard).to.contain(DobOrAge); }); }