Skip to content

[Crafting] Screenshot baseline updater - #2120

Merged
leonardomendix merged 1 commit into
mainfrom
test/screenshot-baseline-updater
Apr 24, 2026
Merged

[Crafting] Screenshot baseline updater#2120
leonardomendix merged 1 commit into
mainfrom
test/screenshot-baseline-updater

Conversation

@leonardomendix

Copy link
Copy Markdown
Collaborator

Pull request type

Test related change (New E2E test, test automation, etc.)


Description

Screenshot baseline updater

Adds automation/scripts/update-screenshots.mjs — a script that downloads failed Playwright screenshot artifacts from a GitHub Actions run and overwrites the local baselines in one command.

Options:

--token / -t — GitHub token (fallback: $GITHUB_TOKEN)
--artifact / -a — artifact name prefix (default: test-screenshot-results)
--prefix / -p — snapshot platform prefix (default: chromium-linux)
--dry-run / -n — preview changes without writing files
--verbose / -v — extra diagnostic output

What it does:

  1. Parses owner/repo/runId from the summary URL
  2. Fetches the test-screenshot-results* artifacts via GitHub API
  3. Downloads and extracts the ZIP(s)
  4. Maps each *-actual.png → the correct e2e/*.spec.js-snapshots/*-chromium-linux.png baseline, handling CI absolute paths, stripped paths, and shard deduplication
  5. Overwrites (or creates) the baseline files

Usage:

pnpm update-screenshots "<actions-run-url>"
# e.g.
pnpm update-screenshots "https://github.com/mendix/web-widgets/actions/runs/12345678?pr=123"

@leonardomendix
leonardomendix requested a review from a team as a code owner March 3, 2026 09:25
@leonardomendix
leonardomendix merged commit 3b8878f into main Apr 24, 2026
14 of 15 checks passed
@leonardomendix
leonardomendix deleted the test/screenshot-baseline-updater branch April 24, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants