devtools,tests: use screentest for visual diff testing

Screentest is a visual diff testing tool installed from
x/website. This change adds a screentest check to pkgsite
as the first step in replacing the nodejs based e2e tests.

Postgres data is persisted across test runs to speed up
reruns of the test on dev machine.

Change-Id: If0aa12b109ff67033e230c84c549fb10a2beeb46
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/381815
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/devtools/ci/ci.sh b/devtools/ci/ci.sh
index ae86c26..1b65179 100755
--- a/devtools/ci/ci.sh
+++ b/devtools/ci/ci.sh
@@ -100,6 +100,12 @@
 print_duration_and_reset
 
 echo "----------------------------------------"
+echo "Running screentest"
+echo "----------------------------------------"
+./tests/screentest/run.sh --seeddb ci
+print_duration_and_reset
+
+echo "----------------------------------------"
 echo "Running e2e tests"
 echo "----------------------------------------"
 ./tests/e2e/run.sh
diff --git a/devtools/docker/compose.yaml b/devtools/docker/compose.yaml
index fcd0636..c5ac696 100644
--- a/devtools/docker/compose.yaml
+++ b/devtools/docker/compose.yaml
@@ -134,6 +134,8 @@
       POSTGRES_DB: ${GO_DISCOVERY_DATABASE_NAME:-discovery-db}
       POSTGRES_PASSWORD: ${GO_DISCOVERY_DATABASE_PASSWORD:-postgres}
       POSTGRES_USER: ${GO_DISCOVERY_DATABASE_USER:-postgres}
+    volumes:
+      - pgdata:/var/lib/postgresql/data
   nodejs:
     image: node:14.17.0
     environment:
@@ -153,6 +155,10 @@
     image: browserless/chrome:1.46.0-puppeteer-10.1.0
     environment:
       - CONNECTION_TIMEOUT=240000
+  chromedp:
+    # This should match the version we are using in tests/screentest/run.sh.
+    image: chromedp/headless-shell:97.0.4692.71
+    shm_size: 8G
   go:
      # This should match the version we are using on AppEngine.
     image: golang:1.16.7
@@ -166,3 +172,4 @@
     working_dir: /pkgsite
 volumes:
   gomodcache:
