/hmpps-approved-premises-e2e

End to End Tests for the Approved Premises project

Primary LanguageTypeScriptMIT LicenseMIT

Approved Premises End to End tests

A suite of end to end tests for the Approved Premises project using Playwright.

Getting started

We strongly recommend using the VS Code Playwright plugin and use the plugin's commands.

Prerequisites

  • Node.JS
  • NPM

Setup

Install the dependencies with:

npm install
npm run install-playwright

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

Against the Development environment

To run the tests locally against the MoJ Cloud Platform Development environment, run the following command:

npm run test

or;

npm run test:ui

To run using the Playwright user interface

Against your local enviroment

Assuming you have the UI, API and all other required systems running using the ap-tools project, you can run the tests against your local environment with the following command:

npm run test:local

or;

npm run test:local:ui

To run using the Playwright user interface.

Local variables are contained in the local project in playwright.config.ts.