regenerating-screenshots

Creates a labeled PR that triggers the GitHub Action to regenerate Playwright screenshot expectations.

2.0k|679|Updated Jun 13, 2024
One-click install
npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill regenerating-screenshots
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: regenerating-screenshots
Source: https://github.com/Comfy-Org/ComfyUI_frontend/tree/main/.claude/skills/regenerating-screenshots
Command: npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill regenerating-screenshots

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Playwright screenshot tests fail on main or pull requests when golden images become stale, and manually regenerating expectations locally is slow and error-prone. This Skill automates the entire process of triggering the repository's "PR: Update Playwright Expectations" GitHub Action.

Core Features & Use Cases

  • Automated PR Creation: Fetches the latest main, creates a timestamped branch with an empty commit, pushes it, and opens a PR.
  • Workflow Triggering: Adds the "New Browser Test Expectations" label via the GitHub API so the Playwright expectations workflow runs and commits updated snapshots back to the branch.
  • Use Case: Screenshot tests are failing on main after a UI change. Run this Skill to open a regeneration PR, let the GitHub Action update the golden images, and merge the result to fix the failing tests.

Quick Start

Ask the assistant to regenerate the Playwright screenshot expectations because the screenshot tests are failing on main.

Frequently Asked Questions about regenerating-screenshots

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I regenerate Playwright screenshot expectations in CI?

Create a branch from origin/main with an empty commit, push it, and open a PR. Then add the "New Browser Test Expectations" label via the GitHub API, which triggers the workflow that runs Playwright with --update-snapshots and commits the results back to the branch.

Why are my Playwright screenshot tests failing on main?

Screenshot tests fail when the stored golden images no longer match the current rendered UI, usually after visual changes. Regenerating the expectations updates the baseline snapshots so comparisons pass again.

Why doesn't adding the label during PR creation trigger the GitHub Action?

The labeled event only fires when a label is added after the PR already exists, not when applied during creation with --label. Add the label as a separate step using the GitHub API issues labels endpoint.

Why does gh pr edit --add-label fail for this workflow?

The gh pr edit --add-label command fails due to deprecated Projects Classic GraphQL errors. Use gh api to POST to the issues labels endpoint instead, which reliably attaches the label.

Do I need to wait for the screenshot regeneration Action to finish?

No, the process is fire-and-forget. The workflow runs Playwright with --update-snapshots, commits updated screenshots to the PR branch, and removes the label automatically without monitoring.