Skip to content

trivir/journey-tests-template

Repository files navigation

Journey Tests Template

This repository provides a template for creating and managing journey tests for Ping AIC using TypeScript and the TypeScript Journey Testing Framework.

Features

  • Example test cases
  • Use the provided runJourney function for the most common test cases
  • Use the provided utils to write more complicated tests when needed

Getting Started

  1. Clone the repository:

    git clone ssh://[email protected]:trivir/journey-tests-template.git
  2. Install dependencies:

    npm install
  3. Create a Ping AIC service account

  4. Create a GMAIL App password / account

  5. Setup your ping-aic-lib-ts.config.json file

  6. Create your tests using the example tests as a guide

  7. Run the tests:

    npm test

Setup Service Account

A service account is needed to run the tests. To set one up:

  1. Login to the PingOne Advanced Identity Cloud tenant
  2. Click profile icon in upper right corner to access the TENANT menu
  3. Click Tenant settings
  4. Click Global Settings
  5. Click Service Accounts
  6. Click New Service Account
  7. Give it a Name and optional Description
  8. For scopes, select fr:am:* and fr:idm:*
  9. Click Save
  10. Save the ID and Private Key (download it) somewhere secure (this is the only time you can access the Private Key)
  11. Click Done
  12. Set the SERVICE_ACCOUNT_ID and SERVICE_ACCOUNT_JWK_PATH config variables with the service account ID and the path to the service account private key JWK file respectively when running the tests or in the ping-aic-lib-ts.config.json file

See the Ping documentation for more information on setting up a service account.

Setup Gmail App Password

A Gmail account is necessary to run the tests. All emails created during testing (e.g. account lockout or OTP codes) get sent to this email. In order for the tests to read the emails (to verify that they were sent and use OTP codes), you must also provide a Gmail App Password. Here are the steps for setting it up:

  1. Go to this link while signed into your Gmail account: https://myaccount.google.com/apppasswords
  2. Enter a name for the app (e.g. Journey Tests)
  3. Take the 16 letter generated app password and store it somewhere secure (this is the only time you will be able to access it)
  4. Click Done
  5. Set the GMAIL and GMAIL_APP_PASSWORD config variables with the Gmail address and the newly generated Gmail App Password from step 3 respectively when running the tests or in the ping-aic-lib-ts.config.json file

See Google's help center page for more information on setting up Gmail app passwords.

ping-aic-lib-ts.config.json

    "BASE_URL": The default base url for the tenant you wish to test against, ex: "https://my-tenant.forgeblocks.com"

    "REALM": The default realm that you wish to test against, ex: "alpha"
  
    "SERVICE_ACCOUNT_ID": The service account id that is used to access the tenant you are testing against, ex: "ff16a18b-5ad8-4971-a6ca-72de0e088aa4 "
  
    "SERVICE_ACCOUNT_CLIENT_ID": The service acount client id, ex: "service-account",
  
    "SERVICE_ACCOUNT_SCOPE": The scope of the service account, ex: "fr:am:* fr:idm:*",
  
    "SERVICE_ACCOUNT_JWK_PATH": The path to the privateKey fro the service accoutn, ex: "./privateKey.jwk",
  
    "COOKIE_NAME": Cookie name for the tenant, ex: "amlbcookie",
  
    "GMAIL": The gmail email address to be used when running tests: ex: "[email protected]",
  
    "GMAIL_APP_PASSWORD": The app password to the gmail account used above, ex: "abcd efgh ijkl mnop"
    
    "DEBUG_LOGS": If enabled, more log information will be provided when running the tests, ex: false

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published