Skip to content

Refreshing base images for visual tests

Steve Mattingly edited this page Feb 21, 2023 · 1 revision

Background

This GitHub repository keeps "base" images-- snapshots of each page in the site.

When a pull request (PR) against the staging branch is created or updated, GitHub workflows automatically compare the base images to "actual" page images generated from the PR. Detailed comparison results are attached to the workflow run, and a summary is written to the PR as a comment.

By reviewing the results you can be confident that updates did not have unintentional side effects. (For example, some site elements are shared across many, even all, pages.)

Of course, updating the site means that some changes are intentional. To reflect this, you will need to update or "refresh" the base images to record the new normal.

Instructions

Click the Actions tab near the top of any page in this repository.


Now you will run the action named "Visual regression testing".

Image of GitHub workflow screen

1. Click the action's name in the left sidebar.

2. Click the gray Run workflow button and a dropdown appears.

3. Enter the number of the pull request that contains the intentional changes.

4. Click the green Run workflow button and the process begins. Do not change the Branch setting to anything but master.

When the process completes, the pull request you identified will have a new commit that contains updated base images to be used for future comparisons.