Skip to content

OfficeForProductSafetyAndStandards/par-automation-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

par-automation-tests

Primary Authority Register (PAR) Automation Test

Overview

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.

Key Features

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.

Tools and Technologies

  • 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.

Running Tests

Prerequisites

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

Running Tests on Different Browsers

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

Running Tests on Devices

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

Running Tests in Parallel

To execute tests in parallel, use the --parallel flag in the scripts. For example:

 --parallel 2

Running Tests on Different Environments

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.

Running API tests

npm run api:tests

Generating Reports

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.

About

Primary Authority Register (PAR) Automation Test

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published