From 8d6ee9d408df04fe1a68ff063e20d0995edbbbfb Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sat, 1 Jun 2024 15:10:20 -0700 Subject: [PATCH] working allscripts test. --- js/e2e/src/aetna_test.ts | 2 +- js/e2e/src/allscripts_test.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 js/e2e/src/allscripts_test.ts diff --git a/js/e2e/src/aetna_test.ts b/js/e2e/src/aetna_test.ts index 6555be626..1fab7f819 100644 --- a/js/e2e/src/aetna_test.ts +++ b/js/e2e/src/aetna_test.ts @@ -3,7 +3,7 @@ import {getEndpointDefinition} from '../utils'; import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url'; test("Aetna Login Flow", async ({page}) => { - + test.skip() //get the Cerner Sandbox endpoint definition let endpointDefinition = await getEndpointDefinition('ac8308d1-90de-4994-bb3d-fe404832714c') let authorizeData = await generateSourceAuthorizeUrl(endpointDefinition) diff --git a/js/e2e/src/allscripts_test.ts b/js/e2e/src/allscripts_test.ts new file mode 100644 index 000000000..3dc42aca6 --- /dev/null +++ b/js/e2e/src/allscripts_test.ts @@ -0,0 +1,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("allison.allscripts@tw181unityfhir.edu"); + 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."); +});