Accessibility Audit
WCAG 2.1 AA compliance audit for an e-commerce website.
📝 Prompt
Conduct a comprehensive accessibility audit for an e-commerce website:
Context:
- Website: Online bookstore with 50,000+ products
- Pages to audit: Homepage, Product listing, Product detail, Cart, Checkout
- Target: WCAG 2.1 Level AA compliance
- Users: Include people with visual, motor, auditory, and cognitive disabilities
- Tech stack: React, Next.js
Include:
- Automated testing results
- Manual testing findings
- Screen reader testing notes
- Keyboard navigation assessment
- Color contrast analysis
- Prioritized recommendations
- Remediation plan with timelines🔍 Audit Report
Executive Summary
Audit Date: January 2026
Website: BookHaven.com
Standard: WCAG 2.1 Level AA
Overall Compliance: 68% (Partial Conformance)
Critical Issues: 12
Serious Issues: 28
Moderate Issues: 45
Minor Issues: 67
Top Priorities:
- Missing form labels (affects checkout)
- Insufficient color contrast (affects readability)
- Keyboard traps in mega menu
- Missing alt text on product images
- Inaccessible custom dropdown selects
Testing Methodology
Automated Testing Tools
- ✅ axe DevTools (Browser extension)
- ✅ WAVE (Web Accessibility Evaluation Tool)
- ✅ Lighthouse (Chrome DevTools)
- ✅ Pa11y (CI integration)
Manual Testing
- ✅ Keyboard-only navigation
- ✅ Screen reader testing (NVDA, JAWS, VoiceOver)
- ✅ Browser zoom (200%, 400%)
- ✅ Color contrast verification
- ✅ Focus indicator visibility
- ✅ Form error identification
Assistive Technologies Used
- NVDA 2023 + Firefox (Windows)
- JAWS 2024 + Chrome (Windows)
- VoiceOver + Safari (macOS, iOS)
- TalkBack + Chrome (Android)
Page-by-Page Findings
Homepage Audit
Automated Test Results (axe DevTools)
Total Issues: 23
├── Critical: 2
├── Serious: 8
├── Moderate: 9
└── Minor: 4Critical Issues
1. Form Label Missing
<!-- ❌ Current Implementation -->
<input
type="text"
placeholder="Search for books..."
class="search-input"
/>
<!-- ✅ Corrected Implementation -->
<label for="search" class="visually-hidden">Search for books</label>
<input
id="search"
type="text"
placeholder="Search for books..."
aria-label="Search for books"
class="search-input"
/>Impact: Screen reader users cannot identify the purpose of the search field.
WCAG: 4.1.2 Name, Role, Value (Level A)
Effort: Low (1 hour)
Priority: P0 (Critical)
2. Image Missing Alt Text
<!-- ❌ Current: Hero banner -->
<img src="/hero-sale.jpg" class="hero-image" />
<!-- ✅ Corrected -->
<img
src="/hero-sale.jpg"
alt="50% off bestsellers - Limited time offer"
class="hero-image"
/>Impact: Screen reader users miss promotional information.
WCAG: 1.1.1 Non-text Content (Level A)
Effort: Low (2 hours for all images)
Priority: P0 (Critical)
Serious Issues
3. Insufficient Color Contrast
/* ❌ Current: Gray text on white */
.category-link {
color: #999999; /* 2.85:1 ratio - FAIL */
background: #FFFFFF;
}
/* ✅ Corrected: Darker gray */
.category-link {
color: #595959; /* 4.56:1 ratio - PASS */
background: #FFFFFF;
}Impact: Users with low vision cannot read category links.
WCAG: 1.4.3 Contrast (Minimum) (Level AA)
Affected Elements: 15 instances
Effort: Medium (4 hours)
Priority: P1 (High)
4. Keyboard Trap in Mega Menu
// ❌ Current: Focus gets stuck
function openMegaMenu() {
menu.style.display = 'block';
// No focus management
}
// ✅ Corrected: Proper focus management
function openMegaMenu() {
menu.style.display = 'block';
menu.setAttribute('aria-hidden', 'false');
// Focus first link
const firstLink = menu.querySelector('a');
firstLink.focus();
// Handle ESC key to close
menu.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
closeMegaMenu();
menuButton.focus(); // Return focus
}
});
}Impact: Keyboard users cannot escape the menu.
WCAG: 2.1.2 No Keyboard Trap (Level A)
Effort: Medium (6 hours)
Priority: P0 (Critical)
Product Detail Page Audit
Screen Reader Testing Notes (NVDA + Firefox)
User Action: Navigate to "Add to Cart" button
Expected: "Add to Cart, button"
Actual: "Add, button" [partial text announced]
Issue: Button text truncated by CSSFix:
/* ❌ Current */
.add-to-cart-btn {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
/* ✅ Corrected */
.add-to-cart-btn {
/* Remove truncation, allow text to wrap */
white-space: normal;
}
/* Or use aria-label */
<button class="add-to-cart-btn" aria-label="Add The Great Gatsby to cart">
Add to Cart
</button>Critical Issue: Custom Dropdown Not Keyboard Accessible
<!-- ❌ Current: Div-based dropdown -->
<div class="quantity-selector" onclick="toggleDropdown()">
<span>Quantity: 1</span>
<div class="dropdown">
<div onclick="selectQty(1)">1</div>
<div onclick="selectQty(2)">2</div>
<div onclick="selectQty(3)">3</div>
</div>
</div>
<!-- ✅ Corrected: Native select or proper ARIA -->
<label for="quantity">Quantity</label>
<select id="quantity" name="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<!-- OR use proper ARIA for custom dropdown -->
<div class="quantity-selector">
<button
id="quantity-button"
aria-haspopup="listbox"
aria-expanded="false"
aria-labelledby="quantity-label quantity-button"
>
<span id="quantity-label">Quantity:</span> 1
</button>
<ul
role="listbox"
aria-labelledby="quantity-label"
tabindex="-1"
hidden
>
<li role="option" tabindex="0" aria-selected="true">1</li>
<li role="option" tabindex="-1">2</li>
<li role="option" tabindex="-1">3</li>
</ul>
</div>Impact: Keyboard and screen reader users cannot select quantity.
WCAG: 4.1.2 Name, Role, Value (Level A)
Effort: High (16 hours for all custom controls)
Priority: P0 (Critical)
Checkout Page Audit
Form Error Handling
Critical Issues Found:
- Errors only indicated by color (red border)
- No error messages announced to screen readers
- Focus not moved to first error
- No error summary at top of form
Current Implementation ❌
<input
type="email"
name="email"
class="input error" <!-- Only visual indicator -->
value="invalid-email"
/>Corrected Implementation ✅
<div class="form-field">
<label for="email">
Email Address
<span aria-label="required">*</span>
</label>
<input
id="email"
type="email"
name="email"
class="input"
aria-invalid="true"
aria-describedby="email-error"
value="invalid-email"
/>
<span id="email-error" class="error-message" role="alert">
<svg aria-hidden="true" class="error-icon">...</svg>
Please enter a valid email address
</span>
</div>Error Summary ✅
<div
class="error-summary"
role="alert"
aria-labelledby="error-summary-title"
tabindex="-1"
>
<h2 id="error-summary-title">
There are 3 errors in this form
</h2>
<ul>
<li><a href="#email">Email address is invalid</a></li>
<li><a href="#card-number">Credit card number is required</a></li>
<li><a href="#cvv">CVV must be 3 digits</a></li>
</ul>
</div>
<script>
// Focus error summary on submit
document.querySelector('.error-summary').focus();
</script>WCAG Violations:
- 1.4.1 Use of Color (Level A)
- 3.3.1 Error Identification (Level A)
- 3.3.3 Error Suggestion (Level AA)
Impact: Users with visual impairments cannot identify or correct errors.
Effort: High (12 hours)
Priority: P0 (Critical)
Color Contrast Analysis
Tools Used: Colour Contrast Analyser, WebAIM Contrast Checker
Failed Elements:
| Element | Current | Contrast | Required | Status | Fix |
|---|---|---|---|---|---|
| Body text | #777 on #FFF | 3.67:1 | 4.5:1 | ❌ FAIL | Use #595959 |
| Link text | #4A9FDB on #FFF | 3.15:1 | 4.5:1 | ❌ FAIL | Use #0066CC |
| Button text | #FFF on #F0F0F0 | 1.18:1 | 4.5:1 | ❌ FAIL | Use darker bg |
| Price (large) | #B8B8B8 on #FFF | 2.15:1 | 3:1 | ❌ FAIL | Use #767676 |
| Placeholder | #CCC on #FFF | 1.84:1 | 4.5:1 | ❌ FAIL | Use #757575 |
Color Palette Recommendations:
/* ✅ WCAG AA Compliant Colors */
--text-primary: #212121; /* 16.1:1 on white */
--text-secondary: #595959; /* 7.0:1 on white */
--link-color: #0066CC; /* 4.5:1 on white */
--link-visited: #551A8B; /* 8.0:1 on white */
--success: #0F7F3E; /* 4.5:1 on white */
--error: #D32F2F; /* 5.5:1 on white */
--warning: #9A6700; /* 4.5:1 on white */Keyboard Navigation Assessment
Test Procedure: Navigate entire site using only keyboard (Tab, Shift+Tab, Enter, Arrow keys, Esc)
Critical Issues:
- Skip to Main Content Link Missing
<!-- ✅ Add at top of page -->
<a href="#main" class="skip-link">
Skip to main content
</a>
<style>
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: #000;
color: #fff;
padding: 8px;
z-index: 100;
}
.skip-link:focus {
top: 0;
}
</style>- Focus Indicators Invisible
/* ❌ Current: Focus outline removed */
*:focus {
outline: none;
}
/* ✅ Corrected: Visible focus indicators */
*:focus-visible {
outline: 3px solid #0066CC;
outline-offset: 2px;
}
button:focus-visible,
a:focus-visible {
outline: 3px solid #0066CC;
outline-offset: 2px;
box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
}- Modal Traps Focus
// ✅ Focus trap implementation
class FocusTrap {
constructor(element) {
this.element = element;
this.focusableElements = element.querySelectorAll(
'a[href], button:not([disabled]), textarea, input, select'
);
this.firstFocusable = this.focusableElements[0];
this.lastFocusable = this.focusableElements[this.focusableElements.length - 1];
}
activate() {
this.element.addEventListener('keydown', this.handleKeydown.bind(this));
this.firstFocusable.focus();
}
handleKeydown(e) {
if (e.key !== 'Tab') return;
if (e.shiftKey && document.activeElement === this.firstFocusable) {
e.preventDefault();
this.lastFocusable.focus();
} else if (!e.shiftKey && document.activeElement === this.lastFocusable) {
e.preventDefault();
this.firstFocusable.focus();
}
}
}Recommendations by Priority
P0 - Critical (Fix within 1 week)
- ✅ Add missing form labels (12 instances) - 4 hours
- ✅ Add alt text to product images (250+ images) - 8 hours
- ✅ Fix keyboard traps in navigation - 6 hours
- ✅ Make custom dropdowns keyboard accessible - 16 hours
- ✅ Implement proper error handling in checkout - 12 hours
Total P0 Effort: 46 hours (1 week with 2 developers)
P1 - High (Fix within 2 weeks)
- ✅ Fix color contrast issues (45 instances) - 12 hours
- ✅ Add visible focus indicators - 4 hours
- ✅ Implement skip links - 2 hours
- ✅ Add ARIA landmarks - 4 hours
- ✅ Fix heading hierarchy - 6 hours
Total P1 Effort: 28 hours
P2 - Medium (Fix within 1 month)
- ✅ Add keyboard shortcuts documentation - 4 hours
- ✅ Improve screen reader announcements - 8 hours
- ✅ Add loading state indicators - 6 hours
- ✅ Implement proper table markup - 4 hours
Total P2 Effort: 22 hours
Remediation Plan
Week 1-2: Critical Fixes (P0)
Sprint 1: Forms & Labels
├── Day 1-2: Add form labels and ARIA attributes
├── Day 3-4: Implement error handling
└── Day 5: Testing and validation
Sprint 2: Navigation & Controls
├── Day 6-7: Fix keyboard traps
├── Day 8-10: Rebuild custom dropdowns
└── Day 10: TestingWeek 3-4: High Priority (P1)
Sprint 3: Visual & Contrast
├── Day 11-13: Fix color contrast
├── Day 14: Implement focus indicators
└── Day 15: Add skip links and landmarksWeek 5-6: Medium Priority (P2) + Regression Testing
Week 7: Final Audit & Certification
Testing Checklist
Before Release:
- Run automated tools (axe, WAVE, Lighthouse)
- Manual keyboard navigation test
- Screen reader testing (NVDA, JAWS, VoiceOver)
- Color contrast verification
- Zoom testing (200%, 400%)
- Mobile screen reader testing
- Focus management review
- Form error handling test
- ARIA attribute validation
- Heading hierarchy check
Success Criteria
Target Metrics:
- Automated test pass rate: 95%+
- Manual audit pass rate: 90%+
- Screen reader compatibility: 100%
- Keyboard navigation: 100% of features accessible
- Color contrast: 100% compliance
User Testing:
- Test with 5 users with disabilities
- Tasks completion rate: 90%+
- User satisfaction: 4/5+
✅ Audit Deliverables
- ✅ Executive summary with compliance rating
- ✅ Detailed findings by page
- ✅ Code examples (before/after)
- ✅ Color contrast analysis
- ✅ Keyboard navigation assessment
- ✅ Screen reader testing notes
- ✅ Prioritized recommendations (P0, P1, P2)
- ✅ Remediation plan with timeline
- ✅ Testing checklist
- ✅ Success criteria and metrics
This audit provides a comprehensive roadmap to achieve WCAG 2.1 Level AA compliance, improving the website's accessibility for all users.