Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Cypress Test for HCX Workflow in the platform #9007

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ ESLINT_NO_DEV_ERRORS=true
CARE_CDN_URL="https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com http://localhost:4566"
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"

REACT_ENABLED_APPS="ohcnetwork/care_livekit_fe@main"
REACT_ENABLED_APPS="ohcnetwork/care_livekit_fe@main,ohcnetwork/care_hcx_fe@main"
REACT_ENABLE_HCX=true
64 changes: 64 additions & 0 deletions cypress/e2e/hcx_spec/HcxClaims.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { PatientConsultationPage } from "pageobject/Patient/PatientConsultation";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientInsurance from "pageobject/Patient/PatientInsurance";
import { HcxClaims } from "pageobject/Hcx/HcxClaims";

describe("HCX Claims configuration and approval workflow", () => {
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientConsultationPage = new PatientConsultationPage();
const patientInsurance = new PatientInsurance();
const hcxClaims = new HcxClaims();
const hcxPatientName = "Dummy Patient 14";
const firstInsuranceIdentifier = "insurance-details-0";
const patientMemberId = "001";
const patientPolicyId = "100";
const patientInsurerName = "Demo Payor";

before(() => {
loginPage.loginAsDisctrictAdmin();
cy.saveLocalStorage();
});

beforeEach(() => {
cy.restoreLocalStorage();
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/patients");
});

it("Verify the HCX Workflow for a patient", () => {
// Modify the insurance for a facility
patientPage.visitPatient(hcxPatientName);
patientConsultationPage.clickPatientDetails();
patientPage.clickPatientUpdateDetails();
patientInsurance.clickAddInsruanceDetails();
patientInsurance.typePatientInsuranceDetail(
firstInsuranceIdentifier,
"subscriber_id",
patientMemberId,
);
patientInsurance.typePatientInsuranceDetail(
firstInsuranceIdentifier,
"policy_id",
patientPolicyId,
);
patientInsurance.selectHcxInsurer(patientInsurerName);
cy.submitButton("Save Details");
cy.verifyNotification("Patient updated successfully");
patientConsultationPage.clickViewConsultationButton();
// Raise a HCX Pre-auth
patientConsultationPage.clickManagePatientButton();
patientConsultationPage.clickClaimsButton();
hcxClaims.selectEligiblePolicy(patientInsurerName);
hcxClaims.verifyPolicyEligibity();
cy.verifyNotification("Checking Policy Eligibility");
cy.closeNotification();
// Raise a HCX Claim
// Approve the HCX from there website
});

afterEach(() => {
cy.saveLocalStorage();
});
});
9 changes: 9 additions & 0 deletions cypress/pageobject/Hcx/HcxClaims.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class HcxClaims {
selectEligiblePolicy(policy: string) {
cy.clickAndSelectOption("#select-insurance-policy", policy);
}

verifyPolicyEligibity() {
cy.verifyAndClickElement("#check-eligibity", "Check Eligibility");
}
}
16 changes: 16 additions & 0 deletions cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class PatientConsultationPage {
selectSymptomsDate(date: string) {
cy.clickAndTypeDate("#symptoms_onset_date", date);
}

clickAddSymptom() {
cy.get("#add-symptom").click();
}
Expand Down Expand Up @@ -111,4 +112,19 @@ export class PatientConsultationPage {
);
cy.wait(3000);
}

clickViewConsultationButton() {
cy.verifyAndClickElement(
"#view_consulation_updates",
"View Consultation / Consultation Updates",
);
}

clickManagePatientButton() {
cy.verifyAndClickElement("#show-more", "Manage Patient");
}

clickClaimsButton() {
cy.verifyAndClickElement("#consultation-buttons", "Claims");
}
}
4 changes: 4 additions & 0 deletions cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ export class PatientPage {
cy.visit(patient_url + "/update");
}

clickPatientUpdateDetails() {
cy.verifyAndClickElement("#update-patient-details", "Patient Details");
}

interceptFacilities() {
cy.intercept("GET", "**/facility/*/patient/**").as("getFacilities");
}
Expand Down
4 changes: 4 additions & 0 deletions cypress/pageobject/Patient/PatientInsurance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ class PatientInsurance {
}
});
}

selectHcxInsurer(insurer: string) {
cy.typeAndSelectOption("#insurer", insurer);
}
}

export default PatientInsurance;
2 changes: 2 additions & 0 deletions src/components/HCX/PolicyEligibilityCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default function HCXPolicyEligibilityCheck({
<div className={className}>
<div className="flex items-center gap-2 max-sm:flex-col">
<SelectFormField
id="select-insurance-policy"
required
name="policy"
labelClassName="hidden"
Expand Down Expand Up @@ -137,6 +138,7 @@ export default function HCXPolicyEligibilityCheck({
)}
/>
<ButtonV2
id="check-eligibity"
className="whitespace-nowrap py-3 max-sm:w-full"
onClick={checkEligibility}
disabled={
Expand Down
1 change: 1 addition & 0 deletions src/components/Patient/PatientHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ export const PatientHome = (props: any) => {
)}
<div>
<ButtonV2
id="update-patient-details"
className="mt-4 w-full"
disabled={!patientData.is_active}
authorizeFor={NonReadOnlyUsers}
Expand Down
Loading