-
-
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.
adding maximeyes onemedical and practicefusion.
- Loading branch information
Showing
6 changed files
with
158 additions
and
2 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
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,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'}})}`); | ||
} | ||
}); |
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