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

working tests. #46

Merged
merged 11 commits into from
Jun 5, 2024
Prev Previous commit
Next Next commit
working athena test.
  • Loading branch information
AnalogJ committed Jun 1, 2024
commit a55252fb8911df00965a8c21d0997c075a5fc1eb
34 changes: 34 additions & 0 deletions js/e2e/src/athena_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("Athena Login Flow", async ({page}) => {
test.skip()

//get the Cerner Sandbox endpoint definition
let endpointDefinition = await getEndpointDefinition('950e9092-8ce7-4926-ad87-64616f00cb4c')
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=Fasten Health - preview");
await expect(page).toHaveTitle("Login");
await page.click("label[for='okta-signin-username']", { force: true });
await page.keyboard.type("[email protected]");
await page.click("label[for='okta-signin-password']", { force: true });
await page.keyboard.type("Password1");
await page.click("#okta-signin-submit");

// We have logged in
await page.waitForSelector("text=Select a health record");
await expect(page).toHaveTitle("Login");
await page.locator("text=Jake Medlock (you)").click();

// If successful, Fasten Lighthouse page should now be visible
await page.waitForSelector("text=Your account has been securely connected to FASTEN.");
});