From dab6dabeb3d4ad2b25313866e8d8b9805020f9f8 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:07:38 +0530 Subject: [PATCH] removed the external result patient creation cypress test --- .../patient_spec/patient_registration.cy.ts | 28 ------------------- cypress/pageobject/Patient/PatientExternal.ts | 28 ------------------- 2 files changed, 56 deletions(-) delete mode 100644 cypress/pageobject/Patient/PatientExternal.ts diff --git a/cypress/e2e/patient_spec/patient_registration.cy.ts b/cypress/e2e/patient_spec/patient_registration.cy.ts index f94dbbe46cd..80825de45a1 100644 --- a/cypress/e2e/patient_spec/patient_registration.cy.ts +++ b/cypress/e2e/patient_spec/patient_registration.cy.ts @@ -4,7 +4,6 @@ import { PatientPage } from "../../pageobject/Patient/PatientCreation"; import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import { generatePhoneNumber } from "../../pageobject/utils/constants"; import PatientTransfer from "../../pageobject/Patient/PatientTransfer"; -import PatientExternal from "../../pageobject/Patient/PatientExternal"; import PatientInsurance from "../../pageobject/Patient/PatientInsurance"; import PatientMedicalHistory from "../../pageobject/Patient/PatientMedicalHistory"; @@ -34,7 +33,6 @@ describe("Patient Creation with consultation", () => { const patientPage = new PatientPage(); const facilityPage = new FacilityPage(); const patientTransfer = new PatientTransfer(); - const patientExternal = new PatientExternal(); const patientInsurance = new PatientInsurance(); const patientMedicalHistory = new PatientMedicalHistory(); const phone_number = generatePhoneNumber(); @@ -70,7 +68,6 @@ describe("Patient Creation with consultation", () => { const patientTransferPhoneNumber = "9849511866"; const patientTransferFacility = "Dummy Shifting Center"; const patientTransferName = "Dummy Patient 10"; - const patientExternalName = "Patient 20"; const patientOccupation = "Student"; before(() => { @@ -286,31 +283,6 @@ describe("Patient Creation with consultation", () => { ); }); - it("Patient Registration using External Result Import", () => { - // copy the patient external ID from external results - cy.awaitUrl("/external_results"); - patientExternal.verifyExternalListPatientName(patientExternalName); - patientExternal.verifyExternalIdVisible(); - // cypress have a limitation to work only asynchronously - // import the result and create a new patient - let extractedId = ""; - cy.get("#patient-external-id") - .invoke("text") - .then((text) => { - extractedId = text.split("Care external results ID: ")[1]; - cy.log(`Extracted Care external results ID: ${extractedId}`); - cy.awaitUrl("/patients"); - patientPage.createPatient(); - patientPage.selectFacility(patientFacility); - patientPage.patientformvisibility(); - patientExternal.clickImportFromExternalResultsButton(); - patientExternal.typeCareExternalResultId(extractedId); - patientExternal.clickImportPatientData(); - }); - // verify the patient is successfully created - patientExternal.verifyExternalPatientName(patientExternalName); - }); - afterEach(() => { cy.saveLocalStorage(); }); diff --git a/cypress/pageobject/Patient/PatientExternal.ts b/cypress/pageobject/Patient/PatientExternal.ts deleted file mode 100644 index 138c212a377..00000000000 --- a/cypress/pageobject/Patient/PatientExternal.ts +++ /dev/null @@ -1,28 +0,0 @@ -class PatientExternal { - verifyExternalListPatientName(patientName: string) { - cy.get("#external-result-table").contains(patientName).click(); - } - - verifyExternalIdVisible() { - cy.get("#patient-external-id").contains("Care external results ID"); - } - - clickImportFromExternalResultsButton() { - cy.get("#import-externalresult-button").click(); - } - - typeCareExternalResultId(externalId) { - cy.get("#care-external-results-id").scrollIntoView(); - cy.get("#care-external-results-id").should("be.visible"); - cy.get("#care-external-results-id").type(externalId); - } - - clickImportPatientData() { - cy.get("#submit-importexternalresult-button").click(); - } - - verifyExternalPatientName(patientName: string) { - cy.get("#name", { timeout: 10000 }).should("have.value", patientName); - } -} -export default PatientExternal;