test: automated accessibility regression coverage (#56) - #65
Merged
Merged
Conversation
Adds @axe-core/playwright scans of every key public page plus the
interactive states where defects hide (mobile nav open, contact
validation errors, dive-site dialog, booking fallback), semantic
keyboard-operation tests (skip link, primary nav, mobile menu, dialog
focus trap/restore, contact form), and reduced-motion coverage for the
team carousel.
Fixes the violations the baseline scans surfaced:
- --muted-foreground darkened (#6B7280 -> #5F6673): measured 4.47:1 on
the page background, just under WCAG AA 4.5:1
- text-muted-foreground/{50,60,70} and text-white/{40,45,50} opacity
variants dropped real text below 4.5:1 (footer links were 2.23:1)
- WhatsApp CTA green-600 text/bg (~3:1) -> green-700/800
- skipped heading levels (h4 directly under h2) on /diving and
/dive-sites corrected to h3
No axe rules disabled; exception policy documented in TESTING.md.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideThis PR establishes an enforced Playwright/axe accessibility regression gate across representative desktop, mobile, and interactive UI states, adds keyboard and reduced-motion behavioral coverage, documents the policy, and fixes the contrast and heading-hierarchy defects found by the new tests. Sequence diagram for accessibility regression testingsequenceDiagram
participant CI
participant Playwright
participant Browser
participant Axe
participant Gate
CI->>Playwright: Run accessibility.spec.ts
Playwright->>Browser: Load page at target viewport
Playwright->>Browser: Set interactive or preference state
Playwright->>Axe: Analyze rendered DOM and computed styles
Axe-->>Playwright: Return violations
Playwright->>Browser: Exercise keyboard or reduced-motion behavior
Browser-->>Playwright: Return focus and interaction results
Playwright->>Gate: Report test results
alt Accessibility regression found
Gate-->>CI: Fail critical website tests
else Checks pass
Gate-->>CI: Pass accessibility gate
end
Flow diagram for accessibility defect remediationflowchart TD
Scan[Run full axe ruleset] --> Finding{Violation found?}
Finding -->|No| Pass[Keep accessibility gate passing]
Finding -->|Yes| Diagnose[Identify contrast or heading defect]
Diagnose --> Style[Adjust color tokens and text contrast]
Diagnose --> Structure[Correct heading hierarchy]
Style --> Rescan[Run accessibility tests again]
Structure --> Rescan
Rescan --> Finding
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Owner
Author
|
Visual check approved. The contrast improvements are very subtle, only the footer and WhatsApp button is noticeable and its an improvement. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #56: an enforced accessibility regression barrier built on the Playwright fixture architecture from #63.
Baseline assessment: the site already had solid a11y foundations — skip link, labeled form fields with
aria-invalid/aria-describedby, focus-trapping dialogs with focus restoration,aria-expanded/inertmobile menu, reduced-motion-aware carousel. The baseline axe inventory found two defect classes, both fixed here.Coverage added (
tests/e2e/accessibility.spec.ts)/,/diving,/courses,/plan-your-trip,/contact,/book,/book?item=classic,/dive-sites,/about,/dive-logon desktop-chromium; representative mobile-viewport scans (/,/contact,/book) plus mobile-nav-open state on mobile-chromium.#main-content; desktop primary-nav traversal asserting focus destination names and a non-nonefocus indicator; mobile menu keyboard open/Escape-close plus proof closed-menu links are unreachable (inert); dialog focus trap (24 Tab/Shift+Tab cycles, none escape), Escape close, focus restore to trigger; contact form completed and submitted by keyboard alone./aboutcarousel must not autoplay underprefers-reduced-motion: reduceand must still advance without it — deterministic via Playwright's fake clock, no sleeps.Browser/device strategy
Axe evaluates the rendered DOM and computed styles, so findings depend on viewport, not engine: full scans on desktop-chromium, mobile-layout scans on mobile-chromium, no mobile-webkit duplication. One exception handled explicitly: Playwright WebKit mirrors Safari's default where Tab visits only form controls, so the mobile-menu test asserts focusability rather than Tab destination there.
Defects found and fixed
--muted-foreground#6B7280 on #F5F6FA = 4.47:1 (site-wide, hundreds of elements)text-muted-foreground/{50,60,70}on light bg — footer links 2.23:1text-foregroundtext-white/{40,45,50}on navy overlays — 4.42:1 and belowgreen-600text andbg-green-600+white ≈ 3:1h4underh2on /diving (6) and /dive-sites (per-region)h3Exceptions
None — no axe rules disabled, no selectors excluded. Policy documented in
docs/TESTING.md.Validation
npx playwright test tests/e2e/accessibility.spec.ts: 25 passed / 47 project-filtered skipsnpm run test(unit+integration): 73 passednpm run lint,npm run typecheck,npm run build:test: cleanRemaining gaps / follow-ups
dive-sites-map.tsx/location-pinoverlay text was raised conservatively; the map component is not mounted on/dive-sitestoday.Closes #56
Generated with Devin
Summary by Sourcery
Establish an automated accessibility regression barrier while correcting existing contrast and heading-structure issues.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests: