Skip to content

Commit

Permalink
adding vahealth, nextgen and medicare
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jun 2, 2024
1 parent 7794fa6 commit d3f3ddf
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 0 deletions.
41 changes: 41 additions & 0 deletions js/e2e/src/medicare_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { test, expect } from "@playwright/test";
import {getEndpointDefinition} from '../utils';
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url';

test.skip("Medicare Login Flow", async ({page}) => {
//get the Cerner Sandbox endpoint definition
let endpointDefinition = await getEndpointDefinition('6ae6c14e-b927-4ce0-862f-91123cb8d774')
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=Log in");
// await expect(page).toHaveTitle("Cerner Health - Sign In");
await page.click("label[for='username-textbox']", { force: true });
await page.keyboard.type("BBUser00000");
await page.click("label[for='password-textbox']", { force: true });
await page.keyboard.type("PW00000!");
await page.click("#login-button");

//INCOMPLETE - Need to add more steps to complete the login flow

// // We have logged in
// await page.waitForSelector("text=Warning: Unknown app");
// await expect(page).toHaveTitle("Authorization Needed");
// await page.click('#proceedButton');
//
// // We are on the Select Patient page.
// await page.waitForSelector("text=SMART II, NANCY (Self, 33)");
// await expect(page).toHaveTitle("Authorization Needed");
// await page.click("label[for='12724066']", { force: true, delay: 500 });
// await page.click("#allowButton");
//
//
// // If successful, Fasten Lighthouse page should now be visible
// await page.waitForSelector("text=Your account has been securely connected to FASTEN.");
});
35 changes: 35 additions & 0 deletions js/e2e/src/nextgen_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { test, expect } from "@playwright/test";
import {getEndpointDefinition} from '../utils';
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url';

test.skip("Nextgen Login Flow", async ({page}) => {
//get the Cerner Sandbox endpoint definition
let endpointDefinition = await getEndpointDefinition('843f5c82-b4e3-43c6-8657-eff1390d7e44')
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=NextGen HealthCare");
await page.focus("#Username");
await page.keyboard.type("patientapitest");
await page.focus("#Password");
await page.keyboard.type("Password1!");
await page.click('button:text("Next")');

// We have logged in
await page.waitForSelector("text=Connect to Fasten Health - Sandbox");
await page.click('#btnAllow');

// Keep me signed in.
await page.waitForSelector("text=Connect to Fasten Health - Sandbox");
await page.click('button:text("Next")');


// If successful, Fasten Lighthouse page should now be visible
await page.waitForSelector("text=Your account has been securely connected to FASTEN.");
});
44 changes: 44 additions & 0 deletions js/e2e/src/vahealth_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { test, expect } from "@playwright/test";
import {getEndpointDefinition} from '../utils';
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url';

test.skip("VAHealth Login Flow", async ({page}) => {
//get the Cerner Sandbox endpoint definition
let endpointDefinition = await getEndpointDefinition('71fd52e3-b9fe-4e3d-b983-99711e798bd8')
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 landing page
await page.waitForSelector("text=Sign in to VA.gov");
await expect(page).toHaveTitle("Choose Login Provider");
await page.click("a.idme-signin", { force: true });

// We are on the ID.me login page
await page.waitForSelector("text=Sign in to ID.me");
await page.click("label[for='user_email']", { force: true });
await page.keyboard.type("[email protected]");
await page.click("label[for='user_password']", { force: true });
await page.keyboard.type("SandboxPassword2024!");
await page.click("input[type='submit']");

// We are on the ID.me 2FA page
await page.waitForSelector("text=Complete your sign in");
await page.click("button[type='submit']");

// We are on the ID.me 2FA Completion Page
await page.waitForSelector("text=Complete your sign in");
await page.click("button[type='submit']");

// We are on the VA.gov login page
await page.waitForSelector("text=FastenHealthIncKulatunga-1696557147");
await expect(page).toHaveTitle("Department of Veteran Affairs Evaluation - Sign In");
await page.click('button[value="Allow Access"]');

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

Please sign in to comment.