Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working tests. #46

Merged
merged 11 commits into from
Jun 5, 2024
Merged
Prev Previous commit
Next Next commit
working cigna login.
  • Loading branch information
AnalogJ committed Jun 1, 2024
commit af16bbdd9536d70c48813373b5f0834ec0a17698
2 changes: 1 addition & 1 deletion js/e2e/src/careevolution_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {generateSourceAuthorizeUrl} from '../../src/connect/authorization-url';
test("CareEvolution Login Flow", async ({page}) => {
test.skip()

//get the Cerner Sandbox endpoint definition
//get the CareEvolution Sandbox endpoint definition
let endpointDefinition = await getEndpointDefinition('8b47cf7b-330e-4ede-9967-4caa7be623aa')
let authorizeData = await generateSourceAuthorizeUrl(endpointDefinition)

Expand Down
35 changes: 35 additions & 0 deletions js/e2e/src/cigna_test.ts
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';

test("Cigna Login Flow", async ({page}) => {
test.skip()

//get the Cerner Sandbox endpoint definition
let endpointDefinition = await getEndpointDefinition('6c0454af-1631-4c4d-905d-5710439df983')
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 share health information");
await expect(page).toHaveTitle("myCigna - Auth Flow");
await page.click("label[for='username']", { force: true });
await page.keyboard.type("syntheticuser05");
await page.click("label[for='password']", { force: true });
await page.keyboard.type("5ynthU5er5");
await page.click("button[type='submit']");

// We have logged in
await page.waitForSelector("label[for='termsAccept']");
await expect(page).toHaveTitle("myCigna - Auth Flow");
await page.click('label[for="termsAccept"]', { force: true });
await page.click('button[type="submit"]');

// If successful, Fasten Lighthouse page should now be visible
await page.waitForSelector("text=Your account has been securely connected to FASTEN.");
});