tests/e2e: adjust failure threshold of snapshot tests

We had increased the failure threshold to prevent test flake
but it is too high to capture diffs on very large snapshot images.
This change decreases the failure threshold and page sizes to
ensure we catch diffs. Test flake is avoided by waiting for style
transitions on the unit page and waiting for network requests to
finish before proceeding with snapshots.

Change-Id: I517027caf31064e4f70dcf121853e34457849d87
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/336710
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/tests/e2e/__image_snapshots__/basic-desktop--404-with-fetch-button-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-desktop--404-with-fetch-button-screenshot-snap.png
index 9a8cf66..9d53e1a 100644
--- a/tests/e2e/__image_snapshots__/basic-desktop--404-with-fetch-button-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-desktop--404-with-fetch-button-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-desktop--badge-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-desktop--badge-screenshot-snap.png
index 4e0875a..2b11c26 100644
--- a/tests/e2e/__image_snapshots__/basic-desktop--badge-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-desktop--badge-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-desktop--error-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-desktop--error-screenshot-snap.png
index b6f7f94..f474eac 100644
--- a/tests/e2e/__image_snapshots__/basic-desktop--error-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-desktop--error-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-desktop--license-policy-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-desktop--license-policy-screenshot-snap.png
index f8ec9a4..a32f1e7 100644
--- a/tests/e2e/__image_snapshots__/basic-desktop--license-policy-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-desktop--license-policy-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-desktop--search-help-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-desktop--search-help-screenshot-snap.png
index c01fcf1..2a024f3 100644
--- a/tests/e2e/__image_snapshots__/basic-desktop--search-help-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-desktop--search-help-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-mobile--404-with-fetch-button-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-mobile--404-with-fetch-button-screenshot-snap.png
index 7426600..00ed0bd 100644
--- a/tests/e2e/__image_snapshots__/basic-mobile--404-with-fetch-button-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-mobile--404-with-fetch-button-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-mobile--badge-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-mobile--badge-screenshot-snap.png
index 6a0429c..8c26b09 100644
--- a/tests/e2e/__image_snapshots__/basic-mobile--badge-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-mobile--badge-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-mobile--error-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-mobile--error-screenshot-snap.png
index c1e32dd..eed5837 100644
--- a/tests/e2e/__image_snapshots__/basic-mobile--error-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-mobile--error-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-mobile--license-policy-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-mobile--license-policy-screenshot-snap.png
index 9fa25e2..5a5c637 100644
--- a/tests/e2e/__image_snapshots__/basic-mobile--license-policy-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-mobile--license-policy-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/basic-mobile--search-help-screenshot-snap.png b/tests/e2e/__image_snapshots__/basic-mobile--search-help-screenshot-snap.png
index 778ffc0..3c463e5 100644
--- a/tests/e2e/__image_snapshots__/basic-mobile--search-help-screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/basic-mobile--search-help-screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/errors-desktop--doc-outline-pkg-overview-snap.png b/tests/e2e/__image_snapshots__/errors-desktop--doc-outline-pkg-overview-snap.png
index abf1e2a..69132b6 100644
--- a/tests/e2e/__image_snapshots__/errors-desktop--doc-outline-pkg-overview-snap.png
+++ b/tests/e2e/__image_snapshots__/errors-desktop--doc-outline-pkg-overview-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/errors-desktop--doc-outline-section-documentation-snap.png b/tests/e2e/__image_snapshots__/errors-desktop--doc-outline-section-documentation-snap.png
deleted file mode 100644
index 8c764aa..0000000
--- a/tests/e2e/__image_snapshots__/errors-desktop--doc-outline-section-documentation-snap.png
+++ /dev/null
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/golang-x-tools-desktop--fixed-header-appears-after-scrolling-snap.png b/tests/e2e/__image_snapshots__/golang-x-tools-desktop--fixed-header-appears-after-scrolling-snap.png
index 3bb9405..97b93b1 100644
--- a/tests/e2e/__image_snapshots__/golang-x-tools-desktop--fixed-header-appears-after-scrolling-snap.png
+++ b/tests/e2e/__image_snapshots__/golang-x-tools-desktop--fixed-header-appears-after-scrolling-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/golang-x-tools-mobile--fixed-header-appears-after-scrolling-snap.png b/tests/e2e/__image_snapshots__/golang-x-tools-mobile--fixed-header-appears-after-scrolling-snap.png
index 6ef3e01..cc37b21 100644
--- a/tests/e2e/__image_snapshots__/golang-x-tools-mobile--fixed-header-appears-after-scrolling-snap.png
+++ b/tests/e2e/__image_snapshots__/golang-x-tools-mobile--fixed-header-appears-after-scrolling-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/search-desktop--no-results-snap.png b/tests/e2e/__image_snapshots__/search-desktop--no-results-snap.png
index b223454..fa1ea44 100644
--- a/tests/e2e/__image_snapshots__/search-desktop--no-results-snap.png
+++ b/tests/e2e/__image_snapshots__/search-desktop--no-results-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/search-desktop--screenshot-snap.png b/tests/e2e/__image_snapshots__/search-desktop--screenshot-snap.png
index 799a318..ade6141 100644
--- a/tests/e2e/__image_snapshots__/search-desktop--screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/search-desktop--screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/search-mobile--no-results-snap.png b/tests/e2e/__image_snapshots__/search-mobile--no-results-snap.png
index 2f15280..3661133 100644
--- a/tests/e2e/__image_snapshots__/search-mobile--no-results-snap.png
+++ b/tests/e2e/__image_snapshots__/search-mobile--no-results-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/search-mobile--screenshot-snap.png b/tests/e2e/__image_snapshots__/search-mobile--screenshot-snap.png
index ce1c074..d4f9cd2 100644
--- a/tests/e2e/__image_snapshots__/search-mobile--screenshot-snap.png
+++ b/tests/e2e/__image_snapshots__/search-mobile--screenshot-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--deprecated-package-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--deprecated-package-snap.png
index 4ebb7b5..87c7b3f 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--deprecated-package-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--deprecated-package-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--errors-imports-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--errors-imports-snap.png
index f59cb1c..ed85b14 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--errors-imports-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--errors-imports-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--errors-licenses-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--errors-licenses-snap.png
index 3e788e5..286a076 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--errors-licenses-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--errors-licenses-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--errors-versions-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--errors-versions-snap.png
index ff4ef20..f7326bf 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--errors-versions-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--errors-versions-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--module-that-is-also-a-package-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--module-that-is-also-a-package-snap.png
index e67c28f..5dd6f7f 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--module-that-is-also-a-package-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--module-that-is-also-a-package-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--module-that-is-not-a-package-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--module-that-is-not-a-package-snap.png
index 6936daa..90e23c1 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--module-that-is-not-a-package-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--module-that-is-not-a-package-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--mvdan-versions-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--mvdan-versions-snap.png
index 11e0672..ce8b85d 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--mvdan-versions-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--mvdan-versions-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--no-documentation-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--no-documentation-snap.png
index f91b397..4000435 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--no-documentation-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--no-documentation-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--package-not-at-latest-version-of-module-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--package-not-at-latest-version-of-module-snap.png
index 67048e8..7132493 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--package-not-at-latest-version-of-module-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--package-not-at-latest-version-of-module-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--package-that-exists-in-multiple-modules-at-the-same-version-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--package-that-exists-in-multiple-modules-at-the-same-version-snap.png
index d2cd494..595e282 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--package-that-exists-in-multiple-modules-at-the-same-version-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--package-that-exists-in-multiple-modules-at-the-same-version-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--package-with-deprecated-symbols-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--package-with-deprecated-symbols-snap.png
index b60c810..f8870b6 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--package-with-deprecated-symbols-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--package-with-deprecated-symbols-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--package-with-higher-major-version-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--package-with-higher-major-version-snap.png
index c32ceec..47158ff 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--package-with-higher-major-version-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--package-with-higher-major-version-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--package-with-multi-goos-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--package-with-multi-goos-snap.png
index 77c8541..96f4fdc 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--package-with-multi-goos-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--package-with-multi-goos-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--package-with-multiple-licenses-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--package-with-multiple-licenses-snap.png
index 568fdab..f30d253 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--package-with-multiple-licenses-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--package-with-multiple-licenses-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--package-with-multiple-nested-modules-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--package-with-multiple-nested-modules-snap.png
deleted file mode 100644
index afcba66..0000000
--- a/tests/e2e/__image_snapshots__/unit-desktop--package-with-multiple-nested-modules-snap.png
+++ /dev/null
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--page-that-will-redirect-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--page-that-will-redirect-snap.png
deleted file mode 100644
index 38f9a89..0000000
--- a/tests/e2e/__image_snapshots__/unit-desktop--page-that-will-redirect-snap.png
+++ /dev/null
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--really-long-import-path-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--really-long-import-path-snap.png
index 827a416..4a86ecf 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--really-long-import-path-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--really-long-import-path-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--retracted-package-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--retracted-package-snap.png
index def634c..5a0dbab 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--retracted-package-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--retracted-package-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--standard-library-licenses-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--standard-library-licenses-snap.png
index f5b0913..9ca8d54 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--standard-library-licenses-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--standard-library-licenses-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--standard-library-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--standard-library-snap.png
index b8e7cb7..453c53f 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--standard-library-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--standard-library-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--standard-library-versions-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--standard-library-versions-snap.png
index cd6d0cc..cbfe8ab 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--standard-library-versions-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--standard-library-versions-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--tools-imports-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--tools-imports-snap.png
deleted file mode 100644
index 332b5f3..0000000
--- a/tests/e2e/__image_snapshots__/unit-desktop--tools-imports-snap.png
+++ /dev/null
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--tools-licenses-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--tools-licenses-snap.png
index 1c3571a..e383bce 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--tools-licenses-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--tools-licenses-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-desktop--tools-snap.png b/tests/e2e/__image_snapshots__/unit-desktop--tools-snap.png
index 6936daa..90e23c1 100644
--- a/tests/e2e/__image_snapshots__/unit-desktop--tools-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-desktop--tools-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--deprecated-package-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--deprecated-package-snap.png
index 5ee4274..88f2a74 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--deprecated-package-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--deprecated-package-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--errors-imports-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--errors-imports-snap.png
index 629820d..0137cb6 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--errors-imports-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--errors-imports-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--errors-licenses-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--errors-licenses-snap.png
index b3eb691..4773c76 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--errors-licenses-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--errors-licenses-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--errors-versions-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--errors-versions-snap.png
index a87d2ac..1f624f1 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--errors-versions-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--errors-versions-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--module-that-is-also-a-package-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--module-that-is-also-a-package-snap.png
index f4965ea..889f773 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--module-that-is-also-a-package-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--module-that-is-also-a-package-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--module-that-is-not-a-package-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--module-that-is-not-a-package-snap.png
index ffb4c25..10a7b2b 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--module-that-is-not-a-package-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--module-that-is-not-a-package-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--mvdan-versions-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--mvdan-versions-snap.png
index 4e3d7aa..52b84ad 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--mvdan-versions-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--mvdan-versions-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--no-documentation-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--no-documentation-snap.png
index 3f04cf4..75361e4 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--no-documentation-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--no-documentation-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--package-not-at-latest-version-of-module-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--package-not-at-latest-version-of-module-snap.png
index 8b2fe75..b6b7533 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--package-not-at-latest-version-of-module-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--package-not-at-latest-version-of-module-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--package-that-exists-in-multiple-modules-at-the-same-version-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--package-that-exists-in-multiple-modules-at-the-same-version-snap.png
index 1018031..4c8da5a 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--package-that-exists-in-multiple-modules-at-the-same-version-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--package-that-exists-in-multiple-modules-at-the-same-version-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--package-with-deprecated-symbols-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--package-with-deprecated-symbols-snap.png
index d3a434d..0fe5468 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--package-with-deprecated-symbols-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--package-with-deprecated-symbols-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--package-with-higher-major-version-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--package-with-higher-major-version-snap.png
index beed7e4..33942b0 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--package-with-higher-major-version-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--package-with-higher-major-version-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--package-with-multi-goos-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--package-with-multi-goos-snap.png
index 60d2085..571a9e9 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--package-with-multi-goos-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--package-with-multi-goos-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--package-with-multiple-licenses-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--package-with-multiple-licenses-snap.png
index b9f3c50..4a912ec 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--package-with-multiple-licenses-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--package-with-multiple-licenses-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--package-with-multiple-nested-modules-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--package-with-multiple-nested-modules-snap.png
deleted file mode 100644
index 4708cd0..0000000
--- a/tests/e2e/__image_snapshots__/unit-mobile--package-with-multiple-nested-modules-snap.png
+++ /dev/null
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--page-that-will-redirect-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--page-that-will-redirect-snap.png
deleted file mode 100644
index 615a3ef..0000000
--- a/tests/e2e/__image_snapshots__/unit-mobile--page-that-will-redirect-snap.png
+++ /dev/null
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--really-long-import-path-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--really-long-import-path-snap.png
index cde2fe3..5ed996e 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--really-long-import-path-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--really-long-import-path-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--retracted-package-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--retracted-package-snap.png
index a1671dc..1fd7268 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--retracted-package-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--retracted-package-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--standard-library-licenses-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--standard-library-licenses-snap.png
index 7058475..cfef04a 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--standard-library-licenses-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--standard-library-licenses-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--standard-library-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--standard-library-snap.png
index 39cfbfd..d2dd792 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--standard-library-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--standard-library-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--standard-library-versions-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--standard-library-versions-snap.png
index 58058c1..bb93135 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--standard-library-versions-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--standard-library-versions-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--tools-imports-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--tools-imports-snap.png
deleted file mode 100644
index 00719d9..0000000
--- a/tests/e2e/__image_snapshots__/unit-mobile--tools-imports-snap.png
+++ /dev/null
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--tools-licenses-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--tools-licenses-snap.png
index 1fa6f26..0ead26e 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--tools-licenses-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--tools-licenses-snap.png
Binary files differ
diff --git a/tests/e2e/__image_snapshots__/unit-mobile--tools-snap.png b/tests/e2e/__image_snapshots__/unit-mobile--tools-snap.png
index fd50f73..10a7b2b 100644
--- a/tests/e2e/__image_snapshots__/unit-mobile--tools-snap.png
+++ b/tests/e2e/__image_snapshots__/unit-mobile--tools-snap.png
Binary files differ
diff --git a/tests/e2e/golang-x-tools.desktop.test.ts b/tests/e2e/golang-x-tools.desktop.test.ts
index 0090ca5..6593672 100644
--- a/tests/e2e/golang-x-tools.desktop.test.ts
+++ b/tests/e2e/golang-x-tools.desktop.test.ts
@@ -9,7 +9,7 @@
 
 import './global-types';
 import * as pg from './helpers/page';
