-
Notifications
You must be signed in to change notification settings - Fork 615
[TESTING][ACCESSIBILITY]: Admin UI WCAG Compliance, Keyboard Navigation, Screen Reader Support #2480
Description
[TESTING][ACCESSIBILITY]: Admin UI WCAG Compliance, Keyboard Navigation, Screen Reader Support
Goal
Produce a comprehensive manual test plan for validating the Admin UI meets accessibility standards including WCAG 2.1 AA compliance, keyboard navigation, and screen reader compatibility.
Why Now?
Accessibility is both ethical and legal requirement:
- Inclusivity: All users should be able to use the Admin UI
- Legal Compliance: Many jurisdictions require accessibility
- Enterprise Adoption: Large organizations mandate WCAG compliance
- Usability: Accessible design improves UX for everyone
- SEO/Quality: Accessibility correlates with code quality
User Stories
US-1: Visually Impaired User - Screen Reader
As a visually impaired user
I want to use the Admin UI with a screen reader
So that I can manage the gateway independently
Acceptance Criteria:
Feature: Screen Reader Support
Scenario: Navigate with screen reader
Given I am using NVDA/VoiceOver
When I navigate the Admin UI
Then all elements should be announced correctly
And form labels should be associated with inputsUS-2: Motor Impaired User - Keyboard Navigation
As a user with motor impairments
I want to navigate entirely with keyboard
So that I don't need to use a mouse
Acceptance Criteria:
Feature: Keyboard Navigation
Scenario: Complete workflow with keyboard only
Given I am using only keyboard
When I login, navigate to gateways, and add a new gateway
Then I should complete the entire workflow
And focus should be visible at all timesArchitecture
ACCESSIBILITY TESTING
+------------------------------------------------------------------------+
| |
| Automated Testing Manual Testing Assistive Tech |
| ----------------- -------------- -------------- |
| |
| +------------+ +------------+ +------------+ |
| | axe-core | | Keyboard | | NVDA | |
| | Lighthouse | | Testing | | VoiceOver | |
| | WAVE | +------------+ | JAWS | |
| +------------+ +------------+ |
| | | | |
| v v v |
| +-----------------------------------------------------------+ |
| | WCAG 2.1 AA Criteria | |
| | - Perceivable (color contrast, alt text, captions) | |
| | - Operable (keyboard, timing, seizures, navigation) | |
| | - Understandable (readable, predictable, input help) | |
| | - Robust (compatible with assistive tech) | |
| +-----------------------------------------------------------+ |
| |
+------------------------------------------------------------------------+
Test Environment Setup
# Install accessibility testing tools
npm install -g @axe-core/cli
npm install -g lighthouse
# Browser extensions to install:
# - axe DevTools (Chrome/Firefox)
# - WAVE Evaluation Tool
# - Accessibility Insights
# Screen readers:
# - NVDA (Windows) - free
# - VoiceOver (macOS) - built-in
# - JAWS (Windows) - commercial
# Start gateway with Admin UI
export MCPGATEWAY_UI_ENABLED=true
python -m mcpgateway.main &
# Gateway URL
export GATEWAY_URL="http://localhost:8000"Manual Test Cases
| Case | Category | Requirement | WCAG Criterion |
|---|---|---|---|
| A11Y-01 | Color Contrast | 4.5:1 minimum | 1.4.3 |
| A11Y-02 | Keyboard Focus | Visible focus indicator | 2.4.7 |
| A11Y-03 | Tab Order | Logical sequence | 2.4.3 |
| A11Y-04 | Form Labels | Associated labels | 1.3.1 |
| A11Y-05 | Error Messages | Announced by screen reader | 3.3.1 |
| A11Y-06 | Page Titles | Descriptive titles | 2.4.2 |
| A11Y-07 | Headings | Proper hierarchy | 1.3.1 |
| A11Y-08 | Images | Alt text present | 1.1.1 |
| A11Y-09 | Skip Links | Skip to main content | 2.4.1 |
| A11Y-10 | ARIA Labels | Proper ARIA usage | 4.1.2 |
A11Y-01: Color Contrast Testing
Automated Testing:
# Run Lighthouse accessibility audit
lighthouse $GATEWAY_URL/ui/ --only-categories=accessibility --output=html
# Or use axe-core CLI
axe $GATEWAY_URL/ui/ --tags wcag2aaManual Testing:
- Open browser DevTools
- Use Color Contrast Analyzer extension
- Check each text/background combination
Checklist:
| Element | Foreground | Background | Ratio | Pass? |
|---|---|---|---|---|
| Body text | >= 4.5:1 | |||
| Headings | >= 4.5:1 | |||
| Links | >= 4.5:1 | |||
| Buttons | >= 4.5:1 | |||
| Error text | >= 4.5:1 | |||
| Placeholder | >= 4.5:1 |
Expected Result:
- All text meets 4.5:1 contrast ratio (AA)
- Large text (18pt+) meets 3:1 ratio
- UI elements meet 3:1 against adjacent colors
A11Y-02: Keyboard Focus Visibility
Steps:
- Navigate to Admin UI
- Press Tab to move through elements
- Verify focus indicator visible on each element
Checklist:
| Element | Focus Visible | Focus Style | Pass? |
|---|---|---|---|
| Login input | |||
| Login button | |||
| Navigation links | |||
| Table rows | |||
| Modal buttons | |||
| Dropdown items |
CSS Check:
/* Focus styles should NOT be removed */
/* BAD: *:focus { outline: none; } */
/* GOOD: */
:focus {
outline: 2px solid #0066cc;
outline-offset: 2px;
}Expected Result:
- Focus indicator visible on all interactive elements
- Focus style has sufficient contrast
- Focus not hidden via CSS
A11Y-03: Tab Order Testing
Steps:
- Start at login page
- Tab through all elements
- Verify order is logical (left-to-right, top-to-bottom)
- Check for focus traps
Record Tab Order:
Login Page:
1. Username input
2. Password input
3. "Remember me" checkbox
4. Login button
5. "Forgot password" link
Dashboard:
1. Skip link (if present)
2. Logo/Home link
3. Navigation items (in order)
4. Main content area
5. Footer links
Expected Result:
- Tab order follows visual layout
- No elements skipped
- No focus traps (except modals)
- Shift+Tab reverses order
A11Y-04: Form Labels Testing
Steps:
# Check for associated labels
# In browser console:
document.querySelectorAll('input, select, textarea').forEach(el => {
const id = el.id;
const label = document.querySelector(`label[for="${id}"]`);
const ariaLabel = el.getAttribute('aria-label');
const ariaLabelledby = el.getAttribute('aria-labelledby');
console.log({
id,
hasLabel: !!label,
hasAriaLabel: !!ariaLabel,
hasAriaLabelledby: !!ariaLabelledby
});
});Form Audit:
| Form | Field | Label Method | Accessible? |
|---|---|---|---|
| Login | Username | label[for] | |
| Login | Password | label[for] | |
| Gateway Add | Name | ||
| Gateway Add | URL | ||
| Gateway Add | Transport |
Expected Result:
- Every input has associated label
- Labels are visible (not just aria-label)
- Required fields indicated accessibly
A11Y-05: Error Message Announcements
Steps with Screen Reader:
- Enable NVDA/VoiceOver
- Submit login form with empty fields
- Listen for error announcement
- Verify error describes the problem
Test Scenarios:
| Scenario | Error Text | Announced? | Descriptive? |
|---|---|---|---|
| Empty username | |||
| Wrong password | |||
| Invalid gateway URL | |||
| Server error |
HTML Check:
<!-- Errors should have role="alert" or aria-live -->
<div role="alert" class="error">
Username is required
</div>
<!-- Or be associated with input -->
<input aria-describedby="username-error" />
<span id="username-error" class="error">Username is required</span>Expected Result:
- Errors announced automatically by screen reader
- Error text is descriptive
- Focus moves to first error (optional)
A11Y-06 to A11Y-10: Additional Checks
Page Titles (A11Y-06):
// Check each page has unique, descriptive title
// Navigate through app and record:
console.log(document.title);
// Should be: "Gateways - MCP Gateway Admin" not just "MCP Gateway"Heading Hierarchy (A11Y-07):
// Check heading levels
document.querySelectorAll('h1, h2, h3, h4, h5, h6').forEach(h => {
console.log(`${h.tagName}: ${h.textContent}`);
});
// Should have exactly one h1, h2s under h1, h3s under h2s, etc.Image Alt Text (A11Y-08):
// Check all images have alt text
document.querySelectorAll('img').forEach(img => {
console.log({
src: img.src.substring(0, 50),
alt: img.alt || 'MISSING',
isDecorative: img.alt === ''
});
});Skip Link (A11Y-09):
- First tab stop should be "Skip to main content"
- Link should jump to main content area
- Should be visible on focus
ARIA Usage (A11Y-10):
// Check for proper ARIA
document.querySelectorAll('[role]').forEach(el => {
console.log({ role: el.getAttribute('role'), element: el.tagName });
});
// Verify roles are correct and necessaryScreen Reader Testing
Testing with NVDA (Windows):
- Start NVDA
- Navigate to Admin UI
- Use browse mode (Insert+Space) to read page
- Use focus mode for form interaction
- Verify all content is announced correctly
Testing with VoiceOver (macOS):
- Enable VoiceOver (Cmd+F5)
- Navigate with VO+arrows
- Use rotor (VO+U) for navigation
- Verify headings, links, forms announced
Common Issues to Check:
- Dynamic content announced (aria-live)
- Modal focus trapped correctly
- Dropdown menus navigable
- Tables have headers
Test Matrix
| Criterion | Method | Tool | Pass Criteria |
|---|---|---|---|
| 1.1.1 Non-text Content | Automated + Manual | axe, NVDA | All images have alt |
| 1.3.1 Info and Relationships | Automated | axe | Proper markup |
| 1.4.3 Contrast | Automated | Lighthouse | 4.5:1 ratio |
| 2.1.1 Keyboard | Manual | Keyboard only | All functions accessible |
| 2.4.1 Bypass Blocks | Manual | Keyboard | Skip link works |
| 2.4.3 Focus Order | Manual | Keyboard | Logical order |
| 2.4.7 Focus Visible | Manual | Keyboard | Focus always visible |
| 3.3.1 Error Identification | Manual | NVDA | Errors announced |
| 4.1.2 Name, Role, Value | Automated | axe | Proper ARIA |
Success Criteria
- Lighthouse accessibility score >= 90
- axe-core reports 0 critical/serious issues
- All pages navigable by keyboard only
- Screen reader (NVDA/VoiceOver) can complete all workflows
- Color contrast meets WCAG AA (4.5:1)
- Focus visible on all interactive elements
- Forms have associated labels
- Errors announced by screen readers
Related Files
mcpgateway/templates/- HTML templatesmcpgateway/static/css/- Stylesheetsmcpgateway/static/js/- JavaScript
Related Issues
- [TESTING][FUNCTIONALITY]: Admin UI manual test plan (HTMX, Alpine.js, navigation, CRUD) #2428 - Admin UI functionality
- [TESTING][COMPATIBILITY]: Python Versions, Database Versions, and Browser Compatibility #2479 - Browser compatibility
- [TESTING][DOCUMENTATION]: API Documentation Accuracy, Code Examples, and Tutorial Validation #2483 - Documentation