The following Markdown files contain an up-to-date list of all test scenarios and their steps, grouped by test type:
These catalogues are automatically generated whenever new tests are added or existing tests are modified. Note: These files are automatically updated on every commit via a pre-commit hook. Once files have been updated / generated, verify contents and stage the changes to be added to PR. Run
yarn generate:test-catalogueto update them manually if needed.
- Cross-browser testing: Supports Chromium.
- Responsive testing: Test conducted on desktop viewport.
- Parallel test execution: Run tests concurrently for faster feedback.
- Accessibility tests: Integrate basic accessibility checks using libraries like Axe Core.
- Performance tests: Provides an implementation of Lighthouse which can be used for quick feedback on UI performance.
- Test tagging: Use tags like
@a11yfor accessibility,@smokefor smoke tests, and more.
The repository follows a Page Object Model (POM) design pattern, ensuring that locators and actions are well-organized and reusable.
See the POM docs for more info
├── tests/ # Test files
|
├── page-objects/ # Page objects
├ ├── components/ # Common components shared across pages
├ ├── pages/ # Unique pages that contain locators and functions
|
├── utils/ # Utility functions or common tasks (Helpers for the project
├── api-requests/ # Reusable api requests
├── fixtures.ts # Used to import corresponding fixtures from utils, page-objects and api-requests
├── global.setup.ts # Global setup logic
├── global.teardown.ts # Global teardown logic
├── playwright.config.ts # Playwright configTCoE Best Practices for setting up playwright in your service can be found in the playwright-e2e/readme.md.
We all share the responsibility of ensuring this repo is up to date and accurate in terms of best practice. If you would like to contribute you can raise a github issue with the improvement you are suggesting or raise a PR yourself. See the contribution guide for more info.
Ensure you have the following installed on your machine:
- Node.js (v14+)
- Yarn
Clone the repository and install the dependencies:
git clone https://github.com/hmcts/pre-power-app-e2e-tests.gitwithin the cloned project run the following command to install dev dependencies:
yarn installrun the following command after running yarn install in order to install playwright browsers
yarn setupRun one of the following scripts found in package.json to fetch secrets for a given environment, Ensure you have azure cli installed and logged in.
Dev
yarn load-secrets:devStaging
yarn load-secrets:stgDemo
yarn load-secrets:demoRun all tests using the Playwright test runner:
yarn playwright testTo run a specific test file:
yarn playwright test tests/specific_test_file.spec.tsYou can use tags to group tests, for example:
yarn playwright test --grep @smokeTo run tests with tracing, screenshots, and video recording for debugging purposes:
yarn playwright test --trace on --video on --screenshot onAlternatively, you can use page.pause() inside your test whilst in --headed mode to pause execution at a specific point.
Run accessibility checks as part of your tests using Axe Core:
yarn playwright test --grep @a11yConfirm docker is running and then run the following command
yarn build-containeronce this completes start the container
yarn start-containerNow run the following whilst within container
yarn playwright test