-import * as golangxtools from './helpers/golang-x-tools.page.ts';
+import * as golangxtools from './helpers/golang-x-tools.page';
 
 let page: Page;
 
@@ -25,6 +25,8 @@
 
 test('fixed header appears after scrolling', async () => {
   await page.evaluate(() => window.scrollTo({ top: 250 }));
+  // Wait for header transition
+  await page.evaluate(() => new Promise(r => setTimeout(r, 250)));
   const image = await page.screenshot();
   expect(image).toMatchImageSnapshot();
   await page.evaluate(() => window.scrollTo({ top: 0 }));
@@ -33,14 +35,14 @@
 describe('readme', () => {
   test('expands', async () => {
     await page.click(pg.select('readme-expand'));
-    await page.evaluate(() => window.scrollTo({ top: 0 }));
+    await scrollTop(page);
     const expanded = await page.screenshot({ fullPage: true });
     expect(expanded).toMatchImageSnapshot();
   });
 
   test('collapses', async () => {
     await page.click(pg.select('readme-collapse'));
-    await page.evaluate(() => window.scrollTo({ top: 0 }));
+    await scrollTop(page);
     const collapsed = await page.screenshot({ fullPage: true });
     expect(collapsed).toMatchImageSnapshot();
   });
@@ -49,14 +51,14 @@
 describe('directories', () => {
   test('expand', async () => {
     await page.click(pg.select('directories-toggle'));
-    await page.evaluate(() => window.scrollTo({ top: 0 }));
+    await scrollTop(page);
     const expanded = await page.screenshot({ fullPage: true });
     expect(expanded).toMatchImageSnapshot();
   });
 
   test('collapse', async () => {
     await page.click(pg.select('directories-toggle'));
-    await page.evaluate(() => window.scrollTo({ top: 0 }));
+    await scrollTop(page);
     const collapsed = await page.screenshot({ fullPage: true });
     expect(collapsed).toMatchImageSnapshot();
   });
@@ -65,14 +67,14 @@
 describe('jump to modal', () => {
   test('opens', async () => {
     await page.click(pg.select('jump-to-button'));
-    await page.evaluate(() => window.scrollTo({ top: 0 }));
+    await scrollTop(page);
     const expanded = await page.screenshot();
     expect(expanded).toMatchImageSnapshot();
   });
 
   test('closes', async () => {
     await page.click(pg.select('close-dialog'));
-    await page.evaluate(() => window.scrollTo({ top: 0 }));
+    await scrollTop(page);
     const collapsed = await page.screenshot();
     expect(collapsed).toMatchImageSnapshot();
   });
@@ -81,3 +83,15 @@
 test('no page errors', () => {
   expect(pageErrors).toHaveLength(0);
 });
+
+/**
+ * scrollTop scrolls to the top of a given page and waits
+ * a short amount of time for any style transitions to
+ * complete. Used to make sure the documentation page
+ * header has completed transitioning.
+ * @param page the page to scroll.
+ */
+async function scrollTop(page: Page): Promise<void> {
+  await page.evaluate(() => window.scrollTo({ top: 0 }));
+  await page.evaluate(() => new Promise(r => setTimeout(r, 250)));
+}
diff --git a/tests/e2e/golang-x-tools.mobile.test.ts b/tests/e2e/golang-x-tools.mobile.test.ts
index b529b39..3cdbb69 100644
--- a/tests/e2e/golang-x-tools.mobile.test.ts
+++ b/tests/e2e/golang-x-tools.mobile.test.ts
@@ -26,6 +26,8 @@
 
 test('fixed header appears after scrolling', async () => {
   await page.evaluate(() => window.scrollTo({ top: 250 }));
+  // Wait for header transition
+  await page.evaluate(() => new Promise(r => setTimeout(r, 250)));
   const image = await page.screenshot();
   expect(image).toMatchImageSnapshot();
 });
diff --git a/tests/e2e/helpers/page.ts b/tests/e2e/helpers/page.ts
index f2aa07a..ef14f46 100644
--- a/tests/e2e/helpers/page.ts
+++ b/tests/e2e/helpers/page.ts
@@ -44,7 +44,7 @@
   });
   const go = page.goto;
   page.goto = (path: string, opts?: DirectNavigationOptions) =>
-    go.call(page, GO_DISCOVERY_E2E_BASE_URL + path, opts);
+    go.call(page, GO_DISCOVERY_E2E_BASE_URL + path, { waitUntil: 'networkidle0', ...opts });
   return page;
 }
 
diff --git a/tests/e2e/seed.txt b/tests/e2e/seed.txt
index c4f6a3f..2532d14 100644
--- a/tests/e2e/seed.txt
+++ b/tests/e2e/seed.txt
@@ -14,12 +14,16 @@
 gocloud.dev@v0.22.0
 golang.org/x/tools@v0.0.0-20160406004205-fe1488f8abd7
 golang.org/x/tools@v0.1.1
+golang.org/x/tools@v0.1.2
 k8s.io/client-go@v1.5.2
 mvdan.cc/sh/v3@v3.3.0
 mvdan.cc/sh@v2.6.4+incompatible
 golang.org/x/tools/gopls@v0.6.11
 github.com/jackc/pgx@v3.6.2+incompatible
+std@v1.0.0
+std@v1.13.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.
diff --git a/tests/e2e/setup.ts b/tests/e2e/setup.ts
index fd8226c..4948e2b 100644
--- a/tests/e2e/setup.ts
+++ b/tests/e2e/setup.ts
@@ -9,7 +9,7 @@
 
 // Extends jest to compare image snapshots.
 const toMatchImageSnapshot = configureToMatchImageSnapshot({
-  failureThreshold: 0.1,
+  failureThreshold: 0.001,
   failureThresholdType: 'percent',
   customSnapshotIdentifier: ({ defaultIdentifier, counter }) => {
     return defaultIdentifier.replace('test-ts', '').replace(`-${counter}`, '');
diff --git a/tests/e2e/unit.desktop.test.ts b/tests/e2e/unit.desktop.test.ts
index 139f0fe..10e7f89 100644
--- a/tests/e2e/unit.desktop.test.ts
+++ b/tests/e2e/unit.desktop.test.ts
@@ -16,7 +16,7 @@
 
 beforeAll(async () => {
   page = await pg.newPage();
-  await page.setViewport({ height: 2732, width: 1366 });
+  await page.setViewport({ height: 1366, width: 1366 });
 });
 
 afterAll(async () => {
diff --git a/tests/e2e/unit.mobile.test.ts b/tests/e2e/unit.mobile.test.ts
index e8caea0..4563df6 100644
--- a/tests/e2e/unit.mobile.test.ts
+++ b/tests/e2e/unit.mobile.test.ts
@@ -16,7 +16,7 @@
 
 beforeAll(async () => {
   page = await pg.newPage();
-  await page.setViewport({ height: 2732, width: 500 });
+  await page.setViewport({ height: 1000, width: 500 });
 });
 
 afterAll(async () => {