Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rylew1 committed Jul 1, 2024
1 parent 63bb86a commit a65a5fb
Show file tree
Hide file tree
Showing 6 changed files with 2,372 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci-app-accessibility-tests.yml
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
16 changes: 16 additions & 0 deletions app/.pa11yci-desktop.json
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"
]
}
}
23 changes: 23 additions & 0 deletions app/.pa11yci-mobile.json
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"
]
}
}
Loading

0 comments on commit a65a5fb

Please sign in to comment.