-
-
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.
Merge pull request #48 from fastenhealth/addl_platforms
adding more tests
- Loading branch information
Showing
11 changed files
with
358 additions
and
14 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,43 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
import process from 'process'; | ||
|
||
test("DrChrono Login Flow", async ({page}, testInfo) => { | ||
try { | ||
await page.evaluate(_ => {},`browserstack_executor: ${JSON.stringify({action: "setSessionName", arguments: {name:testInfo.title}})}`); | ||
await page.waitForTimeout(5000); | ||
//get the DrChrono Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('6a01ffff-d73e-4728-a315-9b23bd77a4cc') | ||
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=Account Login"); | ||
await page.focus("#username"); | ||
await page.keyboard.type(process.env.PW_DRCHRONO_USERNAME); | ||
await page.focus("#password"); | ||
await page.keyboard.type(process.env.PW_DRCHRONO_PASSWORD); | ||
await page.click('button:text("Sign In")'); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=Charlie DeBraga"); | ||
await page.click('button:text("Select")'); | ||
|
||
// Keep me signed in. | ||
await page.waitForSelector("text=Remember My Decision"); | ||
await page.click('button:text("Yes, Allow")'); | ||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'Authentication Successful'}})}`); | ||
} catch (e) { | ||
console.log(e); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Test failed'}})}`); | ||
} | ||
}); |
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,44 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
import process from 'process'; | ||
|
||
test("DynamicHealthIT Login Flow", async ({page}, testInfo) => { | ||
try { | ||
await page.evaluate(_ => {},`browserstack_executor: ${JSON.stringify({action: "setSessionName", arguments: {name:testInfo.title}})}`); | ||
await page.waitForTimeout(5000); | ||
//get the NextGen Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('5f928520-2b73-4a47-b1a1-30ed6c3d9e9b') | ||
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=Account Login"); | ||
await page.focus("#username"); | ||
await page.keyboard.type(process.env.PW_DYNAMICHEALTHIT_USERNAME); | ||
await page.focus("#password"); | ||
await page.keyboard.type(process.env.PW_DYNAMICHEALTHIT_PASSWORD); | ||
await page.click('button:text("Sign In")'); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=RebeccaF Larson"); | ||
await page.click('button:text("Select")'); | ||
|
||
// Keep me signed in. | ||
await page.waitForSelector("text=Remember My Decision"); | ||
await page.click('button:text("Yes, Allow")'); | ||
|
||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'Authentication Successful'}})}`); | ||
} catch (e) { | ||
console.log(e); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Test failed'}})}`); | ||
} | ||
}); |
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,38 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
|
||
test("Humana Login Flow", async ({page}, testInfo) => { | ||
try { | ||
await page.evaluate(_ => {},`browserstack_executor: ${JSON.stringify({action: "setSessionName", arguments: {name:testInfo.title}})}`); | ||
await page.waitForTimeout(5000); | ||
//get the Humana Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('457d23f4-f893-4d4d-a529-83e7488de78b') | ||
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=Connect Your Health Data"); | ||
await page.focus("#username"); | ||
await page.keyboard.type("HUser00001"); | ||
await page.focus("#password"); | ||
await page.keyboard.type("PW00001!"); | ||
await page.click('button:text("Sign in")'); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=Fasten Health"); | ||
await page.click('#submitButton'); | ||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'Authentication Successful'}})}`); | ||
} catch (e) { | ||
console.log(e); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Test failed'}})}`); | ||
} | ||
}); |
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,44 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
import process from 'process'; | ||
|
||
test("MaximEyes Login Flow", async ({page}, testInfo) => { | ||
try { | ||
await page.evaluate(_ => {},`browserstack_executor: ${JSON.stringify({action: "setSessionName", arguments: {name:testInfo.title}})}`); | ||
await page.waitForTimeout(5000); | ||
//get the Maximeyes Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('f4ea79fc-9a1b-43f0-be95-24247d666514') | ||
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=Forgot my password"); | ||
await page.focus("#Username"); | ||
await page.keyboard.type(process.env.PW_MAXIMEYES_USERNAME); | ||
await page.focus("#Password"); | ||
await page.keyboard.type(process.env.PW_MAXIMEYES_PASSWORD); | ||
await page.click('input[value="Sign in"]'); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=Reed"); | ||
await page.click("input[value='Select']"); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=Access"); | ||
await page.click("input[value='Yes']"); | ||
|
||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'Authentication Successful'}})}`); | ||
} catch (e) { | ||
console.log(e); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Test failed'}})}`); | ||
} | ||
}); |
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,35 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
import process from 'process'; | ||
|
||
test("MedHost Login Flow", async ({page}, testInfo) => { | ||
try { | ||
await page.evaluate(_ => {},`browserstack_executor: ${JSON.stringify({action: "setSessionName", arguments: {name:testInfo.title}})}`); | ||
await page.waitForTimeout(5000); | ||
//get the Medhost Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('9e5d5b7a-880f-481b-8ae4-77a3d24cfa49') | ||
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=YourCare Everywhere"); | ||
await page.focus("#j_username"); | ||
await page.keyboard.type(process.env.PW_MEDHOST_USERNAME); | ||
await page.focus("#j_password"); | ||
await page.keyboard.type(process.env.PW_MEDHOST_PASSWORD); | ||
await page.click('#signin'); | ||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'Authentication Successful'}})}`); | ||
} catch (e) { | ||
console.log(e); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Test failed'}})}`); | ||
} | ||
}); |
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,39 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
import process from 'process'; | ||
|
||
test("OneMedical Login Flow", async ({page}, testInfo) => { | ||
try { | ||
await page.evaluate(_ => {},`browserstack_executor: ${JSON.stringify({action: "setSessionName", arguments: {name:testInfo.title}})}`); | ||
await page.waitForTimeout(5000); | ||
//get the OneMedical Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('c835742c-c896-4b93-beb5-28df18f16bd8') | ||
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 to continue"); | ||
await page.focus("#email"); | ||
await page.keyboard.type(process.env.PW_ONEMEDICAL_USERNAME); | ||
await page.focus("#password"); | ||
await page.keyboard.type(process.env.PW_ONEMEDICAL_PASSWORD); | ||
await page.click('#btn-login'); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=Connect Your Records"); | ||
await page.click('#scope-selection-submit'); | ||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'Authentication Successful'}})}`); | ||
} catch (e) { | ||
console.log(e); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Test failed'}})}`); | ||
} | ||
}); |
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'; | ||
import process from 'process'; | ||
|
||
test("Practice Fusion Login Flow", async ({page}, testInfo) => { | ||
try { | ||
await page.evaluate(_ => {},`browserstack_executor: ${JSON.stringify({action: "setSessionName", arguments: {name:testInfo.title}})}`); | ||
await page.waitForTimeout(5000); | ||
//get the Practice Fusion Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('8b340f03-7643-4315-9bb6-6b01e31e5402') | ||
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 scope page | ||
await page.waitForSelector("text=This application would like access to your information"); | ||
await page.click('button:text("Allow")'); | ||
|
||
// We are on login page | ||
await page.waitForSelector("text=Don't remember your password?"); | ||
await page.focus("input[name='username']"); | ||
await page.keyboard.type(process.env.PW_PRACTICEFUSION_USERNAME); | ||
await page.focus("input[name='password']"); | ||
await page.keyboard.type(process.env.PW_PRACTICEFUSION_PASSWORD); | ||
await page.click("button[name='submit']"); | ||
|
||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'Authentication Successful'}})}`); | ||
} catch (e) { | ||
console.log(e); | ||
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Test failed'}})}`); | ||
} | ||
}); |
Oops, something went wrong.