-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Proposal] E2E visual test environment #7705
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
base: main
Are you sure you want to change the base?
Conversation
Further updates. Only examples with I have also added an npm script to run only one test. npm run test:e2e:partial --path=graphics/shapes |
@kpal81xd any thoughts on this? |
Further updates.
|
Nice work! We actually had something similar beforehand for the Editor where we compare screenshots pixel by pixel. However over time updating the testing suite and the screenshots with improvements ended up requiring more work than manually checking the examples ourselves hence we dropped it. In addition as you have mentioned in your 'Current issues' a lot of our examples are not strictly fixed rendered perspectives they include animations such as all the particle examples (and this doesn't include take into account randomness than might occur). One idea I had thought of was instead of storing the screenshots would be a system to compare the examples from two commits through recording them both and comparing the videos. Of course some leniency will be required due to rendering differences and some seeding for the randomness but would be a good guide for general comparisons |
Thanks for the feedback. I understand the situation. It's not easy to create the best solution.
I tried to find a video version of the jest-imege-snapshot, but unfortunately there does not seem to be such a version. I leave it to you all to handle this PR. Hopefully this is the beginning of a discussion on good solutions. |
This PR proposes an E2E (Visual) Regression testing environment using existing examples.
(under discussion in #7697)
Usage
I have introduced some packages, please npm install them.
Since 'examples/cache/metadata.mjs' is referenced to extract test items, so please npm run build in advance in the examples directory.
Then, run the following command on project root.
The examples local server will then start automatically and the E2E test will begin.
On the first run, the rendered images are saved as the "correct images".
The second and subsequent runs will compare the images with the correct images created in the first run.
The following command will update the correct images.
Current Issues
This PR is still rough around the edges, so your feedback is welcome.
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.