-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
|
||
test("eClinicalWorks-Healow Login Flow", async ({page}) => { | ||
|
||
//get the eClinicalWorks Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('f0a8629a-076c-4f78-b41a-7fc6ae81fa4d') | ||
let authorizeData = await generateSourceAuthorizeUrl(endpointDefinition) | ||
|
||
// authorizeData.sourceState | ||
console.log(authorizeData.url.toString()) | ||
|
||
// Start login flow by clicking on button with text "Login to MyChart" | ||
await page.goto(authorizeData.url.toString()); | ||
|
||
// We are on login page | ||
await page.waitForSelector("text=FHIR R4 Prodtest EMR"); | ||
await expect(page).toHaveTitle("healow - Health and Online Wellness"); | ||
await page.focus("#username"); | ||
await page.keyboard.type("AdultFemaleFHIR"); | ||
await page.focus("#pwd"); | ||
await page.keyboard.type("e@CWFHIR1"); | ||
await page.click("#btnLoginSubmit"); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=What you need to know about Fasten Health"); | ||
await expect(page).toHaveTitle("LoginUi"); | ||
await page.click('button:text(" Continue ")'); | ||
|
||
|
||
// We are on the agreement page | ||
await page.waitForSelector("text=Personal Information Sharing"); | ||
await expect(page).toHaveTitle("LoginUi"); | ||
await page.click('button:text-is("Approve")'); | ||
|
||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
}); |