Skip to content

Commit

Permalink
working CareEvolution.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jun 1, 2024
1 parent a55252f commit a25caad
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions js/e2e/src/careevolution_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { test, expect } from "@playwright/test";
import {getEndpointDefinition} from '../utils';
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url';

test("CareEvolution Login Flow", async ({page}) => {
test.skip()

//get the Cerner Sandbox endpoint definition
let endpointDefinition = await getEndpointDefinition('8b47cf7b-330e-4ede-9967-4caa7be623aa')
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("#login-button");
await page.focus("#Username");
await page.keyboard.type("CEPatient");
await page.focus("#Password");
await page.keyboard.type("CEPatient2018");
await page.click("#login-button");

// We have logged in
await page.waitForSelector("text=Whose record do you want to allow access to?");
// await expect(page).toHaveText("Authorization Request");
await page.locator("text=Fran Demoski (28)").click();
await page.click('input[value="Agree"]');

// 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 a25caad

Please sign in to comment.