test: set up Cypress visual diff smoke tests#2707
Open
Conversation
contolini
commented
Mar 16, 2026
|
|
||
| xhr.open('HEAD', url) | ||
| xhr.send() | ||
| }) |
Member
Author
There was a problem hiding this comment.
This helper function wasn't working as expected with the Cypress global afterEach hook so I replaced it with Cypress' native request method.
fac4cbf to
bafb782
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a global
afterEachhook that runs after every test and takes a screenshot of the app's current state. Baseline screenshots are generated withyarn test-visual:baselineand comparisons against the baseline are made withyarn test-visual.Changes
cypress-visual-regressionlibraryafterEachhookTesting
yarn test-visual:baselineto generate baseline screenshots.yarn test-visualto take new screenshots and compare against the baselines. It should fail if you changed something and pass if you didn't.Notes
actualsubdirectory and check thebasesubdirectory into git. Because this is a new thing and all our environments are a little different, I decided to ignore everything for now.