Skip to content

Commit 55af258

Browse files
committed
A11y: Disable axe color-contrast in E2E; contrast moves to design-time
Contrast is now checked by `scripts/check-a11y-contrast` (design-time, ~300 ms, deterministic against CSS tokens). Axe stays on for structural rules — ARIA, focus order, labels, keyboard nav — where a running browser is genuinely needed. Rationale: axe's `color-contrast` rule was flaky across engines because it reads `getComputedStyle().color` and different Chromium/WebKit builds disagree on how to resolve nested `color-mix(in srgb, var(--x), black NN%)` chains on translucent overlays. Moving contrast to a static CSS token analysis eliminates the whole flake class and gives us broader coverage (every styled element, not just ~22 dialog states). See `docs/design-system.md` § a11y testing strategy and `scripts/check-a11y-contrast/README.md` for the full architecture.
1 parent 747507f commit 55af258

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/desktop/test/e2e-playwright/accessibility.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@ async function runAxeAudit(
8686
const axeContext = scope
8787
? JSON.stringify({ include: [[scope]], exclude: [['[disabled]'], ['.btn:disabled']] })
8888
: JSON.stringify({ exclude: [['[disabled]'], ['.btn:disabled']] })
89+
// `color-contrast` is disabled: we check contrast at design time via
90+
// `scripts/check-a11y-contrast` (deterministic, ~0.3s, no engine-dependent
91+
// `color-mix()` resolution quirks). Axe stays on for structural rules
92+
// (ARIA, focus order, labels, keyboard nav) where a running browser is
93+
// genuinely needed. See `docs/design-system.md` § a11y testing strategy.
8994
const axeOptions = JSON.stringify({
90-
rules: { 'color-contrast': { enabled: true } },
95+
rules: { 'color-contrast': { enabled: false } },
9196
})
9297
const axeCall = `axe.run(${axeContext}, ${axeOptions})`
9398
const results = await tauriPage.evaluate<AxeResults>(axeCall)

0 commit comments

Comments
 (0)