-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try visual regression testing #51287
Closed
Closed
Conversation
This file contains 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
kevin940726
added
the
[Type] Automated Testing
Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
label
Jun 7, 2023
Size Change: +77 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
kevin940726
force-pushed
the
try/visual-testing
branch
from
June 7, 2023 10:15
0dc68d1
to
26a07c9
Compare
kevin940726
force-pushed
the
try/visual-testing
branch
from
June 7, 2023 14:03
a10eb96
to
4762d75
Compare
Flaky tests detected in 1df3f39. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5202625090
|
kevin940726
force-pushed
the
try/visual-testing
branch
from
June 8, 2023 02:00
9cfb91c
to
dde0a8b
Compare
Closing as stale |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Type] Automated Testing
Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
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.
What?
A proof of concept of how visual regression testing would work with Playwright.
Prior arts: #46210, #51000.
Why?
While we already have some visual regression testing in place, they all operate only locally and require manual comparison. This PR commits the captured images and rerun them on CI to make this process automatic and cross-platform. The images are now treated as snapshots.
How?
We run the tests locally with docker to get consistent results. That's basically it really.
The idea is that visual testing will be reserved as an advanced feature and only a few experienced testers will be able to generate those images. Hence, the difficulty of using a docker locally is partially justified. This hopefully also limits the amount and size of the generated images because they will have to be cloned for every contributor. Visual regression testing will have to be used sparingly in this approach, but I think it's also a good practice since visual testing can often be too slow and lack focuses.
Testing Instructions
.wp-env.override.json
in the root directory with the following content if you're now using Linux. (This is a temporary fix until we figure out a way to make accessing localhost in docker seamlessly)wp-env
by runningnpm run env stop
thennpm run env start -- --update
.npm run test:e2e:docker
npm run test:e2e:docker -- -- -- -u
Screenshots or screencast
See the files tab.