Primary Authority Register (PAR) Automation Test
The PAR Automation Tests project is designed to automate the testing of the Primary Authority Register (PAR) application. This repository includes frameworks and test scripts for UI, API, and Accessibility testing, ensuring comprehensive coverage of functional and non-functional requirements.
UI Testing: Automated end-to-end tests for validating user workflows using Playwright and Cucumber.js.
API Testing: Automated API tests for verifying request/response interactions and data flows.
Accessibility Testing: Accessibility checks integrated with Axe Core to ensure compliance with WCAG 2.2 standards.
- Playwright: For browser automation and testing.
- Cucumber.js: For behavior-driven development (BDD) and readable test scenarios.
- Axe Core: For accessibility testing and WCAG compliance validation.
- Node.js: Runtime for running the JavaScript-based framework.
Ensure you have the following installed: Node.js (v14 or higher) npm or yarn Browsers supported by Playwright: Chromium, Firefox, Webkit, and Edge. Install dependencies by running:
npm install
Use the following npm scripts to run tests on specific browsers: Default Browser (Chromium):
npm run ui:tests
Firefox:
npm run ui:tests:firefox
Safari:
npm run ui:tests:safari
Microsoft Edge:
npm run ui:tests:edge
You can also run tests on emulated mobile devices:
iPhone 12
npm run ui:tests:iphone
Android (Pixel 5):
npm run ui:tests:andriod
iPad Pro 11:
npm run ui:tests:ipad
To execute tests in parallel, use the --parallel flag in the scripts. For example:
--parallel 2
By default, tests run against the test environment. You can specify different environments using the NODE_ENV variable: Test Environment:
NODE_ENV=test
Dev Environment:
NODE_ENV=dev
Stage Environment:
NODE_ENV=stage
Ensure you have corresponding .env. files configured for each environment.
npm run api:tests
Test reports are generated in the playwright/report/ directory:
npm run customised:cucumber:report
JSON Report: playwright/report/report.json
Videos: playwright/report/video/
Screenshots: playwright/report/screenshots/
These reports can be used for debugging and sharing test results with stakeholders.