Skip to content

Commit

Permalink
refactor cypress policy file
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Feb 4, 2024
1 parent bdb399b commit 8dfcd35
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
24 changes: 16 additions & 8 deletions cypress/e2e/patient_spec/patient_registration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,37 +146,45 @@ describe("Patient Creation with consultation", () => {
// Edit the patient consultation , select none medical history and multiple health ID
patientMedicalHistory.clickNoneMedicialHistory();
patientInsurance.clickAddInsruanceDetails();
patientInsurance.typeSubscriberId(
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"subscriber_id",
patientOneFirstSubscriberId
);
patientInsurance.typePolicyId(
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"policy_id",
patientOneFirstPolicyId
);
patientInsurance.typeInsurerId(
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_id",
patientOneFirstInsurerId
);
patientInsurance.typeInsurerName(
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_name",
patientOneFirstInsurerName
);
patientInsurance.clickAddInsruanceDetails();
patientInsurance.typeSubscriberId(
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"subscriber_id",
patientOneSecondSubscriberId
);
patientInsurance.typePolicyId(
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"policy_id",
patientOneSecondPolicyId
);
patientInsurance.typeInsurerId(
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_id",
patientOneSecondInsurerId
);
patientInsurance.typeInsurerName(
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_name",
patientOneSecondInsurerName
);
patientPage.clickUpdatePatient();
Expand Down
28 changes: 7 additions & 21 deletions cypress/pageobject/Patient/PatientInsurance.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
class PatientInsurance {
typeSubscriberId(id: string, subscriberId: string) {
cy.get(`#${id}`).within(() => {
cy.get("#subscriber_id").clear().type(subscriberId);
});
}

typePolicyId(id: string, policyid: string) {
cy.get(`#${id}`).within(() => {
cy.get("#policy_id").click().type(policyid);
});
}

typeInsurerId(id: string, insurerid: string) {
cy.get(`#${id}`).within(() => {
cy.get("#insurer_id").click().type(insurerid);
});
}

typeInsurerName(id: string, insurername: string) {
cy.get(`#${id}`).within(() => {
cy.get("#insurer_name").click().type(insurername);
typePatientInsuranceDetail(
containerId: string,
fieldId: string,
value: string
) {
cy.get(`#${containerId}`).within(() => {
cy.get(`#${fieldId}`).click().type(value);
});
}

Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default defineConfig({
port: 4000,
proxy: {
"/api": {
target: process.env.CARE_API ?? "https://careapi.ohc.network",
target: process.env.CARE_API ?? "http://192.168.0.204:9000/",
changeOrigin: true,
},
},
Expand All @@ -110,7 +110,7 @@ export default defineConfig({
port: 4000,
proxy: {
"/api": {
target: process.env.CARE_API ?? "https://careapi.ohc.network",
target: process.env.CARE_API ?? "http://192.168.0.204:9000/",
changeOrigin: true,
},
},
Expand Down

0 comments on commit 8dfcd35

Please sign in to comment.