Skip to content

ci: keep visual-regression baselines refreshing and surface Cypress failures - #2669

Open
balzss wants to merge 3 commits into
masterfrom
fix/visual-regression-baseline-pipeline
Open

ci: keep visual-regression baselines refreshing and surface Cypress failures#2669
balzss wants to merge 3 commits into
masterfrom
fix/visual-regression-baseline-pipeline

Conversation

@balzss

@balzss balzss commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Repairs the self-hosted visual-regression pipeline and makes the report far more useful for triage. Two related concerns, in separate commits:

1. Baseline pipeline fix (ci)

  • visual-baselines.yml: decouple baseline capture from the a11y/console gate — Cypress runs with continue-on-error, screenshots always flatten + push (if: always()), and a trailing step fails the job for visibility if Cypress failed. Fixes the silent baseline freeze: the visual-baselines branch had stopped updating on every merge since the dark/light theme suite landed (Cypress aborted the job before the push step).
  • visual-regression.yml: the sticky PR comment now leads with a "Cypress assertions (a11y + console errors)" ✅/❌ line, so failures are visible even when the visual diff is clean.
  • Removed the leftover TEMP inject diff-demo fixture step and regression-test/cypress/diff-demo/.

2. A11y in the visual-diff report (feat)

  • The suite already ran axe per page/theme but discarded the results. A new recordA11y Cypress task now persists them to cypress/a11y.json, keyed by <slug>-<theme> (mirrors meta.json).
  • ui-scripts visual-diff gains a --a11y flag that renders a per-page ⚠ N a11y badge, an ⚠ A11y filter chip, a header count, and a collapsible violation list (rule linked to its axe helpUrl, impact, offending selector, contrast summary). a11yPages/a11yViolations added to summary.json. Additive — without --a11y the report is unchanged.
  • Wired --a11y cypress/a11y.json into the diff step.

Test Plan

  • Unit: visual-diff suite (34 tests, incl. new esc/a11yFor).
  • Verified end-to-end against a real suite run: the spec emits a11y.json (15 flagged page/theme entries) and the report renders badges/filter/list with the real axe contrast data.
  • On merge: confirm Update visual baselines publishes to visual-baselines even while the suite is red, and ends red with the ::error:: annotation.
  • Note: 13 dark/light-theme color-contrast violations remain (tracked in INSTUI-5137) — the suite stays red-but-visible until those are fixed by design/component work.

Fixes INSTUI-5137

🤖 Generated with Claude Code

…ailures

The baseline job ran Cypress without continue-on-error, so failing a11y/console
assertions aborted the job before the "Push baselines" step — silently freezing
the visual-baselines branch on every merge since the dark/light theme suite
landed. Decouple baseline capture from the assertion gate: Cypress runs with
continue-on-error, the screenshots always flatten and push (if: always()), and a
trailing step fails the job for visibility if Cypress failed. Baselines now
refresh on every merge regardless of the a11y/console outcome.

Also add a "Cypress assertions" pass/fail line to the sticky PR comment so
failures are visible even when the visual diff is clean, and remove the leftover
TEMP diff-demo fixture step and regression-test/cypress/diff-demo/.

Refs: INSTUI-5137

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@balzss balzss self-assigned this Jul 30, 2026
@balzss
balzss requested a review from joyenjoyer July 30, 2026 10:42
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2669/

Built to branch gh-pages at 2026-07-30 13:44 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

github-actions Bot pushed a commit that referenced this pull request Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Visual regression report

Cypress assertions (a11y + console errors):Failing — see the run logs.

Visual diff: ⚠️ Changes detected.

Status Count
Unchanged 0
Changed 0
New 96
Removed 32

📊 View full report

Diff images (32)

alert.png — baseline no longer produced

avatar.png — baseline no longer produced

badge.png — baseline no longer produced

billboard.png — baseline no longer produced

breadcrumb.png — baseline no longer produced

button-and-derivatives.png — baseline no longer produced

byline.png — baseline no longer produced

calendar.png — baseline no longer produced

checkbox.png — baseline no longer produced

checkboxgroup.png — baseline no longer produced

colorpicker.png — baseline no longer produced

contextview.png — baseline no longer produced

custom-and-lucide-icons.png — baseline no longer produced

dateinput-dateinput2.png — baseline no longer produced

datetimeinput.png — baseline no longer produced

drilldown.png — baseline no longer produced

filedrop.png — baseline no longer produced

form-errors.png — baseline no longer produced

heading.png — baseline no longer produced

img.png — baseline no longer produced

link.png — baseline no longer produced

menu.png — baseline no longer produced

metric-pill-tag-timeselect-text.png — baseline no longer produced

options.png — baseline no longer produced

pagination.png — baseline no longer produced

progressbar.png — baseline no longer produced

select-simpleselect.png — baseline no longer produced

table.png — baseline no longer produced

tabs.png — baseline no longer produced

tooltip.png — baseline no longer produced

treebrowser.png — baseline no longer produced

view.png — baseline no longer produced

Baselines come from the visual-baselines branch. They refresh on every merge to master. The Cypress assertions line above covers a11y (axe) and console-error checks — a ❌ there means the suite found real issues even if the visual diff is clean.

The regression suite already ran axe per page and theme, but the violations were
only printed to the Cypress log and discarded. Persist them and render them in
the report so designers can triage accessibility issues alongside the pixels.

- regression-test: a new recordA11y Cypress task writes cypress/a11y.json keyed
  by "<slug>-<theme>" (mirroring meta.json); the spec records each violation's
  rule id, impact, help text, helpUrl, and offending node selector/summary.
- ui-scripts visual-diff: a new --a11y flag reads that file and adds a per-row
  "a11y" badge, an "A11y" filter chip, a header count, and a collapsible list of
  violations (rule linked to its axe helpUrl, impact, selector, contrast
  summary) per screenshot. a11yPages/a11yViolations are added to summary.json.
- visual-regression.yml passes --a11y cypress/a11y.json to the diff step.

Additive: without --a11y the report is unchanged. Unit-tested esc() and
a11yFor(), and verified end to end against a real suite run (15 flagged pages).

Refs: INSTUI-5137

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Jul 30, 2026
… HTML view

Builds on the a11y report data: make the violations visible without hunting.

- Expand each row's violation list by default (Tier 1 was collapsed).
- In the lightbox HTML view, outline the offending nodes inside the live iframe
  using the recorded axe selectors, and add a legend that lists each violation
  and scrolls/flashes its element on click.
- Embed the a11y data as a JSON block for the client; same-origin iframe access
  means no pixel math. Runtime-generated selectors (Emotion hashes, generated
  ids) resolve because the iframe app and the axe run share one build; if they
  ever diverge the outline no-ops but the legend and text details still show.

Refs: INSTUI-5137

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Jul 30, 2026
@balzss
balzss removed the request for review from joyenjoyer July 30, 2026 13:57
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