forked from ohcnetwork/care_fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into issues/6503/displayCNSon4k
- Loading branch information
Showing
78 changed files
with
1,348 additions
and
3,998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { HcxClaims } from "pageobject/Hcx/HcxClaims"; | ||
import { PatientConsultationPage } from "pageobject/Patient/PatientConsultation"; | ||
import PatientInsurance from "pageobject/Patient/PatientInsurance"; | ||
|
||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import { PatientPage } from "../../pageobject/Patient/PatientCreation"; | ||
|
||
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.loginAsDistrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.clearLocalStorage(/filters--.+/); | ||
cy.awaitUrl("/patients"); | ||
}); | ||
|
||
it("Verify the HCX Workflow for a patient with mocked eligibility", () => { | ||
// 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.selectPatientInsurerName( | ||
firstInsuranceIdentifier, | ||
patientInsurerName, | ||
); | ||
cy.submitButton("Save Details"); | ||
cy.verifyNotification("Patient updated successfully"); | ||
cy.closeNotification(); | ||
// Navigate to Consultation View and capture dynamic consultation ID | ||
let consultationId: string; | ||
patientConsultationPage.clickViewConsultationButton(); | ||
cy.url().then((url) => { | ||
const urlRegex = | ||
/facility\/([^/]+)\/patient\/([^/]+)\/consultation\/([^/]+)/; | ||
const match = url.match(urlRegex); | ||
if (match) { | ||
consultationId = match[3]; | ||
} | ||
}); | ||
// Intercept and mock the eligibility check response using captured consultationId | ||
cy.intercept("POST", "/api/hcx/check_eligibility", (req) => { | ||
req.reply({ | ||
statusCode: 200, | ||
body: { | ||
api_call_id: "bfa228f0-cdfa-4426-bebe-26e996079dbb", | ||
correlation_id: "86ae030c-1b33-4e52-a6f1-7a74a48111eb", | ||
timestamp: Date.now(), | ||
consultation: consultationId, | ||
policy: patientPolicyId, | ||
outcome: "Complete", | ||
limit: 1, | ||
}, | ||
}); | ||
}).as("checkEligibility"); | ||
// Raise a HCX Pre-auth | ||
patientConsultationPage.clickManagePatientButton(); | ||
patientConsultationPage.clickClaimsButton(); | ||
hcxClaims.selectEligiblePolicy(patientInsurerName); | ||
hcxClaims.verifyPolicyEligibility(); | ||
cy.verifyNotification("Checking Policy Eligibility"); | ||
cy.closeNotification(); | ||
// Confirm that the eligibility check displays as successful | ||
cy.wait("@checkEligibility").then((interception) => { | ||
const response = interception.response.body; | ||
expect(response.outcome).to.equal("Complete"); | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import LoginPage from "pageobject/Login/LoginPage"; | ||
|
||
const loginPage = new LoginPage(); | ||
const userName = "dummy_user_1"; | ||
const forgotPasswordHeading = "Forgot password?"; | ||
|
||
describe("User login workflow with correct and incorrect passwords", () => { | ||
beforeEach(() => { | ||
cy.awaitUrl("/", true); | ||
}); | ||
|
||
it("Log in as admin with correct password", () => { | ||
loginPage.loginManuallyAsDistrictAdmin(); | ||
loginPage.interceptFacilityReq(); | ||
loginPage.verifyFacilityReq(); | ||
loginPage.ensureLoggedIn(); | ||
loginPage.clickSignOutBtn(); | ||
loginPage.verifyLoginPageUrl(); | ||
}); | ||
|
||
it("Display an error when logging in as admin with incorrect password", () => { | ||
loginPage.interceptLoginReq(); | ||
loginPage.loginManuallyAsDistrictAdmin(false); | ||
loginPage.verifyLoginReq(); | ||
cy.verifyNotification("No active account found with the given credentials"); | ||
cy.closeNotification(); | ||
}); | ||
}); | ||
|
||
describe("Reset user's password using email", () => { | ||
beforeEach(() => { | ||
cy.awaitUrl("/", true); | ||
}); | ||
|
||
it("Send a password reset link and navigate back to the login page", () => { | ||
loginPage.clickForgotPasswordButton(forgotPasswordHeading); | ||
loginPage.verifyForgotPasswordHeading([forgotPasswordHeading]); | ||
loginPage.fillUserNameInForgotPasswordForm(userName); | ||
loginPage.interceptResetLinkReq(); | ||
loginPage.clickSendResetLinkBtn(); | ||
loginPage.verifyResetLinkReq(); | ||
cy.verifyNotification("Password Reset Email Sent"); | ||
cy.closeNotification(); | ||
loginPage.clickBackButton(); | ||
loginPage.verifyLoginPageUrl(); | ||
loginPage.verifyLoginButtonPresence(); | ||
}); | ||
}); |
File renamed without changes.
Oops, something went wrong.