Skip to content

Commit

Permalink
removed hardcorded pagination verification
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Dec 18, 2024
1 parent 266e1c5 commit a984390
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
2 changes: 0 additions & 2 deletions cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ describe("Patient Homepage present functionalities", () => {
.invoke("text")
.then((patientOne: string) => {
firstPatientPageOne = patientOne.trim();
pageNavigation.interceptPatientNavigation();
pageNavigation.navigateToNextPage();
pageNavigation.verifyPatientNavigation();
pageNavigation.verifyCurrentPageNumber(2);
cy.get('[data-cy="patient"]')
.first()
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe("Patient Creation with consultation", () => {
// allow the transfer button of a patient
patientTransfer.clickAllowPatientTransferButton();
// Verify the patient error message for the same facility
cy.awaitUrl("/patients");
cy.visit("/patients");
patientPage.createPatient();
patientPage.selectFacility(patientTransferFacility);
patientPage.patientformvisibility();
Expand Down
4 changes: 2 additions & 2 deletions cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class PatientPage {

visitPatientUrl() {
this.interceptGetPatient();
cy.visit(patient_url);
cy.awaitUrl(patient_url);
this.verifyGetPatientResponse();
}

Expand Down Expand Up @@ -240,7 +240,7 @@ export class PatientPage {
expect($dashboard).to.contain(patientName);
expect($dashboard).to.contain(phoneNumber);
expect($dashboard).to.contain(emergencyPhoneNumber);
//expect($dashboard).to.contain(yearOfBirth); //Commented out because new proposed UI does not have DOB. Can change later.
expect($dashboard).to.contain(yearOfBirth);
expect($dashboard).to.contain(bloodGroup);
expect($dashboard).to.contain(occupation);
socioeconomicStatus &&
Expand Down
11 changes: 0 additions & 11 deletions cypress/pageobject/utils/paginationHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,4 @@ export const pageNavigation = {
navigateToPreviousPage() {
cy.get("button#prev-pages").click();
},

interceptPatientNavigation() {
cy.intercept(
"GET",
"/api/v1/patient/?page=*&limit=*&is_active=True&offset=*",
).as("getPatientPage");
},

verifyPatientNavigation() {
cy.wait("@getPatientPage").its("response.statusCode").should("eq", 200);
},
};

0 comments on commit a984390

Please sign in to comment.