Skip to content

Commit

Permalink
Axe Utility Class (#25)
Browse files Browse the repository at this point in the history
<!-- markdownlint-disable-next-line first-line-heading -->
## Description

<!-- Describe your changes in detail. -->

This change introduces the ability to execute axe-core accessibility
scanning against a page under test.

<!-- Why is this change required? What problem does it solve? -->

This provides the ability to conduct initial scanning of any pages to
determine if any accessibility issues exist.

## Type of changes

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply. -->

- [ ] Refactoring (non-breaking change)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would change existing
functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->

- [ ] I am familiar with the [contributing
guidelines](../docs/CONTRIBUTING.md)
- [x] I have followed the code style of the project
- [x] I have added tests to cover my changes
- [x] I have updated the documentation accordingly
- [ ] This PR is a result of pair or mob programming

---

## Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others
privacy, we kindly ask you to NOT including [PII (Personal Identifiable
Information) / PID (Personal Identifiable
Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public)
or any other sensitive data in this PR (Pull Request) and the codebase
changes. We will remove any PR that do contain any sensitive
information. We really appreciate your cooperation in this matter.

- [x] I confirm that neither PII/PID nor sensitive data are included in
this PR and the codebase changes.
  • Loading branch information
davethepunkyone authored Nov 5, 2024
1 parent 0072e06 commit 751ddbd
Show file tree
Hide file tree
Showing 45 changed files with 33,219 additions and 2,361 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ indent_size = 4

[{Makefile,*.mk,go.mod,go.sum,*.go,.gitmodules}]
indent_style = tab

[{axe.js,axe.min.js}]
charset = unset
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_style = unset
indent_size = unset
42 changes: 42 additions & 0 deletions .github/actions/check-axe-version/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Check axe-core version"
description: "Checks if our copy of axe-core is up to date"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Create dependency update branch
run: |
git checkout -b axe-dependency-check
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: Install axe-core in temp dir
run: |
cd utils/resouces
mkdir temp
cd temp
npm install axe-core
- name: Retrieve axe.js file
run: |
cd node_modules/axe-core
mv axe.js ../../../
- name: Remove temp directory
run: |
cd ../../../
rm -rf temp
- name: Stage & commit file
run: |
git stage axe.js
git diff-index --quiet HEAD || (git commit -a -m "axe.js scheduled update" --allow-empty)
- name: Push changes to branch
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.PUSH_TOKEN }}
branch: axe-dependency-check
11 changes: 11 additions & 0 deletions .github/workflows/axe-dependency-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Run Axe Dependency Check

on: [workflow_dispatch]

jobs:
axe-dependency-check:
name: "Axe Version Check"
timeout-minutes: 10
steps:
- name: "Axe Version Check"
uses: ./.github/actions/check-axe-version
4 changes: 3 additions & 1 deletion .github/workflows/stage-3-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:

jobs:
run-tests:
name: "Run Example Tests"
name: "Run Util & Example Tests"
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
Expand All @@ -45,6 +45,8 @@ jobs:
pip install -r requirements.txt
- name: Ensure browsers are installed
run: python -m playwright install --with-deps
- name: Run util tests
run: pytest -m "utils" --ignore=tests/
- name: Run example tests
run: pytest
- uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
__pycache__/
.pytest_cache/
test-results/
axe-reports/
7 changes: 7 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This allows for the ignoring of secret scanning against axe-core, as whilst it is in our code base we don't control it

[allowlist]
description = "global allow list"
paths = [
'''(.*?)(axe.js|axe.min.js)'''
]
147 changes: 147 additions & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,150 @@
# SEE: https://github.com/gitleaks/gitleaks/blob/master/README.md#gitleaksignore

cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:generic-api-key:37

22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.min.js:ipv4:12
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30726
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30726
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30745
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30776
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30785
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30799
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30814
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30839
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30839
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30849
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30859
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30874
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30888
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30901
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30915
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30925
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30940
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30954
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30969
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:30987
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31002
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31029
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31041
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31055
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31064
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31080
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31110
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31119
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31136
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31190
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31220
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31236
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31252
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31261
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31284
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31347
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31356
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31379
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31390
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31423
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31437
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31452
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31474
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31502
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31522
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31522
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31541
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31566
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31685
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31699
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31699
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31714
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31729
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31738
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31764
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31797
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31811
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31823
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31839
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31854
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31918
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31946
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31946
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31955
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31969
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:31987
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:32001
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:32032
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:32061
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:32070
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:32080
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:32089
22f37d6142c38c017ed7f378a3661a0a839279b3:utils/resources/axe.js:ipv4:32103
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ NOTE: This project is currently under initial development so isn't finalised, bu
- [Prerequisites](#prerequisites)
- [Configuration](#configuration)
- [Getting Started](#getting-started)
- [Utilities](#utilities)
- [Contacts](#contacts)
- [Licence](#licence)

Expand Down Expand Up @@ -66,6 +67,15 @@ We've also created a [Quick Reference Guide](./docs/getting-started/Quick_Refere

For additional reading and guidance on writing tests, we also recommend reviewing the [Playwright Python documentation](https://playwright.dev/python/docs/writing-tests).

## Utilities

This blueprint also provides the following utility classes, that can be used to aid in testing:

|Utility|Description|
|-------|-----------|
|[Axe](./docs/utility-guides/Axe.md)|Accessibility scanning using axe-core.|
|NHSNumberTools|Basic tools for working with NHS numbers.|

## Contacts

If you have any queries regarding this blueprint, please contact [[email protected]](mailto:[email protected]).
Expand Down
Loading

0 comments on commit 751ddbd

Please sign in to comment.