aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorJamal Carvalho <jamal@golang.org>2021-12-21 17:29:54 +0000
committerJamal Carvalho <jamalcarvalho@google.com>2021-12-21 22:12:49 +0000
commit91908baf207cabb8da132552b20538edda69713c (patch)
tree80b65ae49eff20507b5f055dc3b54ecb34173d7c /cmd
parentdc59b705fa7a433050331fc24ecad4ebd4d37404 (diff)
downloadgo-x-website-91908baf207cabb8da132552b20538edda69713c.tar.xz
internal/screentest: add support for evaluating javascript
Added the eval keyword to allow for evaluating JS. Useful for manipulating or hiding DOM elements prior to screenshot capture. Change-Id: I508f3949c2eed7d55fc4e168781ab4c3e00edb5b Reviewed-on: https://go-review.googlesource.com/c/website/+/373714 Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Trust: Jamal Carvalho <jamalcarvalho@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/screentest/testdata/godev.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/screentest/testdata/godev.txt b/cmd/screentest/testdata/godev.txt
index f92ab571..a19ea05e 100644
--- a/cmd/screentest/testdata/godev.txt
+++ b/cmd/screentest/testdata/godev.txt
@@ -3,6 +3,8 @@ compare https://go.dev http://localhost:6060/go.dev
test homepage
pathname /
+# The data in _content/events.yaml is stale, hide this section from the screenshots.
+eval document.querySelector('.LearnGo').style.display = 'none';
capture fullscreen
capture fullscreen 540x1080
@@ -13,6 +15,8 @@ capture fullscreen 540x1080
test getting started
pathname /learn/
+# The data in _content/events.yaml is stale, hide this section from the screenshots.
+eval document.querySelector('.Learn-meetups').style.display = 'none';
capture fullscreen
capture fullscreen 540x1080