+  pgdata:
\ No newline at end of file
diff --git a/tests/screentest/config.yaml b/tests/screentest/config.yaml
new file mode 100644
index 0000000..81de9ce
--- /dev/null
+++ b/tests/screentest/config.yaml
@@ -0,0 +1,7 @@
+experiments:
+  - name: deprecated-doc
+    rollout: 100
+  - name: new-unit-layout
+    rollout: 100
+  - name: styleguide
+    rollout: 0
diff --git a/tests/screentest/run.sh b/tests/screentest/run.sh
new file mode 100755
index 0000000..e073189
--- /dev/null
+++ b/tests/screentest/run.sh
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+# Copyright 2021 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+set -e
+
+source devtools/lib.sh || { echo "Are you at repo root?"; exit 1; }
+
+# This should match the version we are using in devtools/docker/compose.yaml.
+chromedp_version=97.0.4692.71
+
+usage() {
+  >&2 cat <<EOUSAGE
+Usage: $0 [OPTIONS] [ci|local|exp|dev|staging|prod]
+
+  [ci]
+    Run tests against a local server with a seeded database. This is what runs in
+    CI/kokoro and should always pass on master.
+
+  [local]
+    Run tests against a local server started with ./devtools/run_local.sh staging
+    frontend. Use to update the staging snapshots to match changes on master
+    before a deploy.
+
+  [exp|dev|staging|prod]
+    Run the tests against live instance of the given env. Use to verify that there
+    are no unexpected changes after a deploy is complete.
+
+Options:
+
+  --concurrency <N>
+    Set the number of testcases to run concurrently. Defaults to 1. Setting this too
+    high in lower memory environments may cause instability in tests.
+
+  --seeddb
+    Populates the database used when in CI mode during a
+    localhost test run.
+
+  --update
+    Recapture every snapshot during this test run.
+
+  --rm
+    Remove containers and volumes after tests are finished.
+
+EOUSAGE
+  exit 1
+}
+
+dcompose() {
+  msg="$@"
+  # Scrub Token from output.
+  if [[ $msg == *",Token:"* ]]; then
+    msg="${msg%*,Token* *},Token:<redacted> ${msg#*,Token* *}"
+  fi
+  local cmd="docker-compose -f devtools/docker/compose.yaml"
+  info "\$ $cmd $msg"
+  $cmd "$@"
+}
+
+cleanup() {
+  dcompose stop
+  if [ "$rm" = true ]; then
+    dcompose down --volumes --remove-orphans
+  fi
+  if [ ! -z $chromedp ]; then
+    runcmd docker container stop $chromedp
+  fi
+}
+
+main() {
+  trap cleanup EXIT
+  local concurrency="-c 1"
+  local idtoken
+  local seeddb
+  local update
+  while [[ $1 = -* ]]; do
+    case "$1" in
+      "--concurrency"|"-c")
+        shift
+        concurrency="-c $1"
+        ;;
+     "--idtoken")
+        shift
+        idtoken=$1
+        ;; 
+      "--seeddb")
+        seeddb=true
+        ;;
+      "--update"|"-u")
+        update="-u"
+        ;;
+      "--rm")
+        rm=true
+        ;;
+      *)
+        usage
+        exit 1
+    esac
+    shift
+  done
+
+  local env=$1
+  local debugger_url="-d ws://localhost:9222"
+  local vars
+  case $env in
+    ci)
+      debugger_url="-d ws://chromedp:9222"
+      vars="-v Origin:http://frontend:8080"
+      ;;
+    local)
+      vars="-v Origin:http://localhost:8080"
+      ;;
+    exp|dev|staging)
+      debugger_url="-d ws://chromedp:9222"
+      vars="-v Origin:https://$env-pkg.go.dev,QuotaBypass:$GO_DISCOVERY_E2E_QUOTA_BYPASS,Token:$idtoken"
+      ;;
+    prod)
+      vars="-v Origin:https://pkg.go.dev,QuotaBypass:$bypass"
+      ;;
+    *)
+      usage
+      ;;
+  esac
+  if [[ "$update" = -u && "$env" != local ]]; then
+    die "The --update flag should only be used on localhost."
+  fi
+
+  local testfile="tests/screentest/testcases.txt"
+  local cmd="screentest $concurrency $debugger_url $vars $update $testfile"
+
+  if [[ "$env" = ci ]]; then
+    export GO_DISCOVERY_CONFIG_DYNAMIC="tests/screentest/config.yaml"
+    export GO_DISCOVERY_DATABASE_NAME="discovery_e2e_test"
+    export GO_DISCOVERY_SEED_DB_FILE="tests/screentest/seed.txt"
+    if [ "$seeddb" = true ]; then
+      dcompose run --rm seeddb
+    fi
+    dcompose up --detach chromedp
+    dcompose up --detach --force-recreate frontend
+    dcompose run --rm --entrypoint bash go -c "
+      export WAITFORIT_TIMEOUT=120
+      go install golang.org/x/website/cmd/screentest@latest
+      ./third_party/wait-for-it/wait-for-it.sh frontend:8080 --
+      $(echo $cmd)"
+  elif [ "$env" = local ]; then
+    if ! nc -z localhost 9222; then
+      chromedp=$(runcmd docker run --detach --rm --network host --shm-size 8G \
+        --name headless-shell chromedp/headless-shell:$chromedp_version)
+      timeout 3s bash -c -- 'while ! nc -z localhost 9222; do sleep 1; done'
+    fi
+    if ! command -v screentest &> /dev/null; then
+      runcmd go install golang.org/x/website/cmd/screentest@latest
+    fi
+    runcmd $cmd
+  else
+    dcompose up --detach chromedp
+    dcompose run --rm --entrypoint bash go -c "
+      go install golang.org/x/website/cmd/screentest@latest
+      $(echo $cmd)"
+  fi
+}
+
+main $@
diff --git a/tests/screentest/seed.txt b/tests/screentest/seed.txt
new file mode 100644
index 0000000..bc73966
--- /dev/null
+++ b/tests/screentest/seed.txt
@@ -0,0 +1,46 @@
+# Copyright 2021 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# Modules that are expected to return a 200.
+github.com/apache/thrift@v0.14.1
+github.com/apache/thrift@v0.14.2
+github.com/creack/pty@v1.1.11
+github.com/creack/pty@v1.1.13
+github.com/envoyproxy/go-control-plane@v0.9.8
+github.com/envoyproxy/go-control-plane@v0.9.9
+github.com/hashicorp/vault/api@v1.0.3
+github.com/hashicorp/vault/api@v1.1.1
+github.com/hashicorp/vault/api/auth/approle@latest
+github.com/hashicorp/vault/api/auth/kubernetes@latest
+github.com/jackc/pgx/v4@v4.11.0
+github.com/jba/bit@v0.2.0
+github.com/julieqiu/api-demo@all
+github.com/tendermint/tendermint@v0.34.10
+github.com/tendermint/tendermint@v0.34.11
+gocloud.dev@v0.22.0
+gocloud.dev@v0.23.0
+golang.org/x/tools@v0.1.1
+golang.org/x/tools@v0.1.2
+k8s.io/client-go@v0.21.3
+k8s.io/client-go@v1.5.2
+golang.org/x/tools/gopls@v0.6.11
+github.com/jackc/pgx@v3.6.2+incompatible
+rsc.io/quote@v0.9.9-pre1
+rsc.io/quote@all
+rsc.io/quote/v2@all
+rsc.io/quote/v3@all
+rsc.io/quote/v4@all
+std@v1.0.0
+std@v1.1.0
+std@v1.8.0
+std@v1.9.0
+std@v1.10.0
+std@v1.13.0
+std@v1.15.0
+std@v1.16.3
+std@v1.16.4
+
+# This module is expected to return a 404, so that  the path will redirect
+# to github.com/jackc/pgx/v4/pgxpool.
+github.com/jackc/pgx/pgxpool@v3.6.2+incompatible
diff --git a/tests/screentest/testcases.txt b/tests/screentest/testcases.txt
new file mode 100644
index 0000000..a735954
--- /dev/null
+++ b/tests/screentest/testcases.txt
@@ -0,0 +1,184 @@
+windowsize 1536x960
+compare http://localhost:8080::cache {{.Origin}}
+{{with .Token}}header Authorization: Bearer {{.}}{{end}}
+{{with .QuotaBypass}}header X-Go-Discovery-Auth-Bypass-Quota: {{.}}{{end}}
+output tests/screentest/testdata
+# Prevent dynamic readme bages from rendering
+block https://codecov.io/* https://travis-ci.com/*
+
+{{$ready := "[role='treeitem'][aria-selected='true']"}}
+{{$hideImportedby := "document.querySelector(\"[data-test-id='UnitHeader-importedby']\")?.remove();"}}
+{{$scrollTop := "window.scrollTo({top:0});"}}
+
+test short readme has no toggle
+pathname /rsc.io/quote
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test x/tools
+pathname /golang.org/x/tools@v0.1.1
+wait {{$ready}}
+eval {{$scrollTop}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test x/tools readme expanded
+pathname /golang.org/x/tools@v0.1.1#section-readme
+wait {{$ready}}
+eval {{$scrollTop}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test x/tools directories expanded
+pathname /golang.org/x/tools@v0.1.1
+wait {{$ready}}
+click [data-test-id="directories-toggle"]
+eval {{$scrollTop}}
+eval {{$hideImportedby}}
+capture fullscreen
+capture fullscreen 540x1080
+
+test empty jump to modal
+pathname /golang.org/x/tools@v0.1.1
+wait {{$ready}}
+click [data-test-id="jump-to-button"]
+eval {{$hideImportedby}}
+capture viewport
+
+test standard library package
+pathname /errors@go1.16.3
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture fullscreen
+capture fullscreen 540x1080
+
+test really long import path
+pathname /github.com/envoyproxy/go-control-plane@v0.9.8/envoy/config/filter/network/http_connection_manager/v2
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test package that exists in multiple modules at the same versions
+pathname /github.com/hashicorp/vault/api@v1.0.3
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test no documentation
+pathname /github.com/tendermint/tendermint@v0.34.10/cmd/contract_tests
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test module that is also a package
+pathname /gocloud.dev@v0.22.0
+block https://github.com/google/go-cloud/raw/v0.22.0/internal/website/static/go-cdk-logo-gopherblue.png
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test package not at latest version of a module
+pathname /github.com/julieqiu/api-demo/oldpkg
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test standard library
+pathname /std@go1.16.3
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture fullscreen
+capture fullscreen 540x1080
+
+test package with multiple licenses
+pathname /github.com/apache/thrift@v0.14.1
+block https://github.com/apache/thrift/raw/v0.14.1/doc/images/thrift-layers.png
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test package with higher major version
+pathname /rsc.io/quote
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test package with multi-GOOS
+pathname /github.com/creack/pty@v1.1.11
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test retracted package
+pathname /k8s.io/client-go@v1.5.2
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test deprecated package
+pathname /github.com/jba/bit
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture viewport
+capture viewport 540x1080
+
+test package with deprecated symbols
+pathname /database/sql/driver@go1.16.3
+wait {{$ready}}
+eval {{$hideImportedby}}
+capture fullscreen
+capture fullscreen 540x1080
+
+test badge
+pathname /badge
+capture fullscreen
+capture fullscreen 540x1080
+
+test error
+pathname /bad.package@v1.0-badversion
+capture fullscreen
+capture fullscreen 540x1080
+
+test 404 with fetch button
+pathname /github.com/package/does/not/exist
+capture fullscreen
+capture fullscreen 540x1080
+
+test home
+pathname /
+click .go-Carousel-dot
+capture fullscreen
+capture fullscreen 540x1080
+
+test license policy
+pathname /license-policy
+capture fullscreen
+capture fullscreen 540x1080
+
+test search help
+pathname /search-help
+capture fullscreen
+capture fullscreen 540x1080
+
+test search no results
+pathname /search?q=aoeuidhtns
+capture fullscreen
+capture fullscreen 540x1080
+
+test sub-repositories
+pathname /golang.org/x
+capture fullscreen
+capture fullscreen 540x1080
diff --git a/tests/screentest/testdata/404-with-fetch-button-540x1080.localhost-8080.a.png b/tests/screentest/testdata/404-with-fetch-button-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..57b0800
--- /dev/null
+++ b/tests/screentest/testdata/404-with-fetch-button-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/404-with-fetch-button.localhost-8080.a.png b/tests/screentest/testdata/404-with-fetch-button.localhost-8080.a.png
new file mode 100644
index 0000000..80a5012
--- /dev/null
+++ b/tests/screentest/testdata/404-with-fetch-button.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/badge-540x1080.localhost-8080.a.png b/tests/screentest/testdata/badge-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..1216652
--- /dev/null
+++ b/tests/screentest/testdata/badge-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/badge.localhost-8080.a.png b/tests/screentest/testdata/badge.localhost-8080.a.png
new file mode 100644
index 0000000..4feebdd
--- /dev/null
+++ b/tests/screentest/testdata/badge.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/deprecated-package-540x1080.localhost-8080.a.png b/tests/screentest/testdata/deprecated-package-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..d0384ca
--- /dev/null
+++ b/tests/screentest/testdata/deprecated-package-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/deprecated-package.localhost-8080.a.png b/tests/screentest/testdata/deprecated-package.localhost-8080.a.png
new file mode 100644
index 0000000..05b2e05
--- /dev/null
+++ b/tests/screentest/testdata/deprecated-package.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/empty-jump-to-modal.localhost-8080.a.png b/tests/screentest/testdata/empty-jump-to-modal.localhost-8080.a.png
new file mode 100644
index 0000000..fdcdf68
--- /dev/null
+++ b/tests/screentest/testdata/empty-jump-to-modal.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/error-540x1080.localhost-8080.a.png b/tests/screentest/testdata/error-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..0a7ea0f
--- /dev/null
+++ b/tests/screentest/testdata/error-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/error.localhost-8080.a.png b/tests/screentest/testdata/error.localhost-8080.a.png
new file mode 100644
index 0000000..08ce843
--- /dev/null
+++ b/tests/screentest/testdata/error.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/home-540x1080.localhost-8080.a.png b/tests/screentest/testdata/home-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..4ccc1eb
--- /dev/null
+++ b/tests/screentest/testdata/home-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/home.localhost-8080.a.png b/tests/screentest/testdata/home.localhost-8080.a.png
new file mode 100644
index 0000000..5f99fd7
--- /dev/null
+++ b/tests/screentest/testdata/home.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/license-policy-540x1080.localhost-8080.a.png b/tests/screentest/testdata/license-policy-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..8b75d1c
--- /dev/null
+++ b/tests/screentest/testdata/license-policy-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/license-policy.localhost-8080.a.png b/tests/screentest/testdata/license-policy.localhost-8080.a.png
new file mode 100644
index 0000000..c186346
--- /dev/null
+++ b/tests/screentest/testdata/license-policy.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/module-that-is-also-a-package-540x1080.localhost-8080.a.png b/tests/screentest/testdata/module-that-is-also-a-package-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..9916bde
--- /dev/null
+++ b/tests/screentest/testdata/module-that-is-also-a-package-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/module-that-is-also-a-package.localhost-8080.a.png b/tests/screentest/testdata/module-that-is-also-a-package.localhost-8080.a.png
new file mode 100644
index 0000000..74376b6
--- /dev/null
+++ b/tests/screentest/testdata/module-that-is-also-a-package.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/no-documentation-540x1080.localhost-8080.a.png b/tests/screentest/testdata/no-documentation-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..a0a011a
--- /dev/null
+++ b/tests/screentest/testdata/no-documentation-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/no-documentation.localhost-8080.a.png b/tests/screentest/testdata/no-documentation.localhost-8080.a.png
new file mode 100644
index 0000000..8b43a46
--- /dev/null
+++ b/tests/screentest/testdata/no-documentation.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-not-at-latest-version-of-a-module-540x1080.localhost-8080.a.png b/tests/screentest/testdata/package-not-at-latest-version-of-a-module-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..1565545
--- /dev/null
+++ b/tests/screentest/testdata/package-not-at-latest-version-of-a-module-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-not-at-latest-version-of-a-module.localhost-8080.a.png b/tests/screentest/testdata/package-not-at-latest-version-of-a-module.localhost-8080.a.png
new file mode 100644
index 0000000..4f89e19
--- /dev/null
+++ b/tests/screentest/testdata/package-not-at-latest-version-of-a-module.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-that-exists-in-multiple-modules-at-the-same-versions-540x1080.localhost-8080.a.png b/tests/screentest/testdata/package-that-exists-in-multiple-modules-at-the-same-versions-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..d939e0c
--- /dev/null
+++ b/tests/screentest/testdata/package-that-exists-in-multiple-modules-at-the-same-versions-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-that-exists-in-multiple-modules-at-the-same-versions.localhost-8080.a.png b/tests/screentest/testdata/package-that-exists-in-multiple-modules-at-the-same-versions.localhost-8080.a.png
new file mode 100644
index 0000000..d2a4bc6
--- /dev/null
+++ b/tests/screentest/testdata/package-that-exists-in-multiple-modules-at-the-same-versions.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-with-deprecated-symbols-540x1080.localhost-8080.a.png b/tests/screentest/testdata/package-with-deprecated-symbols-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..af88c01
--- /dev/null
+++ b/tests/screentest/testdata/package-with-deprecated-symbols-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-with-deprecated-symbols.localhost-8080.a.png b/tests/screentest/testdata/package-with-deprecated-symbols.localhost-8080.a.png
new file mode 100644
index 0000000..06981f1
--- /dev/null
+++ b/tests/screentest/testdata/package-with-deprecated-symbols.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-with-higher-major-version-540x1080.localhost-8080.a.png b/tests/screentest/testdata/package-with-higher-major-version-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..237fb05
--- /dev/null
+++ b/tests/screentest/testdata/package-with-higher-major-version-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-with-higher-major-version.localhost-8080.a.png b/tests/screentest/testdata/package-with-higher-major-version.localhost-8080.a.png
new file mode 100644
index 0000000..3291a21
--- /dev/null
+++ b/tests/screentest/testdata/package-with-higher-major-version.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-with-multi-GOOS-540x1080.localhost-8080.a.png b/tests/screentest/testdata/package-with-multi-GOOS-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..58aaa32
--- /dev/null
+++ b/tests/screentest/testdata/package-with-multi-GOOS-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-with-multi-GOOS.localhost-8080.a.png b/tests/screentest/testdata/package-with-multi-GOOS.localhost-8080.a.png
new file mode 100644
index 0000000..68871a6
--- /dev/null
+++ b/tests/screentest/testdata/package-with-multi-GOOS.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-with-multiple-licenses-540x1080.localhost-8080.a.png b/tests/screentest/testdata/package-with-multiple-licenses-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..a5936dc
--- /dev/null
+++ b/tests/screentest/testdata/package-with-multiple-licenses-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/package-with-multiple-licenses.localhost-8080.a.png b/tests/screentest/testdata/package-with-multiple-licenses.localhost-8080.a.png
new file mode 100644
index 0000000..a31d2c7
--- /dev/null
+++ b/tests/screentest/testdata/package-with-multiple-licenses.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/really-long-import-path-540x1080.localhost-8080.a.png b/tests/screentest/testdata/really-long-import-path-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..592ac79
--- /dev/null
+++ b/tests/screentest/testdata/really-long-import-path-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/really-long-import-path.localhost-8080.a.png b/tests/screentest/testdata/really-long-import-path.localhost-8080.a.png
new file mode 100644
index 0000000..9a5f3a3
--- /dev/null
+++ b/tests/screentest/testdata/really-long-import-path.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/retracted-package-540x1080.localhost-8080.a.png b/tests/screentest/testdata/retracted-package-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..f7a2dd2
--- /dev/null
+++ b/tests/screentest/testdata/retracted-package-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/retracted-package.localhost-8080.a.png b/tests/screentest/testdata/retracted-package.localhost-8080.a.png
new file mode 100644
index 0000000..ef27172
--- /dev/null
+++ b/tests/screentest/testdata/retracted-package.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/search-help-540x1080.localhost-8080.a.png b/tests/screentest/testdata/search-help-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..f4c9cf7
--- /dev/null
+++ b/tests/screentest/testdata/search-help-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/search-help.localhost-8080.a.png b/tests/screentest/testdata/search-help.localhost-8080.a.png
new file mode 100644
index 0000000..e5d13b9
--- /dev/null
+++ b/tests/screentest/testdata/search-help.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/search-no-results-540x1080.localhost-8080.a.png b/tests/screentest/testdata/search-no-results-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..478f06a
--- /dev/null
+++ b/tests/screentest/testdata/search-no-results-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/search-no-results.localhost-8080.a.png b/tests/screentest/testdata/search-no-results.localhost-8080.a.png
new file mode 100644
index 0000000..7585688
--- /dev/null
+++ b/tests/screentest/testdata/search-no-results.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/short-readme-has-no-toggle-540x1080.localhost-8080.a.png b/tests/screentest/testdata/short-readme-has-no-toggle-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..237fb05
--- /dev/null
+++ b/tests/screentest/testdata/short-readme-has-no-toggle-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/short-readme-has-no-toggle.localhost-8080.a.png b/tests/screentest/testdata/short-readme-has-no-toggle.localhost-8080.a.png
new file mode 100644
index 0000000..3291a21
--- /dev/null
+++ b/tests/screentest/testdata/short-readme-has-no-toggle.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/standard-library-540x1080.localhost-8080.a.png b/tests/screentest/testdata/standard-library-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..a458a9d
--- /dev/null
+++ b/tests/screentest/testdata/standard-library-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/standard-library-package-540x1080.localhost-8080.a.png b/tests/screentest/testdata/standard-library-package-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..1287b9d
--- /dev/null
+++ b/tests/screentest/testdata/standard-library-package-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/standard-library-package.localhost-8080.a.png b/tests/screentest/testdata/standard-library-package.localhost-8080.a.png
new file mode 100644
index 0000000..12f7444
--- /dev/null
+++ b/tests/screentest/testdata/standard-library-package.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/standard-library.localhost-8080.a.png b/tests/screentest/testdata/standard-library.localhost-8080.a.png
new file mode 100644
index 0000000..2747350
--- /dev/null
+++ b/tests/screentest/testdata/standard-library.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/sub-repositories-540x1080.localhost-8080.a.png b/tests/screentest/testdata/sub-repositories-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..4753436
--- /dev/null
+++ b/tests/screentest/testdata/sub-repositories-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/sub-repositories.localhost-8080.a.png b/tests/screentest/testdata/sub-repositories.localhost-8080.a.png
new file mode 100644
index 0000000..581387e
--- /dev/null
+++ b/tests/screentest/testdata/sub-repositories.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/x-tools-540x1080.localhost-8080.a.png b/tests/screentest/testdata/x-tools-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..4136de9
--- /dev/null
+++ b/tests/screentest/testdata/x-tools-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/x-tools-directories-expanded-540x1080.localhost-8080.a.png b/tests/screentest/testdata/x-tools-directories-expanded-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..274c0b3
--- /dev/null
+++ b/tests/screentest/testdata/x-tools-directories-expanded-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/x-tools-directories-expanded.localhost-8080.a.png b/tests/screentest/testdata/x-tools-directories-expanded.localhost-8080.a.png
new file mode 100644
index 0000000..2a9aeea
--- /dev/null
+++ b/tests/screentest/testdata/x-tools-directories-expanded.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/x-tools-readme-expanded-540x1080.localhost-8080.a.png b/tests/screentest/testdata/x-tools-readme-expanded-540x1080.localhost-8080.a.png
new file mode 100644
index 0000000..8769a61
--- /dev/null
+++ b/tests/screentest/testdata/x-tools-readme-expanded-540x1080.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/x-tools-readme-expanded.localhost-8080.a.png b/tests/screentest/testdata/x-tools-readme-expanded.localhost-8080.a.png
new file mode 100644
index 0000000..309d7ad
--- /dev/null
+++ b/tests/screentest/testdata/x-tools-readme-expanded.localhost-8080.a.png
Binary files differ
diff --git a/tests/screentest/testdata/x-tools.localhost-8080.a.png b/tests/screentest/testdata/x-tools.localhost-8080.a.png
new file mode 100644
index 0000000..0ce3323
--- /dev/null
+++ b/tests/screentest/testdata/x-tools.localhost-8080.a.png
Binary files differ