Skip to content

Commit 2c2e1be

Browse files
authored
Merge pull request #882 from microsoft/accessibility-insights
Accessibility insights
2 parents dfa373d + 0c8407f commit 2c2e1be

10 files changed

Lines changed: 1704 additions & 52 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
NEXT_ENV_DESCRIPTOR=production \
3232
NEXT_ONE_DS_INSTRUMENTATION_KEY=b341ec446e65436485df678003ce82f7-1d36a7a4-ef54-4cf0-93eb-ba18b3241d36-7404 \
3333
npm run build
34+
- name: "Install Playwright browser"
35+
run: npx playwright install --with-deps chromium
36+
- name: "Run automated accessibility checks"
37+
env:
38+
A11Y_USE_EXISTING_BUILD: '1'
39+
run: npm run a11y -- --reporter=line
3440
- name: "Stamp content.json"
3541
env:
3642
GITSHA: ${{ github.sha }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ typings/
9090

9191
# Next.js build output
9292
.next
93+
playwright-report/
94+
test-results/
9395

9496
# Nuxt.js build / generate output
9597
.nuxt

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,14 @@ npm install
9191
npm run dev
9292
```
9393

94+
To run the automated accessibility checks for the primary site pages:
95+
96+
```sh
97+
npm run a11y:install
98+
npm run a11y
99+
```
100+
101+
The accessibility check builds the exported site, serves the generated `out/` folder locally, and runs axe-based checks in Chromium against the main routes. In CI, the workflow reuses the existing build output instead of rebuilding.
102+
94103
The `Dockerfile` is available to host a local `nginx` version of the static site,
95104
although dynamic site features are not available when running local.

next-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
import "./.next/types/routes.d.ts";
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

0 commit comments

Comments
 (0)