A suite of end to end tests for the Accredited Programmes project using Playwright.
- Node.JS
- NPM
Install the dependencies with:
npm installAdd 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
To run the tests locally, run the following command:
npx playwright testYou can also run the tests and watch in a browser with:
npx playwright test --uiThe 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.