Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Both --update-snapshots and fail on changes #30199

Open
SrBrahma opened this issue Apr 1, 2024 · 1 comment
Open

[Feature]: Both --update-snapshots and fail on changes #30199

SrBrahma opened this issue Apr 1, 2024 · 1 comment

Comments

@SrBrahma
Copy link

SrBrahma commented Apr 1, 2024

🚀 Feature Request

https://discord.com/channels/807756831384403968/1222482350798143488/1222482350798143488

On screenshot changes, I want my CI to fail.

When it fails, a manual job will be available to commit the screenshot changes so that a new CI run will be made, and it shouldn't fail.

I don't want to use --update-snapshots as it doesn't create the diff images and it doesn't fail.

Example

No response

Motivation

I want to integrate Playwright with my CI workflow.

In the meantime, I will make a wrapping code that merges the changed images and the current images.

@SrBrahma
Copy link
Author

SrBrahma commented Apr 10, 2024

I think we could actually change this to be:

updateSnapshots: 'all' doesn't create expected and diff.

I have the following in my CI to detect screenshot changes:

- >
  if ! git diff --exit-code || [ -n "$(git ls-files --others --exclude-standard)" ]; then
    echo "🚨 There are screenshot changes! Check them out in the Artifacts and run the 'playwright-accept-changes' job if you agree with them."
    echo "Listing names of changed files:"
    git diff --name-only
    echo "Listing untracked files:"
    git ls-files --others --exclude-standard
    exit 1
  else
    echo "✅ No Playwright screenshot changes detected."
  fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants