Skip to content

ministryofjustice/hmpps-accredited-programmes-e2e

Accredited Programmes End to End tests

A suite of end to end tests for the Accredited Programmes project using Playwright.

Getting started

Prerequisites

  • Node.JS
  • NPM

Setup

Install the dependencies with:

npm install

Add a .env file to the root of the project with the following variables:

HMPPS_AUTH_USERNAME= # A valid HMPPS Auth Username
HMPPS_AUTH_PASSWORD= # A valid HMPPS Auth Password

Running the tests

To run the tests locally, run the following command:

npx playwright test

You can also run the tests and watch in a browser with:

npx playwright test --ui

Running these tests on CI

The E2E test suite is currently run on the Accredited Programmes UI repository and the Accredited Programmes API repository as part of CI.

The test user is currently linked to an email address of one of the team members. This is something we should address as soon as possible, and replace with a shared service account. When running the Playwright Tests workflow in the E2E repo, the username and password are read from GitHub Actions secrets in this repository. When running the end_to_end job on CI in the Accredited Programmes UI and API repositories, they're read from the CircleCI (our current CI tool) project settings (the environment variables).

Because HMPPS Auth requires users' passwords to be reset after a certain period of time, we have to update these from time to time. After the HMPPS Auth password is updated, the corresponding GitHub Actions secret in this repo must be updated, in addition to both the UI's CircleCi environment variables UI Environment variables and the APIs CircleCI environment variables API Environment variables.

The credential rotation process is described fully here.

About

End to End Tests for the Accredited Programmes project

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7