From bb972f229630b9285bf6b06144917ffb3c34fcef Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Mon, 28 Oct 2024 20:37:54 +0530 Subject: [PATCH 1/5] Cypress Tests cy.wait() replace with cy.intercept() or dynamic wait --- .env | 1 + cypress/e2e/assets_spec/AssetHomepage.cy.ts | 1 - cypress/e2e/facility_spec/FacilityCreation.cy.ts | 2 +- cypress/e2e/facility_spec/FacilityInventory.cy.ts | 6 +++--- cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts | 1 - .../{PatientFileUpload.ts => PatientFileUpload.cy.ts} | 0 cypress/e2e/patient_spec/PatientLogUpdate.cy.ts | 2 -- cypress/e2e/patient_spec/PatientRegistration.cy.ts | 6 ------ cypress/e2e/users_spec/UsersCreation.cy.ts | 1 - cypress/e2e/users_spec/UsersManage.cy.ts | 3 --- cypress/pageobject/Facility/FacilityCreation.ts | 1 - cypress/pageobject/Patient/PatientCreation.ts | 2 +- cypress/pageobject/Patient/PatientDoctorNotes.ts | 1 - cypress/pageobject/Patient/PatientFileupload.ts | 7 ++----- cypress/pageobject/Patient/PatientTransfer.ts | 2 -- cypress/pageobject/Users/ManageUserPage.ts | 2 +- 16 files changed, 9 insertions(+), 29 deletions(-) rename cypress/e2e/patient_spec/{PatientFileUpload.ts => PatientFileUpload.cy.ts} (100%) diff --git a/.env b/.env index ebc0ebd5be3..b205a716158 100644 --- a/.env +++ b/.env @@ -8,6 +8,7 @@ REACT_PUBLIC_URL=https://care.ohc.network # Care API URL without the /api prefix REACT_CARE_API_URL=https://careapi.ohc.network +# REACT_CARE_API_URL=http://localhost:9000 # Dev envs ESLINT_NO_DEV_ERRORS=true diff --git a/cypress/e2e/assets_spec/AssetHomepage.cy.ts b/cypress/e2e/assets_spec/AssetHomepage.cy.ts index bf608cdab9f..1dce4844cc1 100644 --- a/cypress/e2e/assets_spec/AssetHomepage.cy.ts +++ b/cypress/e2e/assets_spec/AssetHomepage.cy.ts @@ -100,7 +100,6 @@ describe("Asset Tab", () => { it("Export asset", () => { assetPage.selectassetimportbutton(); - cy.wait(2000); assetPage.selectJsonExportButton(); assetPage.selectassetimportbutton(); assetPage.selectCsvExportButton(); diff --git a/cypress/e2e/facility_spec/FacilityCreation.cy.ts b/cypress/e2e/facility_spec/FacilityCreation.cy.ts index 918e926d107..7d7847c435e 100644 --- a/cypress/e2e/facility_spec/FacilityCreation.cy.ts +++ b/cypress/e2e/facility_spec/FacilityCreation.cy.ts @@ -32,7 +32,7 @@ describe("Facility Creation", () => { const facilityAddress = "cypress address"; const facilityUpdateAddress = "cypress updated address"; const facilityNumber = "9898469865"; - const triageDate = "02122023"; + const triageDate = "03122023"; const initialTriageValue = "60"; const modifiedTriageValue = "50"; const facilityErrorMessage = [ diff --git a/cypress/e2e/facility_spec/FacilityInventory.cy.ts b/cypress/e2e/facility_spec/FacilityInventory.cy.ts index 78e7af88cea..8ae707f860a 100644 --- a/cypress/e2e/facility_spec/FacilityInventory.cy.ts +++ b/cypress/e2e/facility_spec/FacilityInventory.cy.ts @@ -33,7 +33,9 @@ describe("Inventory Management Section", () => { // modify the new item facilityPage.fillInventoryDetails("PPE", "Use Stock", "5"); facilityPage.clickAddInventory(); - facilityPage.verifySuccessNotification("Inventory created successfully"); + facilityPage.verifySuccessNotification( + "Inventory use stock updated successfully", + ); // verify the new modification facilityPage.verifyPpeQuantity("PPE"); facilityPage.verifyPpeQuantity("5"); @@ -43,7 +45,6 @@ describe("Inventory Management Section", () => { // verify the last entry deletion facilityPage.verifyStockInRow("#row-0", "Added Stock"); facilityPage.verifyStockInRow("#row-1", "Used Stock"); - cy.wait(3000); facilityHome.navigateBack(); facilityPage.verifyPpeQuantity("PPE"); }); @@ -59,7 +60,6 @@ describe("Inventory Management Section", () => { facilityPage.verifyBadgeWithText(".badge-danger", "Low Stock"); // modify with manual minimum badge facilityPage.clickAddMinimumQuanitity(); - cy.wait(3000); cy.get("body").then(($body) => { if ($body.find("#update-minimum-quantity").is(":visible")) { // If the 'update-minimum-quantity' element is visible, click it diff --git a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts index 6f9bf2b03e0..7def73588b3 100644 --- a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts +++ b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts @@ -105,7 +105,6 @@ describe("Patient Consultation in multiple combination", () => { patientPrescription.enterDosage("3"); patientPrescription.selectDosageFrequency("Twice daily"); cy.submitButton("Submit"); - cy.wait(2000); cy.verifyNotification("Medicine prescribed"); patientPrescription.clickReturnToDashboard(); // Verify the data's across the dashboard diff --git a/cypress/e2e/patient_spec/PatientFileUpload.ts b/cypress/e2e/patient_spec/PatientFileUpload.cy.ts similarity index 100% rename from cypress/e2e/patient_spec/PatientFileUpload.ts rename to cypress/e2e/patient_spec/PatientFileUpload.cy.ts diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts index 835e53459eb..2635df4bf0b 100644 --- a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts +++ b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts @@ -113,7 +113,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.closeNotification(); // Submit the doctors log update cy.submitButton("Save and Continue"); - cy.wait(2000); cy.verifyNotification("Progress Note created successfully"); cy.closeNotification(); // modify the relevant critical care log update @@ -252,7 +251,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeRhythm(patientRhythm); cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click(); cy.submitButton("Save"); - cy.wait(2000); cy.verifyNotification("Brief Update created successfully"); // Verify the card content cy.get("#basic-information").scrollIntoView(); diff --git a/cypress/e2e/patient_spec/PatientRegistration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts index 4e493a23bff..aa3afce5eaf 100644 --- a/cypress/e2e/patient_spec/PatientRegistration.cy.ts +++ b/cypress/e2e/patient_spec/PatientRegistration.cy.ts @@ -119,7 +119,6 @@ describe("Patient Creation with consultation", () => { patientPage.verifyPatientIsCreated(); // Verify the patient details patientPage.clickCancelButton(); - cy.wait(3000); patientPage.savePatientUrl(); patientPage.verifyPatientDashboardDetails( patientOneGender, @@ -157,7 +156,6 @@ describe("Patient Creation with consultation", () => { patientPage.verifyStatusCode(); patientPage.patientformvisibility(); // change the gender to female and input data to related changed field - cy.wait(3000); patientPage.selectPatientGender(patientOneUpdatedGender); patientPage.typePatientDateOfBirth(patientDateOfBirth); patientPage.clickPatientAntenatalStatusYes(); @@ -220,11 +218,9 @@ describe("Patient Creation with consultation", () => { } patientPage.clickUpdatePatient(); - cy.wait(3000); patientPage.verifyPatientUpdated(); patientPage.visitPatientUrl(); // Verify Female Gender change reflection, No Medical History and Insurance Details - cy.wait(5000); patientPage.verifyPatientDashboardDetails( patientOneUpdatedGender, age, @@ -241,9 +237,7 @@ describe("Patient Creation with consultation", () => { cy.get("[data-testid=patient-details]") .contains("member id") .scrollIntoView(); - cy.wait(2000); patientInsurance.clickPatientInsuranceViewDetail(); - cy.wait(3000); patientInsurance.verifyPatientPolicyDetails( patientOneFirstSubscriberId, patientOneFirstPolicyId, diff --git a/cypress/e2e/users_spec/UsersCreation.cy.ts b/cypress/e2e/users_spec/UsersCreation.cy.ts index 392c9ff987d..43b43000a32 100644 --- a/cypress/e2e/users_spec/UsersCreation.cy.ts +++ b/cypress/e2e/users_spec/UsersCreation.cy.ts @@ -182,7 +182,6 @@ describe("User Creation", () => { it("create new user form throwing mandatory field error", () => { userCreationPage.clickElementById("addUserButton"); userCreationPage.clickElementById("submit"); - cy.wait(2000); userCreationPage.verifyErrorMessages(EXPECTED_ERROR_MESSAGES); }); diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index 3d9d18ff285..6c489c7beef 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -38,11 +38,9 @@ describe("Manage User", () => { manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); - cy.wait(5000); manageUserPage.clicklinkedskillbutton(); manageUserPage.assertSkillInAddedUserSkills(linkedskill); manageUserPage.clickCloseSlideOver(); - cy.wait(5000); manageUserPage.navigateToProfile(); userCreationPage.verifyElementContainsText( "username-profile-details", @@ -59,7 +57,6 @@ describe("Manage User", () => { manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); - cy.wait(5000); // temporary hack to fix the failure manageUserPage.clicklinkedskillbutton(); manageUserPage.assertSkillInAddedUserSkills(linkedskill); manageUserPage.clickUnlinkSkill(); diff --git a/cypress/pageobject/Facility/FacilityCreation.ts b/cypress/pageobject/Facility/FacilityCreation.ts index 159b8660b43..37419d9431a 100644 --- a/cypress/pageobject/Facility/FacilityCreation.ts +++ b/cypress/pageobject/Facility/FacilityCreation.ts @@ -300,7 +300,6 @@ class FacilityPage { cy.get("#facility-location-button").click(); cy.wait("@mapApi").its("response.statusCode").should("eq", 200); cy.get("input#pac-input").type(location).type("{enter}"); - cy.wait(2000); cy.get("div#map-close").click(); } diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts index a583844a632..bc9e55830f1 100644 --- a/cypress/pageobject/Patient/PatientCreation.ts +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -13,8 +13,8 @@ export class PatientPage { visitPatient(patientName: string) { cy.get("#name").click().type(patientName); cy.intercept("GET", "**/api/v1/consultation/**").as("getPatient"); + // cy.wait("@getPatient"); cy.get("#patient-name-list").contains(patientName).click(); - cy.wait(2000); cy.wait("@getPatient").its("response.statusCode").should("eq", 200); cy.get("#patient-name-consultation") .should("be.visible") diff --git a/cypress/pageobject/Patient/PatientDoctorNotes.ts b/cypress/pageobject/Patient/PatientDoctorNotes.ts index 157f35d47d9..203c99703d9 100644 --- a/cypress/pageobject/Patient/PatientDoctorNotes.ts +++ b/cypress/pageobject/Patient/PatientDoctorNotes.ts @@ -5,7 +5,6 @@ export class PatientDoctorNotes { } addDiscussionNotes(notes: string) { - cy.wait(2000); cy.get("#discussion_notes_textarea").scrollIntoView(); cy.get("#discussion_notes_textarea").click().type(notes); } diff --git a/cypress/pageobject/Patient/PatientFileupload.ts b/cypress/pageobject/Patient/PatientFileupload.ts index 0616a19729c..b323f9781a8 100644 --- a/cypress/pageobject/Patient/PatientFileupload.ts +++ b/cypress/pageobject/Patient/PatientFileupload.ts @@ -20,10 +20,8 @@ export class PatientFileUpload { recordAudio() { cy.get("#record-audio").click(); - cy.wait(5000); - cy.get("#stop-recording").click(); - cy.wait(1000); - cy.get("#save-recording").click(); + cy.get("#stop-recording").should("be.enabled").click(); + cy.get("#save-recording").should("be.enabled").click(); } clickUploadAudioFile() { @@ -33,7 +31,6 @@ export class PatientFileUpload { } verifyUploadFilePresence(fileName: string) { - cy.wait(2000); cy.get("#file-div").scrollIntoView(); cy.verifyContentPresence("#file-div", [fileName]); } diff --git a/cypress/pageobject/Patient/PatientTransfer.ts b/cypress/pageobject/Patient/PatientTransfer.ts index 0bdd55e9880..5ad49b40b5f 100644 --- a/cypress/pageobject/Patient/PatientTransfer.ts +++ b/cypress/pageobject/Patient/PatientTransfer.ts @@ -19,13 +19,11 @@ class PatientTransfer { clickTransferSubmitButton() { cy.get("#submit-transferpatient").click(); - cy.wait(2000); } clickConsultationCancelButton() { cy.get("#cancel").scrollIntoView(); cy.get("#cancel").click(); - cy.wait(2000); } clickAllowPatientTransferButton() { diff --git a/cypress/pageobject/Users/ManageUserPage.ts b/cypress/pageobject/Users/ManageUserPage.ts index 470862693a8..8518ac10118 100644 --- a/cypress/pageobject/Users/ManageUserPage.ts +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -41,7 +41,7 @@ export class ManageUserPage { } clickCloseSlideOver() { - cy.get("#close-slide-over").click({ force: true }); + cy.get("#close-slide-over").should("be.visible").click(); } clickHomeFacilityIcon() { From f5d5cc86cfec7dffb155ab28883a5a15e3bc1687 Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Tue, 29 Oct 2024 20:04:15 +0530 Subject: [PATCH 2/5] Refactor Cypress tests: replaced static cy.wait() with dynamic waits and removed irrelevant waits --- cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts | 4 ---- cypress/e2e/patient_spec/PatientPrescription.cy.ts | 1 - cypress/pageobject/Patient/PatientConsultation.ts | 2 -- cypress/pageobject/Patient/PatientCreation.ts | 1 - cypress/pageobject/Patient/PatientLogupdate.ts | 5 ----- cypress/pageobject/Patient/PatientPrescription.ts | 3 +-- 6 files changed, 1 insertion(+), 15 deletions(-) diff --git a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts index be9b06303cb..7f7fd7f3e80 100644 --- a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts +++ b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts @@ -76,10 +76,8 @@ describe("Patient Discharge based on multiple reason", () => { patientDischarge.clickClearButton(); // select a non-registered facility and perform the discharge patientDischarge.typeReferringFacility(referringFreetextFacility); - cy.wait(2000); cy.submitButton("Confirm Discharge"); cy.submitButton("Acknowledge & Submit"); - cy.wait(2000); cy.verifyNotification("Patient Discharged Successfully"); cy.closeNotification(); // Verify the consultation dashboard reflection @@ -106,12 +104,10 @@ describe("Patient Discharge based on multiple reason", () => { patientPrescription.selectDosageFrequency("Twice daily"); cy.submitButton("Submit"); cy.verifyNotification("Medicine prescribed"); - cy.wait(2000); cy.closeNotification(); // submit the discharge pop-up cy.submitButton("Confirm Discharge"); cy.submitButton("Acknowledge & Submit"); - cy.wait(2000); cy.verifyNotification("Patient Discharged Successfully"); cy.closeNotification(); // Verify the consultation dashboard reflection diff --git a/cypress/e2e/patient_spec/PatientPrescription.cy.ts b/cypress/e2e/patient_spec/PatientPrescription.cy.ts index 86ca4122082..a6293ca6706 100644 --- a/cypress/e2e/patient_spec/PatientPrescription.cy.ts +++ b/cypress/e2e/patient_spec/PatientPrescription.cy.ts @@ -113,7 +113,6 @@ describe("Patient Medicine Administration", () => { cy.closeNotification(); // Administer the medicine in edit form patientPrescription.clickAdministerButton(); - cy.wait(2000); patientPrescription.enterAdministerDosage(medicineBaseDosage); patientPrescription.enterAdministerNotes(medicineAdministerNote); cy.submitButton("Administer Medicine"); diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index 71a0fbb3909..867fe942508 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -1,6 +1,5 @@ export class PatientConsultationPage { selectConsultationStatus(status: string) { - cy.wait(5000); cy.get("#route_to_facility").scrollIntoView(); cy.get("#route_to_facility").should("be.visible"); cy.clickAndSelectOption("#route_to_facility", status); @@ -109,6 +108,5 @@ export class PatientConsultationPage { "#consultation-buttons", "Edit Consultation Details", ); - cy.wait(3000); } } diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts index bc9e55830f1..474de816fd6 100644 --- a/cypress/pageobject/Patient/PatientCreation.ts +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -13,7 +13,6 @@ export class PatientPage { visitPatient(patientName: string) { cy.get("#name").click().type(patientName); cy.intercept("GET", "**/api/v1/consultation/**").as("getPatient"); - // cy.wait("@getPatient"); cy.get("#patient-name-list").contains(patientName).click(); cy.wait("@getPatient").its("response.statusCode").should("eq", 200); cy.get("#patient-name-consultation") diff --git a/cypress/pageobject/Patient/PatientLogupdate.ts b/cypress/pageobject/Patient/PatientLogupdate.ts index d7b49fde05e..10c4c73b8fe 100644 --- a/cypress/pageobject/Patient/PatientLogupdate.ts +++ b/cypress/pageobject/Patient/PatientLogupdate.ts @@ -2,7 +2,6 @@ class PatientLogupdate { clickLogupdate() { cy.get("#log-update").scrollIntoView(); cy.verifyAndClickElement("#log-update", "Log Update"); - cy.wait(2000); } clickSwitchBed() { @@ -16,7 +15,6 @@ class PatientLogupdate { selectBed(bed: string) { cy.typeAndSelectOption("input[name='bed']", bed); cy.get("#update-switchbed").click(); - cy.wait(2000); } selectPatientCategory(category: string) { @@ -78,19 +76,16 @@ class PatientLogupdate { cy.get(element).scrollIntoView(); cy.verifyContentPresence(element, [patientCategory]); cy.get(element).first().contains("View Details").click(); - cy.wait(3000); } clickLogUpdateUpdateLog(element: string, patientCategory: string) { cy.get(element).scrollIntoView(); cy.verifyContentPresence(element, [patientCategory]); cy.get(element).first().contains("Update Log").click(); - cy.wait(3000); } clickUpdateDetail() { cy.verifyAndClickElement("#consultation-preview", "Update Details"); - cy.wait(3000); } clearIntoElementById(elementId) { diff --git a/cypress/pageobject/Patient/PatientPrescription.ts b/cypress/pageobject/Patient/PatientPrescription.ts index d801b360aba..4c8e43a6145 100644 --- a/cypress/pageobject/Patient/PatientPrescription.ts +++ b/cypress/pageobject/Patient/PatientPrescription.ts @@ -61,8 +61,7 @@ export class PatientPrescription { } enterDiscontinueReason(reason: string) { - cy.wait(2000); - cy.get("#discontinuedReason").type(reason); + cy.get("#discontinuedReason").should("be.visible").type(reason); } enterAdministerDosage(dosage: string) { From 568c7e2eaad54153a5eee4bedf38192c8f54874d Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Sun, 24 Nov 2024 13:32:22 +0530 Subject: [PATCH 3/5] Cypress test cases --- cypress/e2e/facility_spec/FacilityCreation.cy.ts | 2 +- cypress/e2e/facility_spec/FacilityInventory.cy.ts | 2 ++ cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts | 1 + cypress/e2e/patient_spec/PatientRegistration.cy.ts | 4 ++++ cypress/e2e/users_spec/UsersCreation.cy.ts | 1 + cypress/e2e/users_spec/UsersManage.cy.ts | 3 +++ cypress/pageobject/Facility/FacilityCreation.ts | 3 ++- cypress/pageobject/Patient/PatientConsultation.ts | 2 ++ cypress/pageobject/Patient/PatientCreation.ts | 1 + cypress/pageobject/Patient/PatientDoctorNotes.ts | 1 + cypress/pageobject/Patient/PatientFileupload.ts | 1 + cypress/pageobject/Patient/PatientLogupdate.ts | 4 ++++ cypress/pageobject/Patient/PatientTransfer.ts | 2 ++ 13 files changed, 25 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/facility_spec/FacilityCreation.cy.ts b/cypress/e2e/facility_spec/FacilityCreation.cy.ts index 883a5379118..5fd988480fc 100644 --- a/cypress/e2e/facility_spec/FacilityCreation.cy.ts +++ b/cypress/e2e/facility_spec/FacilityCreation.cy.ts @@ -32,7 +32,7 @@ describe("Facility Creation", () => { const facilityAddress = "cypress address"; const facilityUpdateAddress = "cypress updated address"; const facilityNumber = "9898469865"; - const triageDate = "03122023"; + const triageDate = "02122023"; const initialTriageValue = "60"; const modifiedTriageValue = "50"; const facilityErrorMessage = [ diff --git a/cypress/e2e/facility_spec/FacilityInventory.cy.ts b/cypress/e2e/facility_spec/FacilityInventory.cy.ts index ed08b4ccdd4..056f05d94ae 100644 --- a/cypress/e2e/facility_spec/FacilityInventory.cy.ts +++ b/cypress/e2e/facility_spec/FacilityInventory.cy.ts @@ -45,6 +45,7 @@ describe("Inventory Management Section", () => { // verify the last entry deletion facilityPage.verifyStockInRow("#row-0", "Added Stock"); facilityPage.verifyStockInRow("#row-1", "Used Stock"); + cy.wait(2000); facilityHome.navigateBack(); facilityPage.verifyPpeQuantity("PPE"); }); @@ -60,6 +61,7 @@ describe("Inventory Management Section", () => { facilityPage.verifyBadgeWithText(".badge-danger", "Low Stock"); // modify with manual minimum badge facilityPage.clickAddMinimumQuanitity(); + cy.wait(3000); cy.get("body").then(($body) => { if ($body.find("#update-minimum-quantity").is(":visible")) { // If the 'update-minimum-quantity' element is visible, click it diff --git a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts index 6fabe4abde1..9e234c860da 100644 --- a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts +++ b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts @@ -106,6 +106,7 @@ describe("Patient Discharge based on multiple reason", () => { patientPrescription.selectDosageFrequency("Twice daily"); cy.clickSubmitButton("Submit"); cy.verifyNotification("Medicine prescribed"); + cy.wait(2000); cy.closeNotification(); // submit the discharge pop-up cy.clickSubmitButton("Confirm Discharge"); diff --git a/cypress/e2e/patient_spec/PatientRegistration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts index 2ca9434dc1f..f3aa4f56490 100644 --- a/cypress/e2e/patient_spec/PatientRegistration.cy.ts +++ b/cypress/e2e/patient_spec/PatientRegistration.cy.ts @@ -116,6 +116,7 @@ describe("Patient Creation with consultation", () => { patientPage.verifyPatientIsCreated(); // Verify the patient details patientPage.clickCancelButton(); + cy.wait(3000); patientPage.savePatientUrl(); patientPage.verifyPatientDashboardDetails( patientOneGender, @@ -153,6 +154,7 @@ describe("Patient Creation with consultation", () => { patientPage.verifyStatusCode(); patientPage.patientformvisibility(); // change the gender to female and input data to related changed field + cy.wait(2000); patientPage.selectPatientGender(patientOneUpdatedGender); patientPage.typePatientDateOfBirth(patientDateOfBirth); patientPage.clickPatientAntenatalStatusYes(); @@ -212,7 +214,9 @@ describe("Patient Creation with consultation", () => { cy.get("[data-testid=patient-details]") .contains("member id") .scrollIntoView(); + cy.wait(2000); patientInsurance.clickPatientInsuranceViewDetail(); + cy.wait(2000); patientInsurance.verifyPatientPolicyDetails( patientOneFirstSubscriberId, patientOneFirstPolicyId, diff --git a/cypress/e2e/users_spec/UsersCreation.cy.ts b/cypress/e2e/users_spec/UsersCreation.cy.ts index b055a294779..f495a136d97 100644 --- a/cypress/e2e/users_spec/UsersCreation.cy.ts +++ b/cypress/e2e/users_spec/UsersCreation.cy.ts @@ -182,6 +182,7 @@ describe("User Creation", () => { it("create new user form throwing mandatory field error", () => { userCreationPage.clickElementById("addUserButton"); userCreationPage.clickElementById("submit"); + cy.wait(2000); userCreationPage.verifyErrorMessages(EXPECTED_ERROR_MESSAGES); }); diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index fcbcf2fef69..0cc87093a8e 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -42,9 +42,11 @@ describe("Manage User", () => { manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); + cy.wait(3000); manageUserPage.clicklinkedskillbutton(); manageUserPage.assertSkillInAddedUserSkills(linkedskill); manageUserPage.clickCloseSlideOver(); + cy.wait(5000); manageUserPage.navigateToProfile(); userCreationPage.verifyElementContainsText( "username-profile-details", @@ -66,6 +68,7 @@ describe("Manage User", () => { manageUserPage.clickAddSkillButton(); cy.verifyNotification("Skill added successfully"); cy.closeNotification(); + cy.wait(5000); manageUserPage.assertSkillInAddedUserSkills(linkedskill); manageUserPage.clickCloseSlideOver(); // verifying the doctor connect diff --git a/cypress/pageobject/Facility/FacilityCreation.ts b/cypress/pageobject/Facility/FacilityCreation.ts index 55d26b2c9e0..11ffa3d6318 100644 --- a/cypress/pageobject/Facility/FacilityCreation.ts +++ b/cypress/pageobject/Facility/FacilityCreation.ts @@ -284,6 +284,7 @@ class FacilityPage { cy.get("#facility-location-button").click(); cy.wait("@mapApi").its("response.statusCode").should("eq", 200); cy.get("input#pac-input").type(location).type("{enter}"); + cy.wait(2000); cy.get("div#map-close").click(); } @@ -355,7 +356,7 @@ class FacilityPage { fillInventoryDetails(name: string, status: string, quantity: string) { cy.wait(2000); - cy.get("div#id").click(); + cy.get("div#id").should("not.be.disabled").click(); cy.get("div#id ul li").contains(name).click(); cy.get("div#isIncoming").click(); cy.get("div#isIncoming ul li").contains(status).click(); diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index c53bb22fe5e..c8046a39a9e 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -1,5 +1,6 @@ export class PatientConsultationPage { selectConsultationStatus(status: string) { + cy.wait(5000); cy.get("#route_to_facility").scrollIntoView(); cy.get("#route_to_facility").should("be.visible"); cy.clickAndSelectOption("#route_to_facility", status); @@ -109,6 +110,7 @@ export class PatientConsultationPage { "#consultation-buttons", "Edit Consultation Details", ); + cy.wait(3000); } interceptPatientDetailsAPI(): void { diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts index 7ebcc50d74b..217f5a534e2 100644 --- a/cypress/pageobject/Patient/PatientCreation.ts +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -14,6 +14,7 @@ export class PatientPage { cy.get("#name").click().type(patientName); cy.intercept("GET", "**/api/v1/consultation/**").as("getPatient"); cy.get("#patient-name-list").contains(patientName).click(); + cy.wait(3000); cy.wait("@getPatient").its("response.statusCode").should("eq", 200); cy.get("#patient-name-consultation") .should("be.visible") diff --git a/cypress/pageobject/Patient/PatientDoctorNotes.ts b/cypress/pageobject/Patient/PatientDoctorNotes.ts index 203c99703d9..5eac457fe8c 100644 --- a/cypress/pageobject/Patient/PatientDoctorNotes.ts +++ b/cypress/pageobject/Patient/PatientDoctorNotes.ts @@ -5,6 +5,7 @@ export class PatientDoctorNotes { } addDiscussionNotes(notes: string) { + cy.wait(3000); cy.get("#discussion_notes_textarea").scrollIntoView(); cy.get("#discussion_notes_textarea").click().type(notes); } diff --git a/cypress/pageobject/Patient/PatientFileupload.ts b/cypress/pageobject/Patient/PatientFileupload.ts index 4fb9699f3f3..59e2b3798af 100644 --- a/cypress/pageobject/Patient/PatientFileupload.ts +++ b/cypress/pageobject/Patient/PatientFileupload.ts @@ -35,6 +35,7 @@ export class PatientFileUpload { } verifyUploadFilePresence(fileName: string) { + cy.wait(3000); cy.get("#file-div").scrollIntoView(); cy.verifyContentPresence("#file-div", [fileName]); } diff --git a/cypress/pageobject/Patient/PatientLogupdate.ts b/cypress/pageobject/Patient/PatientLogupdate.ts index a72b597d3ae..c82c246495e 100644 --- a/cypress/pageobject/Patient/PatientLogupdate.ts +++ b/cypress/pageobject/Patient/PatientLogupdate.ts @@ -2,6 +2,7 @@ class PatientLogupdate { clickLogupdate() { cy.get("#log-update").scrollIntoView(); cy.verifyAndClickElement("#log-update", "Log Update"); + cy.wait(3000); } clickSwitchBed() { @@ -15,6 +16,7 @@ class PatientLogupdate { selectBed(bed: string) { cy.typeAndSelectOption("input[name='bed']", bed); cy.get("#update-switchbed").click(); + cy.wait(3000); } selectPatientCategory(category: string) { @@ -76,6 +78,7 @@ class PatientLogupdate { cy.get(element).scrollIntoView(); cy.verifyContentPresence(element, [patientCategory]); cy.get(element).first().contains("View Details").click(); + cy.wait(3000); } clickLogUpdateUpdateLog(element: string, patientCategory: string) { @@ -86,6 +89,7 @@ class PatientLogupdate { clickUpdateDetail() { cy.verifyAndClickElement("#consultation-preview", "Update Details"); + cy.wait(3000); } clearIntoElementById(elementId) { diff --git a/cypress/pageobject/Patient/PatientTransfer.ts b/cypress/pageobject/Patient/PatientTransfer.ts index 5ad49b40b5f..d4884664f60 100644 --- a/cypress/pageobject/Patient/PatientTransfer.ts +++ b/cypress/pageobject/Patient/PatientTransfer.ts @@ -19,11 +19,13 @@ class PatientTransfer { clickTransferSubmitButton() { cy.get("#submit-transferpatient").click(); + cy.wait(3000); } clickConsultationCancelButton() { cy.get("#cancel").scrollIntoView(); cy.get("#cancel").click(); + cy.wait(3000); } clickAllowPatientTransferButton() { From f5734f63abfae498728511797103a2a64443f932 Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Tue, 26 Nov 2024 15:40:06 +0530 Subject: [PATCH 4/5] Added intercept in Facility Inventory --- cypress/e2e/facility_spec/FacilityCreation.cy.ts | 2 +- cypress/e2e/facility_spec/FacilityHomepage.cy.ts | 1 - cypress/e2e/facility_spec/FacilityInventory.cy.ts | 9 +++++++-- .../patient_spec/PatientConsultationCreation.cy.ts | 1 - .../patient_spec/PatientConsultationDischarge.cy.ts | 4 ---- cypress/e2e/patient_spec/PatientLogUpdate.cy.ts | 2 -- cypress/e2e/patient_spec/PatientRegistration.cy.ts | 4 ---- cypress/e2e/users_spec/UsersCreation.cy.ts | 1 - cypress/e2e/users_spec/UsersManage.cy.ts | 3 --- cypress/pageobject/Facility/FacilityCreation.ts | 9 +++------ cypress/pageobject/Patient/PatientConsultation.ts | 2 -- cypress/pageobject/Patient/PatientCreation.ts | 1 - cypress/pageobject/Patient/PatientFileupload.ts | 13 +++++-------- cypress/pageobject/Patient/PatientLogupdate.ts | 4 ---- cypress/pageobject/Patient/PatientTransfer.ts | 2 -- 15 files changed, 16 insertions(+), 42 deletions(-) diff --git a/cypress/e2e/facility_spec/FacilityCreation.cy.ts b/cypress/e2e/facility_spec/FacilityCreation.cy.ts index 5fd988480fc..ca7aa007694 100644 --- a/cypress/e2e/facility_spec/FacilityCreation.cy.ts +++ b/cypress/e2e/facility_spec/FacilityCreation.cy.ts @@ -201,7 +201,7 @@ describe("Facility Creation", () => { facilityPage.clickManageFacilityDropdown(); facilityPage.clickDeleteFacilityOption(); facilityPage.confirmDeleteFacility(); - cy.verifyNotification("Facility deleted successfully"); + cy.verifyNotification(`${facilityName} deleted successfully`); }); it("Create a new facility with single bed and doctor capacity", () => { diff --git a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts index f4c7aaa90a0..30e817a6521 100644 --- a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts +++ b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts @@ -156,7 +156,6 @@ describe("Facility Homepage Function", () => { facilityNotify.verifyPostNotificationReq(); cy.verifyNotification("Facility Notified"); cy.closeNotification(); - cy.wait(2000); // Verify the frontend error on empty message facilityHome.clickFacilityNotifyButton(); facilityNotify.verifyFacilityName(facilityName); diff --git a/cypress/e2e/facility_spec/FacilityInventory.cy.ts b/cypress/e2e/facility_spec/FacilityInventory.cy.ts index 056f05d94ae..bad36303973 100644 --- a/cypress/e2e/facility_spec/FacilityInventory.cy.ts +++ b/cypress/e2e/facility_spec/FacilityInventory.cy.ts @@ -25,10 +25,13 @@ describe("Inventory Management Section", () => { it("Add New Inventory | Modify data and delete last entry ", () => { // add a new item + cy.intercept("GET", "/api/v1/items/**").as("getItems"); facilityPage.clickManageInventory(); + cy.wait("@getItems").its("response.statusCode").should("eq", 200); facilityPage.fillInventoryDetails("PPE", "Add Stock", "10"); facilityPage.clickAddInventory(); facilityPage.verifySuccessNotification("Inventory created successfully"); + cy.closeNotification(); facilityPage.clickManageInventory(); // modify the new item facilityPage.fillInventoryDetails("PPE", "Use Stock", "5"); @@ -45,7 +48,6 @@ describe("Inventory Management Section", () => { // verify the last entry deletion facilityPage.verifyStockInRow("#row-0", "Added Stock"); facilityPage.verifyStockInRow("#row-1", "Used Stock"); - cy.wait(2000); facilityHome.navigateBack(); facilityPage.verifyPpeQuantity("PPE"); }); @@ -59,9 +61,12 @@ describe("Inventory Management Section", () => { cy.closeNotification(); // Verify Backend minimum badge facilityPage.verifyBadgeWithText(".badge-danger", "Low Stock"); + cy.intercept("GET", "**/api/v1/facility/*/min_quantity/**").as( + "getMinQuantity", + ); // modify with manual minimum badge facilityPage.clickAddMinimumQuanitity(); - cy.wait(3000); + cy.wait("@getMinQuantity").its("response.statusCode").should("eq", 200); cy.get("body").then(($body) => { if ($body.find("#update-minimum-quantity").is(":visible")) { // If the 'update-minimum-quantity' element is visible, click it diff --git a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts index 3eacd9b718f..8bb134d1127 100644 --- a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts +++ b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts @@ -105,7 +105,6 @@ describe("Patient Consultation in multiple combination", () => { patientPrescription.enterDosage("3"); patientPrescription.selectDosageFrequency("Twice daily"); cy.clickSubmitButton("Submit"); - cy.wait(2000); cy.verifyNotification("Medicine prescribed"); patientPrescription.clickReturnToDashboard(); // Verify the data's across the dashboard diff --git a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts index 9e234c860da..1b816557e9f 100644 --- a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts +++ b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts @@ -76,10 +76,8 @@ describe("Patient Discharge based on multiple reason", () => { patientDischarge.clickClearButton(); // select a non-registered facility and perform the discharge patientDischarge.typeReferringFacility(referringFreetextFacility); - cy.wait(2000); cy.clickSubmitButton("Confirm Discharge"); cy.clickSubmitButton("Acknowledge & Submit"); - cy.wait(2000); cy.verifyNotification("Patient Discharged Successfully"); cy.closeNotification(); // Verify the consultation dashboard reflection @@ -106,12 +104,10 @@ describe("Patient Discharge based on multiple reason", () => { patientPrescription.selectDosageFrequency("Twice daily"); cy.clickSubmitButton("Submit"); cy.verifyNotification("Medicine prescribed"); - cy.wait(2000); cy.closeNotification(); // submit the discharge pop-up cy.clickSubmitButton("Confirm Discharge"); cy.clickSubmitButton("Acknowledge & Submit"); - cy.wait(2000); cy.verifyNotification("Patient Discharged Successfully"); cy.closeNotification(); // Verify the consultation dashboard reflection diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts index cfb739c8343..a7b9e293e59 100644 --- a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts +++ b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts @@ -113,7 +113,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.closeNotification(); // Submit the doctors log update cy.clickSubmitButton("Save and Continue"); - cy.wait(2000); cy.verifyNotification("Progress Note created successfully"); cy.closeNotification(); // modify the relevant critical care log update @@ -252,7 +251,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeRhythm(patientRhythm); cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click(); cy.clickSubmitButton("Save"); - cy.wait(2000); cy.verifyNotification("Brief Update created successfully"); // Verify the card content cy.get("#basic-information").scrollIntoView(); diff --git a/cypress/e2e/patient_spec/PatientRegistration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts index f3aa4f56490..2ca9434dc1f 100644 --- a/cypress/e2e/patient_spec/PatientRegistration.cy.ts +++ b/cypress/e2e/patient_spec/PatientRegistration.cy.ts @@ -116,7 +116,6 @@ describe("Patient Creation with consultation", () => { patientPage.verifyPatientIsCreated(); // Verify the patient details patientPage.clickCancelButton(); - cy.wait(3000); patientPage.savePatientUrl(); patientPage.verifyPatientDashboardDetails( patientOneGender, @@ -154,7 +153,6 @@ describe("Patient Creation with consultation", () => { patientPage.verifyStatusCode(); patientPage.patientformvisibility(); // change the gender to female and input data to related changed field - cy.wait(2000); patientPage.selectPatientGender(patientOneUpdatedGender); patientPage.typePatientDateOfBirth(patientDateOfBirth); patientPage.clickPatientAntenatalStatusYes(); @@ -214,9 +212,7 @@ describe("Patient Creation with consultation", () => { cy.get("[data-testid=patient-details]") .contains("member id") .scrollIntoView(); - cy.wait(2000); patientInsurance.clickPatientInsuranceViewDetail(); - cy.wait(2000); patientInsurance.verifyPatientPolicyDetails( patientOneFirstSubscriberId, patientOneFirstPolicyId, diff --git a/cypress/e2e/users_spec/UsersCreation.cy.ts b/cypress/e2e/users_spec/UsersCreation.cy.ts index f495a136d97..b055a294779 100644 --- a/cypress/e2e/users_spec/UsersCreation.cy.ts +++ b/cypress/e2e/users_spec/UsersCreation.cy.ts @@ -182,7 +182,6 @@ describe("User Creation", () => { it("create new user form throwing mandatory field error", () => { userCreationPage.clickElementById("addUserButton"); userCreationPage.clickElementById("submit"); - cy.wait(2000); userCreationPage.verifyErrorMessages(EXPECTED_ERROR_MESSAGES); }); diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index 0cc87093a8e..fcbcf2fef69 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -42,11 +42,9 @@ describe("Manage User", () => { manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); - cy.wait(3000); manageUserPage.clicklinkedskillbutton(); manageUserPage.assertSkillInAddedUserSkills(linkedskill); manageUserPage.clickCloseSlideOver(); - cy.wait(5000); manageUserPage.navigateToProfile(); userCreationPage.verifyElementContainsText( "username-profile-details", @@ -68,7 +66,6 @@ describe("Manage User", () => { manageUserPage.clickAddSkillButton(); cy.verifyNotification("Skill added successfully"); cy.closeNotification(); - cy.wait(5000); manageUserPage.assertSkillInAddedUserSkills(linkedskill); manageUserPage.clickCloseSlideOver(); // verifying the doctor connect diff --git a/cypress/pageobject/Facility/FacilityCreation.ts b/cypress/pageobject/Facility/FacilityCreation.ts index 11ffa3d6318..6f0f34eb325 100644 --- a/cypress/pageobject/Facility/FacilityCreation.ts +++ b/cypress/pageobject/Facility/FacilityCreation.ts @@ -284,8 +284,7 @@ class FacilityPage { cy.get("#facility-location-button").click(); cy.wait("@mapApi").its("response.statusCode").should("eq", 200); cy.get("input#pac-input").type(location).type("{enter}"); - cy.wait(2000); - cy.get("div#map-close").click(); + cy.get("div#map-close").should("be.visible").click(); } fillMiddleWareAddress(url: string) { @@ -355,16 +354,14 @@ class FacilityPage { } fillInventoryDetails(name: string, status: string, quantity: string) { - cy.wait(2000); - cy.get("div#id").should("not.be.disabled").click(); - cy.get("div#id ul li").contains(name).click(); cy.get("div#isIncoming").click(); cy.get("div#isIncoming ul li").contains(status).click(); + cy.get("div#id").click(); + cy.get("div#id ul li").contains(name).click(); cy.get("[name='quantity']").type(quantity); } fillInventoryMinimumDetails(name: string, quantity: string) { - cy.wait(2000); cy.get("div#id").click(); cy.get("div#id ul li").contains(name).click(); cy.get("[name='quantity']").type(quantity); diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index c8046a39a9e..c53bb22fe5e 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -1,6 +1,5 @@ export class PatientConsultationPage { selectConsultationStatus(status: string) { - cy.wait(5000); cy.get("#route_to_facility").scrollIntoView(); cy.get("#route_to_facility").should("be.visible"); cy.clickAndSelectOption("#route_to_facility", status); @@ -110,7 +109,6 @@ export class PatientConsultationPage { "#consultation-buttons", "Edit Consultation Details", ); - cy.wait(3000); } interceptPatientDetailsAPI(): void { diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts index 217f5a534e2..7ebcc50d74b 100644 --- a/cypress/pageobject/Patient/PatientCreation.ts +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -14,7 +14,6 @@ export class PatientPage { cy.get("#name").click().type(patientName); cy.intercept("GET", "**/api/v1/consultation/**").as("getPatient"); cy.get("#patient-name-list").contains(patientName).click(); - cy.wait(3000); cy.wait("@getPatient").its("response.statusCode").should("eq", 200); cy.get("#patient-name-consultation") .should("be.visible") diff --git a/cypress/pageobject/Patient/PatientFileupload.ts b/cypress/pageobject/Patient/PatientFileupload.ts index 59e2b3798af..3394529ec6e 100644 --- a/cypress/pageobject/Patient/PatientFileupload.ts +++ b/cypress/pageobject/Patient/PatientFileupload.ts @@ -20,12 +20,8 @@ export class PatientFileUpload { recordAudio() { cy.get("#record-audio").click(); - cy.wait(2000); - cy.get("#start-recording").click(); - cy.wait(2000); - cy.get("#stop-recording").click(); - cy.wait(1000); - cy.get("#save-recording").click(); + cy.get("#stop-recording").should("be.enabled").click(); + cy.get("#save-recording").should("be.enabled").click(); } clickUploadAudioFile() { @@ -35,8 +31,9 @@ export class PatientFileUpload { } verifyUploadFilePresence(fileName: string) { - cy.wait(3000); - cy.get("#file-div").scrollIntoView(); + cy.get("#file-div", { timeout: 10000 }) + .scrollIntoView() + .should("be.visible"); cy.verifyContentPresence("#file-div", [fileName]); } diff --git a/cypress/pageobject/Patient/PatientLogupdate.ts b/cypress/pageobject/Patient/PatientLogupdate.ts index c82c246495e..a72b597d3ae 100644 --- a/cypress/pageobject/Patient/PatientLogupdate.ts +++ b/cypress/pageobject/Patient/PatientLogupdate.ts @@ -2,7 +2,6 @@ class PatientLogupdate { clickLogupdate() { cy.get("#log-update").scrollIntoView(); cy.verifyAndClickElement("#log-update", "Log Update"); - cy.wait(3000); } clickSwitchBed() { @@ -16,7 +15,6 @@ class PatientLogupdate { selectBed(bed: string) { cy.typeAndSelectOption("input[name='bed']", bed); cy.get("#update-switchbed").click(); - cy.wait(3000); } selectPatientCategory(category: string) { @@ -78,7 +76,6 @@ class PatientLogupdate { cy.get(element).scrollIntoView(); cy.verifyContentPresence(element, [patientCategory]); cy.get(element).first().contains("View Details").click(); - cy.wait(3000); } clickLogUpdateUpdateLog(element: string, patientCategory: string) { @@ -89,7 +86,6 @@ class PatientLogupdate { clickUpdateDetail() { cy.verifyAndClickElement("#consultation-preview", "Update Details"); - cy.wait(3000); } clearIntoElementById(elementId) { diff --git a/cypress/pageobject/Patient/PatientTransfer.ts b/cypress/pageobject/Patient/PatientTransfer.ts index d4884664f60..5ad49b40b5f 100644 --- a/cypress/pageobject/Patient/PatientTransfer.ts +++ b/cypress/pageobject/Patient/PatientTransfer.ts @@ -19,13 +19,11 @@ class PatientTransfer { clickTransferSubmitButton() { cy.get("#submit-transferpatient").click(); - cy.wait(3000); } clickConsultationCancelButton() { cy.get("#cancel").scrollIntoView(); cy.get("#cancel").click(); - cy.wait(3000); } clickAllowPatientTransferButton() { From 277fb42c07645661aae5fe10f622fea4e5148787 Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Tue, 26 Nov 2024 15:52:22 +0530 Subject: [PATCH 5/5] reverting .env file --- .env | 1 - 1 file changed, 1 deletion(-) diff --git a/.env b/.env index 2eebb6b7cd7..77e4641b8b2 100644 --- a/.env +++ b/.env @@ -8,7 +8,6 @@ REACT_PUBLIC_URL=https://care.ohc.network # Care API URL without the /api prefix REACT_CARE_API_URL=https://careapi.ohc.network -# REACT_CARE_API_URL=http://localhost:9000 # Dev envs ESLINT_NO_DEV_ERRORS=true