Skip to content

Commit

Permalink
working eclinicalworks test.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jun 1, 2024
1 parent af16bbd commit 01b0472
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions js/e2e/src/eclinicalworks_test.ts
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.");
});

0 comments on commit 01b0472

Please sign in to comment.