-
-
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.
fixing tests, sending to Browserstack.
- Loading branch information
Showing
16 changed files
with
484 additions
and
441 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 |
---|---|---|
|
@@ -2,30 +2,40 @@ import { test, expect } from "@playwright/test"; | |
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
|
||
test.skip("Allscripts Login Flow", async ({page}) => { | ||
//get the Allscripts - Veradigm Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('7682675b-8247-4fda-b2cd-048bfeafc8af') | ||
let authorizeData = await generateSourceAuthorizeUrl(endpointDefinition) | ||
|
||
// authorizeData.sourceState | ||
console.log(authorizeData.url.toString()) | ||
|
||
await page.goto(authorizeData.url.toString()); | ||
|
||
// We are on login page | ||
await page.waitForSelector("text=Allscripts Health Connect Core"); | ||
await expect(page).toHaveTitle("Allscripts FHIR Authorization - "); | ||
await page.focus("#username"); | ||
await page.keyboard.type("[email protected]"); | ||
await page.focus("#passwordEntered"); | ||
await page.keyboard.type("Allscripts#1"); | ||
await page.click("#local-login"); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=Uncheck the permissions you do not wish to grant."); | ||
await expect(page).toHaveTitle("Allscripts FHIR Authorization - "); | ||
await page.click('button[value="yes"]'); | ||
|
||
// If successful, Fasten Lighthouse page should now be visible | ||
await page.waitForSelector("text=Your account has been securely connected to FASTEN."); | ||
test("Allscripts 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 Allscripts - Veradigm Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('7682675b-8247-4fda-b2cd-048bfeafc8af') | ||
let authorizeData = await generateSourceAuthorizeUrl(endpointDefinition) | ||
|
||
// authorizeData.sourceState | ||
console.log(authorizeData.url.toString()) | ||
|
||
await page.goto(authorizeData.url.toString()); | ||
|
||
// We are on login page | ||
await page.waitForSelector("text=Allscripts Health Connect Core"); | ||
await expect(page).toHaveTitle("Allscripts FHIR Authorization - "); | ||
await page.focus("#username"); | ||
await page.keyboard.type("[email protected]"); | ||
await page.focus("#passwordEntered"); | ||
await page.keyboard.type("Allscripts#1"); | ||
await page.click("#local-login"); | ||
|
||
// We have logged in | ||
await page.waitForSelector("text=Uncheck the permissions you do not wish to grant."); | ||
await expect(page).toHaveTitle("Allscripts FHIR Authorization - "); | ||
await page.click('button[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 |
---|---|---|
|
@@ -2,31 +2,40 @@ import { test, expect } from "@playwright/test"; | |
import {getEndpointDefinition} from '../utils'; | ||
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; | ||
|
||
test.skip("Athena Login Flow", async ({page}) => { | ||
//get the Cerner Sandbox endpoint definition | ||
let endpointDefinition = await getEndpointDefinition('950e9092-8ce7-4926-ad87-64616f00cb4c') | ||
let authorizeData = await generateSourceAuthorizeUrl(endpointDefinition) | ||
test("Athena 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 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()) | ||
// 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()); | ||
// 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 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(); | ||
// 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."); | ||
// 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
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
Oops, something went wrong.