Install pa11y-ci

This commit is contained in:
Ryan Ahearn
2022-08-30 10:31:48 -04:00
parent 0213598bf8
commit dfea3ac848
5 changed files with 37 additions and 2 deletions

View File

@@ -81,3 +81,17 @@ jobs:
allow_issue_writing: false
rules_file_name: 'zap.conf'
cmd_options: '-I'
a11y-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-project
- name: Run server
run: make run-flask &
env:
NOTIFY_ENVIRONMENT: scanning
- name: Install pa11y-ci
run: npm install -g pa11y-ci
- name: Run pa11y-ci
run: pa11y-ci

9
.pa11yci Normal file
View File

@@ -0,0 +1,9 @@
{
"defaults": {
"standard": "WCAG2AA",
"runners": ["axe"]
},
"urls": [
"http://localhost:6012"
]
}

View File

@@ -86,6 +86,11 @@ static-scan:
pip install bandit
bandit -r app/
.PHONY: a11y-scan
a11y-scan:
npm install -g pa11y-ci
pa11y-ci
.PHONY: clean
clean:
rm -rf node_modules cache target ${CF_MANIFEST_PATH}

View File

@@ -18,7 +18,7 @@ Open the notifications-admin repo in VS Code (File->Open Folder, select notifica
create a .env file as detailed in the .env Setup section below
Using VS Code's command pallette (cmd+shift+p), search "Remote Containers: Open folder in Container..."
Using VS Code's command pallette (cmd+shift+p), search "Remote Containers: Open folder in Container..."
choose devcontainer-admin folder (note: this is a subfolder of notifications-admin/). This will open a new window, closing the current one in the process. After the new window loads, hit "show logs" link in the bottom-right. If this is the first build it will take a few minutes to create the image. The process completes shortly after running gulp.js and compiling front-end files.
@@ -52,6 +52,13 @@ npm run test-watch
To run a specific JavaScript test, you'll need to copy the full command from `package.json`.
## Running a11y-scans locally
Unlike most of the tests and scans, pa11y-ci cannot currently be run from within the VSCode dev container.
1. Run `make run-flask` from within the devcontainer
2. Run `make a11y-scan` from your host computer.
## Further docs [STILL UK DOCS]
- [Working with static assets](docs/static-assets.md)

View File

@@ -102,7 +102,7 @@ class Config(object):
class Development(Config):
ADMIN_BASE_URL = 'http://localhost:6012'
BASIC_AUTH_FORCE = True
BASIC_AUTH_FORCE = False
NOTIFY_LOG_PATH = 'application.log'
DEBUG = True
SESSION_COOKIE_SECURE = False