mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Adds the ability to ''locally'' run visual regression testing for wp-admin pages via `npm run test:visual`. Snapshots are stored on contributors' local machines. Note: Wiring to the CI is not included. Why? The challenges for the CI are storage of the artifacts and unreliability of testing these across different environments. This commit is a first step towards visual regression testing. Running it locally provides a learning opportunity which could help to craft how to build it into the automated CI process. Props isabel_brison, andraganescu, azaozz, danfarrow, desrosj, hellofromTonya, justinahinon, netweb, talldanwp. Fixes #49606. git-svn-id: https://develop.svn.wordpress.org/trunk@51989 602fd350-edb4-49c9-b593-d223f7449a82
585 B
585 B
Visual Regression Tests in WordPress Core
These tests make use of Jest and Puppeteer, with a setup very similar to that of the e2e tests, together with jest-image-snapshot for generating the visual diffs.
How to Run the Tests Locally
- Check out trunk.
- Run
npm run test:visualto generate some base snapshots. - Check out the feature branch to be tested.
- Run
npm run test:visualagain. If any tests fail, the diff images can be found intests/visual-regression/specs/__image_snapshots__/__diff_output__.