Skip to content

Add automated accessibility contrast testing with axe-core#89

Open
Copilot wants to merge 4 commits intomainfrom
copilot/add-accessibility-contrast-tests
Open

Add automated accessibility contrast testing with axe-core#89
Copilot wants to merge 4 commits intomainfrom
copilot/add-accessibility-contrast-tests

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

The application's high-contrast color scheme targets disabled users, but lacked automated verification against WCAG 2 AA standards. This adds axe-core integration to detect contrast violations in CI.

Implementation

  • Test Infrastructure: Integrated Deque.AxeCore.Playwright (4.11.1) with existing E2E test framework

    • Extended IUITestService with CheckAccessibilityAsync() returning AccessibilityViolation[]
    • Gherkin feature file and step definitions following established patterns
    • Works with all host types (WPF, Console, Headless); Headless recommended for CI
  • axe-core Integration: Uses Playwright's IPage.RunAxe() extension method

    • Validates WCAG 2 AA contrast ratios (4.5:1 normal text, 3:1 large text)
    • Returns detailed violations with rule IDs, impact levels, help URLs, and HTML snippets

Bug Fix

Test immediately detected Power button contrast violation (dark gray #222 on dark red #8B0000). Fixed by changing text to white:

// theme_dark.less
@power-btn-color: darkred;
@power-btn-text-color: white;  // Added

// layout.less
#POWER {
    .btn-behavior(@power-btn-color);
    color: @power-btn-text-color;  // Override default #222
}

Usage

dotnet test test/AdaptiveRemote.EndToEndTests.HeadlessHost \
    --filter "FullyQualifiedName~AccessibilityCompliance"
Original prompt

This section details on the original issue you should resolve

<issue_title>Accessibility tests for UI contrast</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
Color schemes have been chosen for high contrast, since this application is specifically designed for disabled users. But we have no definitive proof the color scheme is good, or protection against regressions in the future.

Describe the solution you'd like
Add an automated test that can check the contrast ratios in the UI to determine whether they meet the standards for low-vision users.

Describe alternatives you've considered
This could be periodically tested manually, but automation would be faster (and more likely to happen).

Additional context
Ideally this automation would run on PR builds, which means it will have to work without access to a real video device.</issue_description>

<agent_instructions>Now that we have end-to-end UI tests, including headless host tests for agents to run, prototype an accessibility test for UI contrast. You should be able to run the test using the HeadlessHost tests, but the test should also be runnable in WPF hosts.

Follow the pattern of other E2E tests--create a shared Gherkin language test with steps like "when I run the accessibility contrast checker" and "then I should not see any accessibility errors" or something along those lines.

The tests have access to a Playwright driver for the browser-based UI, which should provide access for an accessibility checker to run.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 3 commits February 18, 2026 20:47
Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automated accessibility tests for UI contrast Add automated accessibility contrast testing with axe-core Feb 18, 2026
Copilot AI requested a review from jodavis February 18, 2026 21:03
@jodavis jodavis marked this pull request as ready for review February 18, 2026 22:45
@github-actions
Copy link

Test Results

314 tests  +3   306 ✅ +1   2m 23s ⏱️ +11s
  5 suites ±0     8 💤 +2 
  5 files   ±0     0 ❌ ±0 

Results for commit 41c4b35. ± Comparison against base commit 9c4076d.

This pull request removes 3 and adds 5 tests. Note that renamed tests count towards both.
,False)
AdaptiveRemote.Services.ProgrammaticSettings.PersistSettingsTests ‑ PersistSettings_Set_ValidatesKeyNameAsync (Hello
AdaptiveRemote.Services.ProgrammaticSettings.PersistSettingsTests ‑ PersistSettings_Set_ValidatesValueAsync (Invalid
AdaptiveRemote.EndToEndTests.ConsoleHost.Features.AccessibilityComplianceFeature ‑ UI meets WCAG contrast requirements
AdaptiveRemote.EndToEndTests.HeadlessHost.Features.AccessibilityComplianceFeature ‑ UI meets WCAG contrast requirements
AdaptiveRemote.EndToEndTests.WpfHost.Features.AccessibilityComplianceFeature ‑ UI meets WCAG contrast requirements
AdaptiveRemote.Services.ProgrammaticSettings.PersistSettingsTests ‑ PersistSettings_Set_ValidatesKeyNameAsync (Hello
,False)
AdaptiveRemote.Services.ProgrammaticSettings.PersistSettingsTests ‑ PersistSettings_Set_ValidatesValueAsync (Invalid
,False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility tests for UI contrast

2 participants

Comments