Skip to content

Commit

Permalink
update cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rash-27 committed Mar 23, 2024
1 parent 56f4e11 commit ed07099
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions cypress/e2e/patient_spec/patient_registration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -120,7 +120,8 @@ describe("Patient Creation with consultation", () => {
emergency_phone_number,
yearOfBirth,
patientOneBloodGroup,
patientOccupation
patientOccupation,
"Year of Birth"
);
patientMedicalHistory.verifyPatientMedicalDetails(
patientOnePresentHealth,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down
9 changes: 6 additions & 3 deletions cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) => {
Expand All @@ -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);
});
}

Expand Down

0 comments on commit ed07099

Please sign in to comment.