This repository contains end-to-end tests to cover the LAA crime forms project, using Playwright. The LAA crimes forms cover, at time of writing, the old CRM4 (prior authority applications) and CRM7 (Non-standard magistrates fee claims) forms from e-Forms. The tests perform end-to-end testing from the provider-side submission application to the, intermediate data repository (application store) and the caseworker-side assessment application.
- Node.js
- Playwright
First, clone the repository:
git clone https://github.com/username/nsm-e2e.git
Then, navigate to the project directory and install the dependencies:
cd nsm-e2e
npx playwright install
npm install
You can run the tests using the following command:
npm run e2e-test
To run the tests with UI, use:
npm run e2e-test:ui
To record a new test for a caseworker, use:
npm run e2e-test-record:caseworker
This will open the dev env for caseworker app and you will able to record a test.
To record a new test for a provider, use:
npm run e2e-test-record:provider
This will open the dev env for provider app and you will able to record a test.
It is not possible to pull from the ecr repos if working locally.
While docker-compose.yml
is set up to pull images from ECR, docker-compose.local.yml
is set up to override it to pull the source of each app from GitHub.
If you experience error messages about not being able to access ECR, you may have an out-of-date docker engine. Docker desktop should be on at least version 4.28.
If you have difficulties on a mac M1 then you can set the platform being used before building the applications.
export LOCAL_PLATFORM=linux/amd64
./run_test_local.sh
If you want a more manual approach you can build and shell into the test runner container and run them from there
# build locally on macos intel chipset
DOCKER_BUILDKIT=0 docker-compose -f docker-compose.yml -f docker-compose.local.yml up -d --build
# build locally on macos apple silicon chipset (tested on M1)
DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml -f docker-compose.local.yml up -d --build
# shell into e2e test container
docker-compose run --entrypoint sh laa-crime-forms-end-to-end-tests
# run tests, inside container (with trace, optional)
npx playwright test --trace on
Alternatively, this local build has been wrapped up in a script which you can use as follows:
# build and shell into container
./build_test_local.sh
# run the tests in the container
npx playwright test --trace on
You can extract the trace file from the container if neccessary and upload it to trace.playwright.dev to step through the test output.
The purpose of the end-to-end tests is to identify breaking changes in the LAA crime form app repositories. To achieve a simple, reusable integration an orb has therefore been published.
- Integrating end-to-end tests into other pipelines
- Suggested workflow for integration breakages
- Publishing the end-to-end test orb
This project is licensed under the MIT License.