-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
allscripts_test.ts
32 lines (26 loc) · 1.38 KB
/
allscripts_test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { test, expect } from "@playwright/test";
import {getEndpointDefinition} from '../utils';
import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url';
test("Allscripts Login Flow", async ({page}) => {
test.skip()
//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.");
});