-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
2,372 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: CI App Accessibility Tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- app/** | ||
- .github/workflows/ci-a11y.yml | ||
|
||
jobs: | ||
build: | ||
name: Accessibility | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./app | ||
|
||
env: | ||
NODE_VERSION: 20 | ||
LOCKFILE_PATH: ./app/package-lock.json | ||
PACKAGE_MANAGER: npm | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache-dependency-path: ${{ env.LOCKFILE_PATH }} | ||
cache: ${{ env.PACKAGE_MANAGER }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Create screenshots directory | ||
run: mkdir -p screenshots-output | ||
|
||
- name: Build project | ||
run: npm run build | ||
|
||
- name: Start server and log output | ||
run: npm run start & | ||
|
||
- name: Wait for frontend to be ready | ||
run: | | ||
# Ensure the server wait script is executable | ||
chmod +x ./bin/wait-for-frontend.sh | ||
./bin/wait-for-frontend.sh | ||
- name: Run pa11y-ci | ||
run: | | ||
set -e # Ensure the script fails if any command fails | ||
npm run test:pa11y-desktop | ||
npm run test:pa11y-mobile | ||
echo "pa11y-ci tests finished." | ||
- name: Upload screenshots to artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: screenshots | ||
path: ./app/screenshots-output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"defaults": { | ||
"timeout": 240000, | ||
"runners": ["axe"], | ||
"ignore": ["color-contrast"], | ||
"concurrency": 1, | ||
"chromeLaunchConfig": { | ||
"ignoreHTTPSErrors": true, | ||
"args": ["--disable-dev-shm-usage", "--no-sandbox"] | ||
}, | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/desktop-main-view.png" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"defaults": { | ||
"timeout": 240000, | ||
"runners": ["axe"], | ||
"ignore": ["color-contrast"], | ||
"concurrency": 1, | ||
"chromeLaunchConfig": { | ||
"ignoreHTTPSErrors": true, | ||
"args": ["--disable-dev-shm-usage", "--no-sandbox"] | ||
}, | ||
"viewport": { | ||
"width": 390, | ||
"height": 844, | ||
"mobile": true | ||
}, | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/mobile-main-view.png", | ||
"click element .usa-navbar button", | ||
"screen capture screenshots-output/mobile-expand-menu.png" | ||
] | ||
} | ||
} |
Oops, something went wrong.