Skip to content

test(e2e): check every widget state with axe in light, dark and RTL - #435

Merged
anurag629 merged 1 commit into
devfrom
test/widget-states
Oct 28, 2026
Merged

anurag629 merged 1 commit into
devfrom
test/widget-states

Conversation

@anurag629

Copy link
Copy Markdown
Member

The accessibility half of W7 (F-05 task 33). e2e/tests/states.spec.ts puts the widget in each state from F-05's list that exists today and runs axe against every WCAG 2.2 A and AA rule, at any impact, in light, dark and right-to-left. That's 12 states and 36 tests.

State How the test gets there
S1 launcher page load
S2 unread reply sendMessage(..., { open: false })
S3 welcome bubble welcomeBubble.delay: 0
S4 suggestions suggestions, then open
S5 pre-chat form four field types, then a wrong email so the field error shows
S6 streaming new "still streaming" reply: some text, then the response stays open
S7 sources new "with sources" reply, cited from a knowledge source on the test server
S9 retryable error "fail midway"
S10 rate limited a routed 429 rate_limited with retryAfterMs
S11 offline context.setOffline(true)
S13 conversation limit a routed 429 budget_exceeded
S14 phone 390x844 with a reply

S8 (tool confirmation, F-08), S12 (handoff, F-10) and S17 (consent) don't exist yet and get added with those features.

All of them pass with no changes to the widget.

One thing I found on the way: axe skips the contrast of text that is still fading in. A first check with near-white text on white passed while the panel was opening. The spec now waits for the shadow root's animations to finish before each scan. I confirmed the same bad colors fail with that wait.

Also:

  • E2E_CHANNEL=chrome in the Playwright config runs the browser tests in an installed Chrome, so contributors can skip the Chromium download. It's in CONTRIBUTING.
  • The test server's /api/chat has a knowledge source that only finds something for "with sources", so every other reply is unchanged.

Screenshot baselines (the visual half of W7) come next. They need to be made on CI's Linux Chromium, since a Mac's rendering won't match.

Tested: the full e2e suite passes locally in Chrome (69 tests), and the states spec passes 180 of 180 runs with --repeat-each=5. Lint for e2e/ is unchanged from dev.

@anurag629
anurag629 merged commit a27092f into dev Oct 28, 2026
5 checks passed
@anurag629
anurag629 deleted the test/widget-states branch October 28, 2026 19:59
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.

1 participant