Skip to content

test: add ability to run visual tests locally

Paul Gascou-Vaillancourt requested to merge 447-storyshots-docker into main

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?

  1. Make sure you have Docker installed and running locally.
  2. Run yarn test:visual.
    • This should build a new docker image, then run the tests in a container.
  3. Change some story and run yarn test:visual:update.
    • When the process completes, the corresponding screenshot should have been modified accordingly.
  4. Delete a story and run yarn test:visual:update.
    • The corresponding screenshot should be removed.

Closes #447 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports