Share a BackstopJS report
Visual regression testing has a well-known failure mode, and it is not technical. The suite runs, produces forty diffs, and then waits for a human to say which ones are intended. That human is usually a designer, and the report is usually on a CI worker behind a login they do not have.
So the diffs get screenshotted into Slack, one at a time, and the approval conversation happens next to a cropped image with an arrow drawn on it.
Publish it
npx backstop test || true
curl -fsS -X PATCH \
"https://commareports.com/api/v1/reports/$COMMA_REPORT_ID" \
-H "Authorization: Bearer $COMMA_API_TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile html backstop_data/html_report/index.html \
--arg title "Visual diffs — $BRANCH — build $BUILD_NUMBER" \
'{title: $title, html: $html}')"
The report is image-heavy by nature, so dragging
backstop_data/html_report/ into the app is
usually the better route: the reference, test and diff images upload as
assets and their references are rewritten to the uploaded copies. Publish
the index alone and you get a report shaped like a visual diff with no
visuals in it.
|| true because backstop test exits non-zero whenever anything
differs, which is every run you care about.