Skip to content

test(e2e): screenshot tests for the widget's states, with a workflow that makes the baselines - #463

Merged
anurag629 merged 1 commit into
devfrom
test/visual-snapshots
Oct 29, 2026
Merged

anurag629 merged 1 commit into
devfrom
test/visual-snapshots

Conversation

@anurag629

Copy link
Copy Markdown
Member

The rest of W7 (F-05 task 33), as decided: screenshot baselines made on CI and committed by a workflow.

  • e2e/tests/visual.spec.ts screenshots seven states (launcher, welcome bubble, suggestions, pre-chat form, sources, retryable error, phone) in light, dark and right-to-left. That's 21 images, compared with e2e/screenshots/ at a 1% pixel tolerance, with animations off and the caret hidden.
  • The images only match on CI's Linux Chromium, so the spec skips on any other OS and with E2E_CHANNEL. Until baselines exist it skips with "run the Update screenshots workflow", so this PR can merge before them.
  • .github/workflows/update-screenshots.yml (manual, branch input):
    • It builds, runs the spec with --update-snapshots, and commits e2e/screenshots/ to the branch.
    • For dev or production, which only take PRs, it pushes a screenshots/<run id> branch and opens a PR.
    • Pushes made with the workflow's token don't start workflows, so it then starts CI on that branch with gh workflow run ci.yml. That's why ci.yml gains workflow_dispatch. The changeset job only runs for pull_request, so it skips on that run.
    • The branch input goes into the shell through an env var, not ${{ }}. Only people with write access can run a workflow by hand.
  • CONTRIBUTING explains it, including what happens for PRs from forks.

After this merges I'll run the workflow on dev to make the first baselines. It has to be on dev to show up under Run workflow.

Tested: I lifted the Linux check locally once and made all 21 images in Chrome. They look right (I opened a few), and I didn't commit them. Without the override, the spec skips all 21 locally. The rest of the e2e suite and lint are unchanged.

@anurag629
anurag629 merged commit 39fe72c into dev Oct 29, 2026
5 checks passed
@anurag629
anurag629 deleted the test/visual-snapshots branch October 29, 2026 17:27
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