Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Interactive accessibility testing for real-world forms Runs axe-core after the clicks, key-presses and dynamic DOM changes your users actually make.

NotificationsYou must be signed in to change notification settings

badhri17/a11y-form-tester

Repository files navigation

CInpm

Interactive accessibility testing for real-world forms
Runs axe-coreafter the clicks, key-presses and dynamic DOM changes your users actually make.


Why not just run a static linter?

Static axe / Lighthousea11y-form-tester
Scans the HTML that exists on first paintRe-runs axeafter each scenario (fill, submit, tab-loop, open-modal…)
Misses fields that are revealed laterCatches missing labels, duplicate IDs, modal issues, bad autocomplete tokens, etc.
No keyboard interactionSimulates Tab navigation to surface focus-order defects

Key features

  • Plug-and-play CLInpx a11y-form-tester "dist/**/*.html"
  • Scenario engine
    • static scan →submit form → dynamic scan
    • auto-fill required fields
    • tab-loop for focus-trap checks
    • open modals / dialogs
  • Deduplicated report – one line per unique rule + element
  • Zero config CI – exits1 when violations are found
  • Type-safe – written in TypeScript, published with.d.ts

CLI usage

a11y-form-tester"<glob/of/pages/**/*.html>" [options]Options  --report<file>   Save pretty HTML report to the given path  --max<n>         Fail only when more than<n> violations (default: 0)  --rules<list>    Comma-separated axe rule IDs to run (defaults to smart subset)

Example:

npx a11y-form-tester"build/**/*.html" --report a11y.html

The CLI prints a coloured table and writesa11y.html next to your artefacts.


Real-world bugs it finds

Scenario (ships in repo)Rule triggeredWhy static scan misses it
Coupon code<select> appears after checkbox – has no labelselect-nameField not in initial DOM
Dialog injected by JavaScript lacks accessible namearia-dialog-nameDialog exists only after click
VAT ID field revealed with invalidautocomplete="tax-id"autocomplete-validAttribute not validated until shown
Clone phone field duplicatesid="phone"duplicate-idClone added after checkbox
Icon-only "help" button injected laterbutton-nameNo accessible name
Referral input relies only ontitlelabel-title-onlyField hidden until user action
Error message with poor color contrastcolor-contrastError shown only after validation
Password field missing labellabelBasic but common oversight

All eight fixtures live undertest/fixtures/ for you to try.


Add to CI in 15 seconds (GitHub Actions)

# .github/workflows/a11y.ymlname:a11yon:[push, pull_request]jobs:test:runs-on:ubuntu-lateststeps:      -uses:actions/checkout@v4      -uses:pnpm/action-setup@v3with:{ version: 8 }      -run:pnpm install --frozen-lockfile      -run:pnpx a11y-form-tester "dist/**/*.html"

Green build = zero violations.


Configuration

Createa11y-form-tester.config.json in project root (optional):

{"rules": ["label","select-name","autocomplete-valid"],"max":5,}

Contributing

PRs & issues are welcome! Here are some areas and suggestions I am looking to improve:

  • Unit Tests - Help us reach better coverage for:

    • CLI argument processing
    • HTML report generation
    • Axe rule configuration
  • New Scenarios - Add more test scenarios insrc/runner/scenarios/:

    • Current scenarios include form submission, tab navigation, autofill, and modal opening
    • We need scenarios for hover interactions, drag-and-drop, custom form controls, etc.
    • Each scenario should be a simple async function that manipulates the page
  • New Features - Priority items:

    • Config file support for project-specific settings
    • Additional reporter formats (JUnit XML, JSON)
    • Support for more axe rules (custom rule packs)

License

MIT


☕ Buy me a coffee

Buy Me A Coffee

About

Interactive accessibility testing for real-world forms Runs axe-core after the clicks, key-presses and dynamic DOM changes your users actually make.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp