test: add ability to run visual tests locally
What does this MR do?
This adds the ability to run visual regression tests locally. Until now, this was recommended against as running the tests on different systems tends to produce different results.
With these changes, visual tests are run in a docker image that pulls registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-puppeteer
, which is the image we use in CI. This should guarantee that tests always run in identical environments, thus producing consistent results.
How to test this?
- Make sure you have Docker installed and running locally.
- Run
yarn test:visual
.- This should build a new docker image, then run the tests in a container.
- Change some story and run
yarn test:visual:update
.- When the process completes, the corresponding screenshot should have been modified accordingly.
- Delete a story and run
yarn test:visual:update
.- The corresponding screenshot should be removed.
Closes #447 (closed)
Edited by Paul Gascou-Vaillancourt