Skip to content

Streamline visual regression tests by making CI maintain visual snapshots#324

Merged
buckhalt merged 31 commits intoe2e-testingfrom
ci-snapshots-actions
Mar 26, 2025
Merged

Streamline visual regression tests by making CI maintain visual snapshots#324
buckhalt merged 31 commits intoe2e-testingfrom
ci-snapshots-actions

Conversation

@buckhalt
Copy link
Member

@buckhalt buckhalt commented Mar 21, 2025

This PR implements a streamlined approach to visual regression testing. It fixes an issue where snapshots taken when tests are run locally do not match snapshots taken by CI. This refactors the process so that the CI automatically detects snapshot errors and comments with the report. Then, the update snapshots action implemented in #335 and #334 updates the snapshots on comment.

@vercel
Copy link

vercel bot commented Mar 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fresco-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 9:06pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
barf ⬜️ Ignored (Inspect) Visit Preview Mar 26, 2025 9:06pm

@github-actions
Copy link

Playwright visual snapshot differences were detected.

View the Playwright report to review the visual differences.
To approve the snapshot changes and update the snapshots, please comment: /approve-snapshots

@github-actions
Copy link

Playwright visual snapshot differences were detected.

View the Playwright report to review the visual differences.
To approve the snapshot changes and update the snapshots, please comment: /approve-snapshots

@buckhalt buckhalt marked this pull request as ready for review March 24, 2025 21:35
@buckhalt buckhalt marked this pull request as draft March 24, 2025 21:36
@buckhalt
Copy link
Member Author

/approve-snapshots

@github-actions
Copy link

Updating snapshots. Click here to see the status.

@github-actions
Copy link

Playwright visual snapshot differences were detected.

View the Playwright report to review the visual differences.
To approve the snapshot changes and update the snapshots, please comment: /approve-snapshots
Example: /approve-snapshots https://fresco-sandbox.vercel.app/

@buckhalt
Copy link
Member Author

@github-actions
Copy link

Updating snapshots. Click here to see the status.

@github-actions
Copy link

Playwright visual snapshot differences were detected.

View the Playwright report to review the visual differences.
To approve the snapshot changes and update the snapshots, please comment: /approve-snapshots
Example: /approve-snapshots https://fresco-sandbox.vercel.app/

@buckhalt
Copy link
Member Author

@github-actions
Copy link

Updating snapshots. Click here to see the status.

@github-actions
Copy link

🎉 Successfully updated and committed Playwright snapshots! 🎉

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR streamlines visual regression testing by refining how CI handles visual snapshots, ensuring that local and CI snapshots align. Key changes include updating the Playwright configuration with multiple reporters and additional timeouts, modifying E2E tests to toggle between active tests and fixmes for visual snapshot validations, and enhancing the CI workflow to comment on PRs with snapshot reports.

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
playwright.config.ts Updated reporter configuration and added global timeouts.
e2e/protocols.spec.ts Enabled visual snapshot test with soft expectations and fixed test statuses.
e2e/participants.spec.ts Reordered test statuses for visual snapshots and participant actions.
e2e/global.setup.ts Removed the slow flag, updated timeout formats, and modified click timeout values; commented out a toast assertion.
.github/workflows/playwright.yml Added required permissions and steps to capture and comment PR data on visual snapshot failures.
Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

e2e/global.setup.ts:142

  • The removal of the participants imported toast verification reduces the test coverage for validating a successful import. Consider re-enabling or updating this check to ensure that the import success is properly verified.
// // participants imported toast

@buckhalt buckhalt merged commit f91b38f into e2e-testing Mar 26, 2025
5 checks passed
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.

2 participants