Generate Accessibility Test Cases for a Page
Generate a structured set of accessibility test cases for a given page or feature — covering keyboard navigation, focus management, labels, error messages, colour contrast, and ARIA usage.
You are a QA engineer with expertise in web accessibility and WCAG 2.1. Generate a structured set of accessibility test cases for the page or feature described below. Page or feature: {{PAGE_OR_FEATURE}} URL or location: {{URL}} Primary interactive elements: {{INTERACTIVE_ELEMENTS}} Forms or inputs on the page: {{FORMS_AND_INPUTS}} Any known accessibility issues already filed: {{KNOWN_ISSUES}} Target WCAG level: {{WCAG_LEVEL}} (e.g. WCAG 2.1 AA) Generate test cases in the following format for each: Test ID | Area | Test description | Steps | Expected result | WCAG criterion Cover the following areas: **Keyboard navigation** - All interactive elements (links, buttons, form controls, custom widgets) are reachable by Tab key - Tab order follows the visual reading order - Keyboard focus is never trapped in a component without an escape path - Skip navigation link is present and functional (if page has repeated navigation) **Focus indicators** - Every focused element has a visible focus indicator - Focus indicator meets minimum contrast (3:1 ratio against adjacent colours) - Focus is not moved programmatically without user intent **Forms and inputs** - Every input has a programmatically associated label (not just placeholder text) - Required fields are indicated in a way that is not colour-alone - Validation error messages are descriptive, associated with the relevant field, and announced to assistive technology - Error recovery instructions are provided **Images and media** - All meaningful images have descriptive alt text - Decorative images have empty alt="" so screen readers skip them - If the page has video, captions are present **Colour and contrast** - Normal text meets 4.5:1 contrast ratio - Large text (18pt / 14pt bold) meets 3:1 contrast ratio - Information is not conveyed by colour alone **ARIA and semantic structure** - Headings form a logical hierarchy (H1 → H2 → H3, no skipped levels) - Landmark regions (main, nav, header, footer) are present - Any custom interactive component uses appropriate ARIA roles and states - ARIA labels and descriptions are accurate and not redundant **Dynamic content** - Status messages and alerts are announced to screen readers without moving focus (use of ARIA live regions where needed) - Modal dialogs trap focus correctly and return focus on close After the test cases, list any areas you could not generate test cases for due to insufficient page description, with a note on what additional information is needed. Important: These test cases represent a starting checklist — manual testing with a real screen reader is required for full coverage. Automated tools (axe-core, Lighthouse) catch approximately 30–40% of WCAG issues.
{{PAGE_OR_FEATURE}}requiredName of the page or feature being tested
e.g. User registration form
{{URL}}URL or location in the application
e.g. https://staging.example.com/register
{{INTERACTIVE_ELEMENTS}}requiredKey interactive elements on the page
e.g. Navigation menu, registration form, submit button, 'Already have an account?' link, password visibility toggle
{{FORMS_AND_INPUTS}}Form fields and their types
e.g. Email (required), Password (required), Confirm password (required), Accept terms checkbox (required)
{{KNOWN_ISSUES}}Accessibility issues already filed, to avoid duplicate test cases
e.g. JIRA-1234: colour contrast on submit button (in progress)
{{WCAG_LEVEL}}requiredTarget WCAG conformance level
e.g. WCAG 2.1 AA
- Verify test cases are specific to the actual elements on the page — the AI generates generic cases from the description.
- Check that focus management test cases cover all interactive states (open modal, expanded accordion, etc.).
- Confirm error message test cases reflect your actual validation implementation.
- Add test cases for any custom interactive components not mentioned in the prompt (data tables, date pickers, carousels).
- Supplement with manual screen-reader testing — test cases alone do not constitute an accessibility audit.
AI output requires human review before use. These checks are your responsibility.
- Test cases are generated from a text description of the page — they will not accurately reflect custom or complex components the AI cannot see.
- Automated accessibility scans miss approximately 60–70% of WCAG issues — these test cases are a supplement to, not a replacement for, manual testing.
- WCAG criterion references should be verified against the current WCAG specification — the AI may reference outdated criterion numbers.