Keyboard-only accessibility test script with checklist
Views
6.4K
Copies
1.7K
Likes
830
Comments
0
Copy rate
26.0%
Prompt
Write a Playwright test suite in [language] that audits a web app for keyboard accessibility. The target URL is [target_url].
The suite should:
- Tab through every focusable element in the page and verify visible focus rings
- Detect focus traps in modals and dialogs
- Verify skip links work
- Ensure all interactive controls are reachable without a mouse
- Check escape-to-close on overlays
- Verify focus returns to the trigger after closing modals
- Produce a human-readable checklist report with pass/fail for each check
- Flag elements with tabindex > 0 as a warning
Output a single TypeScript file I can drop into my Playwright repo.Customise this prompt
Fill in 2 variables to personalise this prompt
Preview
Write a Playwright test suite in [language] that audits a web app for keyboard accessibility. The target URL is [target_url].
The suite should:
- Tab through every focusable element in the page and verify visible focus rings
- Detect focus traps in modals and dialogs
- Verify skip links work
- Ensure all interactive controls are reachable without a mouse
- Check escape-to-close on overlays
- Verify focus returns to the trigger after closing modals
- Produce a human-readable checklist report with pass/fail for each check
- Flag elements with tabindex > 0 as a warning
Output a single TypeScript file I can drop into my Playwright repo.
Example output