From 2d08896504f0b4a9abaf1621cfe0a0f7edb143bb Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 20 Nov 2024 18:47:24 +0530 Subject: [PATCH] Refactored the pagination component in cypress (#9163) --- cypress/e2e/assets_spec/AssetHomepage.cy.ts | 11 +++++------ .../e2e/facility_spec/FacilityHomepage.cy.ts | 12 ++++++------ .../e2e/facility_spec/FacilityLocation.cy.ts | 7 +++---- cypress/e2e/hcx_spec/HcxClaims.cy.ts | 2 +- .../patient_spec/PatientBedManagement.cy.ts | 4 ++-- .../PatientConsultationCreation.cy.ts | 2 +- .../PatientConsultationDischarge.cy.ts | 8 ++++---- .../patient_spec/PatientDoctorConnect.cy.ts | 4 ++-- .../e2e/patient_spec/PatientDoctorNotes.cy.ts | 2 +- cypress/e2e/patient_spec/PatientFileUpload.ts | 6 +++--- .../e2e/patient_spec/PatientHomepage.cy.ts | 7 ++++--- .../patient_spec/PatientInvestigation.cy.ts | 2 +- .../e2e/patient_spec/PatientLogUpdate.cy.ts | 8 ++++---- .../patient_spec/PatientPrescription.cy.ts | 8 ++++---- .../patient_spec/PatientRegistration.cy.ts | 4 ++-- .../sample_test_spec/SampleTestRequest.cy.ts | 2 +- cypress/e2e/users_spec/UsersHomepage.cy.ts | 11 ++++++----- cypress/pageobject/Asset/AssetPagination.ts | 19 ------------------- cypress/pageobject/Patient/PatientHome.ts | 12 ------------ cypress/pageobject/Users/UserSearch.ts | 12 ------------ cypress/pageobject/utils/paginationHelpers.ts | 13 +++++++++++++ 21 files changed, 63 insertions(+), 93 deletions(-) create mode 100644 cypress/pageobject/utils/paginationHelpers.ts diff --git a/cypress/e2e/assets_spec/AssetHomepage.cy.ts b/cypress/e2e/assets_spec/AssetHomepage.cy.ts index 67ad50e832f..dfb3249c243 100644 --- a/cypress/e2e/assets_spec/AssetHomepage.cy.ts +++ b/cypress/e2e/assets_spec/AssetHomepage.cy.ts @@ -1,9 +1,9 @@ import { advanceFilters } from "pageobject/utils/advanceFilterHelpers"; +import { pageNavigation } from "pageobject/utils/paginationHelpers"; import { v4 as uuidv4 } from "uuid"; import { AssetPage } from "../../pageobject/Asset/AssetCreation"; import { AssetFilters } from "../../pageobject/Asset/AssetFilters"; -import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan"; import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; import LoginPage from "../../pageobject/Login/LoginPage"; @@ -11,7 +11,6 @@ import LoginPage from "../../pageobject/Login/LoginPage"; describe("Asset Tab", () => { const assetSearchPage = new AssetSearchPage(); const assetQRScanPage = new AssetQRScanPage(); - const assetPagination = new AssetPagination(); const assetFilters = new AssetFilters(); const assetPage = new AssetPage(); const loginPage = new LoginPage(); @@ -79,10 +78,10 @@ describe("Asset Tab", () => { // Verify the pagination in the page it("Next/Previous Page", () => { - assetPagination.navigateToNextPage(); - assetPagination.verifyNextUrl(); - assetPagination.navigateToPreviousPage(); - assetPagination.verifyPreviousUrl(); + pageNavigation.navigateToNextPage(); + pageNavigation.verifyCurrentPageNumber(2); + pageNavigation.navigateToPreviousPage(); + pageNavigation.verifyCurrentPageNumber(1); }); it("Import new asset", () => { diff --git a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts index 2c5699ec76c..f4c7aaa90a0 100644 --- a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts +++ b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts @@ -1,5 +1,6 @@ // FacilityCreation -import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; +import { pageNavigation } from "pageobject/utils/paginationHelpers"; + import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import FacilityHome from "../../pageobject/Facility/FacilityHome"; import FacilityNotify from "../../pageobject/Facility/FacilityNotify"; @@ -15,7 +16,6 @@ describe("Facility Homepage Function", () => { const facilityPage = new FacilityPage(); const manageUserPage = new ManageUserPage(); const userPage = new UserPage(); - const assetPagination = new AssetPagination(); const facilitiesAlias = "downloadFacilitiesCSV"; const doctorsAlias = "downloadDoctorsCSV"; const triagesAlias = "downloadTriagesCSV"; @@ -83,10 +83,10 @@ describe("Facility Homepage Function", () => { it("Search a facility in homepage and pagination", () => { // pagination of the facility page - assetPagination.navigateToNextPage(); - assetPagination.verifyNextUrl(); - assetPagination.navigateToPreviousPage(); - assetPagination.verifyPreviousUrl(); + pageNavigation.navigateToNextPage(); + pageNavigation.verifyCurrentPageNumber(2); + pageNavigation.navigateToPreviousPage(); + pageNavigation.verifyCurrentPageNumber(1); // search for a facility manageUserPage.typeFacilitySearch(facilityName); facilityPage.verifyFacilityBadgeContent(facilityName); diff --git a/cypress/e2e/facility_spec/FacilityLocation.cy.ts b/cypress/e2e/facility_spec/FacilityLocation.cy.ts index 7d0c626a93b..9ac85e9ba4c 100644 --- a/cypress/e2e/facility_spec/FacilityLocation.cy.ts +++ b/cypress/e2e/facility_spec/FacilityLocation.cy.ts @@ -1,7 +1,7 @@ +import { pageNavigation } from "pageobject/utils/paginationHelpers"; import { v4 as uuidv4 } from "uuid"; import { AssetPage } from "../../pageobject/Asset/AssetCreation"; -import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import FacilityHome from "../../pageobject/Facility/FacilityHome"; import FacilityLocation from "../../pageobject/Facility/FacilityLocation"; @@ -12,7 +12,6 @@ describe("Location Management Section", () => { const userCreationPage = new UserCreationPage(); const facilityPage = new FacilityPage(); const facilityLocation = new FacilityLocation(); - const assetPagination = new AssetPagination(); const facilityHome = new FacilityHome(); const EXPECTED_LOCATION_ERROR_MESSAGES = [ @@ -172,8 +171,8 @@ describe("Location Management Section", () => { facilityLocation.setMultipleBeds(numberOfModifiedBeds); assetPage.clickassetupdatebutton(); // pagination - assetPagination.navigateToNextPage(); - assetPagination.navigateToPreviousPage(); + pageNavigation.navigateToNextPage(); + pageNavigation.navigateToPreviousPage(); facilityLocation.closeNotification(); }); diff --git a/cypress/e2e/hcx_spec/HcxClaims.cy.ts b/cypress/e2e/hcx_spec/HcxClaims.cy.ts index 869afd6fcbb..b698bb7ffd8 100644 --- a/cypress/e2e/hcx_spec/HcxClaims.cy.ts +++ b/cypress/e2e/hcx_spec/HcxClaims.cy.ts @@ -11,7 +11,7 @@ describe("HCX Claims configuration and approval workflow", () => { const patientConsultationPage = new PatientConsultationPage(); const patientInsurance = new PatientInsurance(); const hcxClaims = new HcxClaims(); - const hcxPatientName = "Dummy Patient 14"; + const hcxPatientName = "Dummy Patient Thirteen"; const firstInsuranceIdentifier = "insurance-details-0"; const patientMemberId = "001"; const patientPolicyId = "100"; diff --git a/cypress/e2e/patient_spec/PatientBedManagement.cy.ts b/cypress/e2e/patient_spec/PatientBedManagement.cy.ts index 65adf131c87..94f0869db9b 100644 --- a/cypress/e2e/patient_spec/PatientBedManagement.cy.ts +++ b/cypress/e2e/patient_spec/PatientBedManagement.cy.ts @@ -11,8 +11,8 @@ describe("Patient swtich bed functionality", () => { const switchBedOne = "Dummy Bed 4"; const switchBedTwo = "Dummy Bed 1"; const switchBedThree = "Dummy Bed 7"; - const switchPatientOne = "Dummy Patient 6"; - const switchPatientTwo = "Dummy Patient 7"; + const switchPatientOne = "Dummy Patient Six"; + const switchPatientTwo = "Dummy Patient Seven"; before(() => { loginPage.loginAsDistrictAdmin(); diff --git a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts index bd6e7c0d967..3eacd9b718f 100644 --- a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts +++ b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts @@ -375,7 +375,7 @@ describe("Patient Consultation in multiple combination", () => { }); it("Edit created consultation to existing patient", () => { - patientPage.visitPatient("Dummy Patient 13"); + patientPage.visitPatient("Dummy Patient Thirteen"); patientConsultationPage.clickEditConsultationButton(); patientConsultationPage.typePatientIllnessHistory("editted"); patientConsultationPage.selectPatientDiagnosis( diff --git a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts index 6a3d2863818..9e234c860da 100644 --- a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts +++ b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts @@ -31,7 +31,7 @@ describe("Patient Discharge based on multiple reason", () => { }); it("Discharge a LAMA patient in the consultation", () => { - patientPage.visitPatient("Dummy Patient 12"); + patientPage.visitPatient("Discharge Patient One"); patientDischarge.clickDischarge(); patientDischarge.selectDischargeReason(patientDischargeReason4); cy.clickSubmitButton("Confirm Discharge"); @@ -47,7 +47,7 @@ describe("Patient Discharge based on multiple reason", () => { }); it("Discharge a expired patient in the consultation", () => { - patientPage.visitPatient("Dummy Patient 13"); + patientPage.visitPatient("Discharge Patient Two"); patientDischarge.clickDischarge(); patientDischarge.selectDischargeReason(patientDischargeReason3); patientDischarge.typeDischargeNote(patientDeathCause); @@ -67,7 +67,7 @@ describe("Patient Discharge based on multiple reason", () => { }); it("Discharge patient with referred reason to a facility", () => { - patientPage.visitPatient("Dummy Patient 16"); + patientPage.visitPatient("Discharge Patient Three"); patientDischarge.clickDischarge(); patientDischarge.selectDischargeReason(patientDischargeReason2); patientDischarge.typeDischargeNote(patientDischargeAdvice); @@ -93,7 +93,7 @@ describe("Patient Discharge based on multiple reason", () => { }); it("Discharge a recovered patient with all relevant fields", () => { - patientPage.visitPatient("Dummy Patient 15"); + patientPage.visitPatient("Discharge Patient Four"); patientDischarge.clickDischarge(); patientDischarge.selectDischargeReason(patientDischargeReason1); patientDischarge.typeDischargeNote(patientDischargeAdvice); diff --git a/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts b/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts index dd626f619ce..474af286b21 100644 --- a/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts +++ b/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts @@ -7,10 +7,10 @@ describe("Patient Doctor Connect in consultation page", () => { const loginPage = new LoginPage(); const patientPage = new PatientPage(); const doctorconnect = new DoctorConnect(); - const patientName = "Dummy Patient 11"; + const patientName = "Dummy Patient Eleven"; const doctorUser = "Dev Doctor"; const nurseUser = "Dev Staff"; - const teleIcuUser = "Dev Doctor Two"; + const teleIcuUser = "Tester Doctor"; before(() => { loginPage.loginAsDistrictAdmin(); diff --git a/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts b/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts index e35d3eb8961..d227d68ddcb 100644 --- a/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts +++ b/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts @@ -6,7 +6,7 @@ describe("Patient Discussion notes in the consultation page", () => { const loginPage = new LoginPage(); const patientPage = new PatientPage(); const patientDoctorNotes = new PatientDoctorNotes(); - const patientName = "Dummy Patient 4"; + const patientName = "Dummy Patient Four"; const patientNurseNote = "Test nurse Notes"; const patientNurseReplyNote = "Test nurse reply Notes"; const discussionNotesSubscribeWarning = diff --git a/cypress/e2e/patient_spec/PatientFileUpload.ts b/cypress/e2e/patient_spec/PatientFileUpload.ts index 110631551a1..dd3098163ec 100644 --- a/cypress/e2e/patient_spec/PatientFileUpload.ts +++ b/cypress/e2e/patient_spec/PatientFileUpload.ts @@ -14,9 +14,9 @@ function runTests( const cypressAudioName = "cypress audio"; const cypressFileName = "cypress name"; const newFileName = "cypress modified name"; - const patientNameOne = "Dummy Patient 3"; - const patientNameTwo = "Dummy Patient 4"; - const patientNameThree = "Dummy Patient 5"; + const patientNameOne = "Dummy Patient Three"; + const patientNameTwo = "Dummy Patient Four"; + const patientNameThree = "Dummy Patient Five"; before(() => { loginPage.loginAsDistrictAdmin(); cy.saveLocalStorage(); diff --git a/cypress/e2e/patient_spec/PatientHomepage.cy.ts b/cypress/e2e/patient_spec/PatientHomepage.cy.ts index e4e0f927952..e2c32098f1c 100644 --- a/cypress/e2e/patient_spec/PatientHomepage.cy.ts +++ b/cypress/e2e/patient_spec/PatientHomepage.cy.ts @@ -1,4 +1,5 @@ import { advanceFilters } from "pageobject/utils/advanceFilterHelpers"; +import { pageNavigation } from "pageobject/utils/paginationHelpers"; import LoginPage from "../../pageobject/Login/LoginPage"; import PatientHome from "../../pageobject/Patient/PatientHome"; @@ -163,15 +164,15 @@ describe("Patient Homepage present functionalities", () => { .invoke("text") .then((patientOne: string) => { firstPatientPageOne = patientOne.trim(); - patientHome.clickNextPage(); - patientHome.verifySecondPageUrl(); + pageNavigation.navigateToNextPage(); + pageNavigation.verifyCurrentPageNumber(2); cy.get('[data-cy="patient"]') .first() .invoke("text") .then((patientTwo: string) => { const firstPatientPageTwo = patientTwo.trim(); expect(firstPatientPageOne).not.to.eq(firstPatientPageTwo); - patientHome.clickPreviousPage(); + pageNavigation.navigateToPreviousPage(); }); }); }); diff --git a/cypress/e2e/patient_spec/PatientInvestigation.cy.ts b/cypress/e2e/patient_spec/PatientInvestigation.cy.ts index 262759bd360..350614d0c9a 100644 --- a/cypress/e2e/patient_spec/PatientInvestigation.cy.ts +++ b/cypress/e2e/patient_spec/PatientInvestigation.cy.ts @@ -7,7 +7,7 @@ describe("Patient Investigation Creation from Patient consultation page", () => const loginPage = new LoginPage(); const patientPage = new PatientPage(); const patientInvestigation = new PatientInvestigation(); - const patientName = "Dummy Patient 14"; + const patientName = "Dummy Patient Thirteen"; before(() => { loginPage.loginAsDistrictAdmin(); diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts index 05958bdf3f0..cfb739c8343 100644 --- a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts +++ b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts @@ -32,13 +32,13 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { const patientInsulinDosage = "56"; const patientFluidBalance = "500"; const patientNetBalance = "1000"; - const patientOne = "Dummy Patient 9"; + const patientOne = "Dummy Patient Nine"; const bedOne = "Dummy Bed 5"; - const patientTwo = "Dummy Patient 10"; + const patientTwo = "Dummy Patient Ten"; const bedTwo = "Dummy Bed 2"; - const patientThree = "Dummy Patient 8"; + const patientThree = "Dummy Patient Eight"; const bedThree = "Dummy Bed 3"; - const domicilaryPatient = "Dummy Patient 11"; + const domicilaryPatient = "Dummy Patient Eleven"; before(() => { loginPage.loginAsDistrictAdmin(); diff --git a/cypress/e2e/patient_spec/PatientPrescription.cy.ts b/cypress/e2e/patient_spec/PatientPrescription.cy.ts index 1011c2f4f4d..96e6e23b1aa 100644 --- a/cypress/e2e/patient_spec/PatientPrescription.cy.ts +++ b/cypress/e2e/patient_spec/PatientPrescription.cy.ts @@ -26,7 +26,7 @@ describe("Patient Medicine Administration", () => { }); it("Add a new medicine | Verify the Edit and Discontinue Medicine workflow |", () => { - patientPage.visitPatient("Dummy Patient 9"); + patientPage.visitPatient("Dummy Patient Nine"); patientPrescription.visitMedicineTab(); patientPrescription.visitEditPrescription(); // Add a normal Medicine to the patient @@ -63,7 +63,7 @@ describe("Patient Medicine Administration", () => { }); it("Add a PRN Prescription medicine | Group Administrate it |", () => { - patientPage.visitPatient("Dummy Patient 6"); + patientPage.visitPatient("Dummy Patient Six"); patientPrescription.visitMedicineTab(); patientPrescription.visitEditPrescription(); // Add First Medicine @@ -97,7 +97,7 @@ describe("Patient Medicine Administration", () => { }); it("Add a new titrated medicine for a patient | Individual Administeration |", () => { - patientPage.visitPatient("Dummy Patient 5"); + patientPage.visitPatient("Dummy Patient Five"); patientPrescription.visitMedicineTab(); patientPrescription.visitEditPrescription(); patientPrescription.clickAddPrescription(); @@ -136,7 +136,7 @@ describe("Patient Medicine Administration", () => { }); it("Add a new medicine for a patient and verify the duplicate medicine validation", () => { - patientPage.visitPatient("Dummy Patient 4"); + patientPage.visitPatient("Dummy Patient Four"); patientPrescription.visitMedicineTab(); patientPrescription.visitEditPrescription(); patientPrescription.clickAddPrescription(); diff --git a/cypress/e2e/patient_spec/PatientRegistration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts index 91810ffd273..c3647ceac3a 100644 --- a/cypress/e2e/patient_spec/PatientRegistration.cy.ts +++ b/cypress/e2e/patient_spec/PatientRegistration.cy.ts @@ -64,7 +64,7 @@ describe("Patient Creation with consultation", () => { const patientOneSecondInsurerName = "Care Payor"; const patientTransferPhoneNumber = "9849511866"; const patientTransferFacility = "Dummy Shifting Center"; - const patientTransferName = "Dummy Patient 10"; + const patientTransferName = "Dummy Patient Twelve"; const patientOccupation = "Student"; before(() => { @@ -243,7 +243,7 @@ describe("Patient Creation with consultation", () => { patientTransfer.clickTransferPatientYOB(yearOfBirth); patientTransfer.clickTransferSubmitButton(); cy.verifyNotification( - "Patient Dummy Patient 10 (Male) transferred successfully", + `Patient ${patientTransferName} (Male) transferred successfully`, ); patientTransfer.clickConsultationCancelButton(); // allow the transfer button of a patient diff --git a/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts b/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts index a0f30ebd6db..da4d8aabd20 100644 --- a/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts +++ b/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts @@ -8,7 +8,7 @@ describe("Sample Test", () => { const patientPage = new PatientPage(); const loginPage = new LoginPage(); const patientConsultationPage = new PatientConsultationPage(); - const patientName = "Dummy Patient 11"; + const patientName = "Dummy Patient Eleven"; const sampleTestType = "BA/ETA"; const icmrCategory = "Cat 0"; const icmrLabel = "Test Icmr Label"; diff --git a/cypress/e2e/users_spec/UsersHomepage.cy.ts b/cypress/e2e/users_spec/UsersHomepage.cy.ts index d5825f58f20..b32bb859e4e 100644 --- a/cypress/e2e/users_spec/UsersHomepage.cy.ts +++ b/cypress/e2e/users_spec/UsersHomepage.cy.ts @@ -1,4 +1,5 @@ import { advanceFilters } from "pageobject/utils/advanceFilterHelpers"; +import { pageNavigation } from "pageobject/utils/paginationHelpers"; import LoginPage from "../../pageobject/Login/LoginPage"; import { UserPage } from "../../pageobject/Users/UserSearch"; @@ -16,7 +17,7 @@ describe("User Homepage", () => { const altPhoneNumber = "8878825662"; const homeFacility = "Dummy Facility 40"; const nurseUserName = "dummynurse1"; - const doctorUserName = "devdoctor1"; + const doctorUserName = "dev-doctor2"; before(() => { loginPage.loginAsDistrictAdmin(); @@ -84,10 +85,10 @@ describe("User Homepage", () => { }); it("Next/Previous Page Navigation", () => { - userPage.navigateToNextPage(); - userPage.verifyCurrentPageNumber(2); - userPage.navigateToPreviousPage(); - userPage.verifyCurrentPageNumber(1); + pageNavigation.navigateToNextPage(); + pageNavigation.verifyCurrentPageNumber(2); + pageNavigation.navigateToPreviousPage(); + pageNavigation.verifyCurrentPageNumber(1); }); afterEach(() => { diff --git a/cypress/pageobject/Asset/AssetPagination.ts b/cypress/pageobject/Asset/AssetPagination.ts index f2a4103b065..e69de29bb2d 100644 --- a/cypress/pageobject/Asset/AssetPagination.ts +++ b/cypress/pageobject/Asset/AssetPagination.ts @@ -1,19 +0,0 @@ -export class AssetPagination { - navigateToNextPage() { - // only works for desktop mode - cy.get("button#next-pages").click(); - } - - verifyNextUrl() { - cy.url().should("include", "page=2"); - } - - navigateToPreviousPage() { - // only works for desktop mode - cy.get("button#prev-pages").click(); - } - - verifyPreviousUrl() { - cy.url().should("include", "page=1"); - } -} diff --git a/cypress/pageobject/Patient/PatientHome.ts b/cypress/pageobject/Patient/PatientHome.ts index bc27977d561..36cad15f0e5 100644 --- a/cypress/pageobject/Patient/PatientHome.ts +++ b/cypress/pageobject/Patient/PatientHome.ts @@ -1,16 +1,4 @@ class PatientHome { - clickNextPage() { - cy.get("#next-pages").click(); - } - - verifySecondPageUrl() { - cy.url().should("include", "/patients?page=2"); - } - - clickPreviousPage() { - cy.get("#prev-pages").click(); - } - clickPatientExport() { cy.get("#patient-export").click(); } diff --git a/cypress/pageobject/Users/UserSearch.ts b/cypress/pageobject/Users/UserSearch.ts index 85575398d0d..6b727aa2040 100644 --- a/cypress/pageobject/Users/UserSearch.ts +++ b/cypress/pageobject/Users/UserSearch.ts @@ -76,18 +76,6 @@ export class UserPage { cy.get(`[data-testid="${testId}"]`).should("not.be.visible"); } - navigateToNextPage() { - cy.get("button#next-pages").click(); - } - - navigateToPreviousPage() { - cy.get("button#prev-pages").click(); - } - - verifyCurrentPageNumber(pageNumber: number) { - cy.url().should("include", `page=${pageNumber}`); - } - verifyMultipleBadgesWithSameId(alreadylinkedusersviews: string[]) { cy.get("#user-view-name").then(($elements) => { const userViews = $elements diff --git a/cypress/pageobject/utils/paginationHelpers.ts b/cypress/pageobject/utils/paginationHelpers.ts new file mode 100644 index 00000000000..edbabec5523 --- /dev/null +++ b/cypress/pageobject/utils/paginationHelpers.ts @@ -0,0 +1,13 @@ +export const pageNavigation = { + navigateToNextPage() { + cy.get("button#next-pages").click(); + }, + + verifyCurrentPageNumber(pageNumber: number) { + cy.url().should("include", `page=${pageNumber}`); + }, + + navigateToPreviousPage() { + cy.get("button#prev-pages").click(); + }, +};