| # TODO(jba): add an element to pkgsite pages after all JS has run | |
| # on the page, and replaces sleeps in this file with a wait for that element. | |
| windowsize 1536x960 | |
| {{with .Token}}header Authorization: Bearer {{.}}{{end}} | |
| {{with .QuotaBypass}}header X-Go-Discovery-Auth-Bypass-Quota: {{.}}{{end}} | |
| # Prevent dynamic readme badges from rendering | |
| block https://codecov.io/* https://travis-ci.com/* | |
| # The aria-selected attribute is added by the last piece of JS to run. | |
| {{$ready := "[role='treeitem'][aria-selected='true']"}} | |
| {{$hideElements := "const s=document.createElement('style');s.innerHTML='*{transition:none!important;animation:none!important;caret-color:transparent!important} .js-cookieNotice { display: none !important; }';document.head.appendChild(s);document.querySelector(\"[data-test-id='UnitHeader-importedby']\")?.remove();document.querySelector(\"[data-test-id='meta-link-depsdev']\")?.remove();document.querySelector(\"[data-test-id='meta-link-codewiki']\")?.remove();"}} | |
| # JS for hiding the "Links" heading. We are already hiding the deps.dev link because | |
| # its presence depends on a timeout, but for some modules, if the link isn't | |
| # there then the "Links" heading also isn't there. | |
| # We don't always want to do this, because we usually want to compare the rendering of the Links section. | |
| {{$hideLinksHeading := "document.querySelector(\"[data-test-id='links-heading']\")?.remove();"}} | |
| {{$scrollTop := "window.scrollTo({top:0});"}} | |
| test short readme has no toggle and higher major version | |
| path /rsc.io/quote | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| eval {{$hideLinksHeading}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| test x/tools | |
| path /golang.org/x/tools@v0.1.1 | |
| wait {{$ready}} | |
| eval {{$scrollTop}} | |
| eval {{$hideElements}} | |
| sleep 4s | |
| capture viewport | |
| capture viewport 540x1080 | |
| test x/tools readme expanded | |
| path /golang.org/x/tools@v0.1.1#section-readme | |
| wait {{$ready}} | |
| # Scroll to bottom to make lazy images load. | |
| eval window.scrollTo({top: document.body.scrollHeight}); | |
| eval {{$scrollTop}} | |
| eval {{$hideElements}} | |
| sleep 3s | |
| capture viewport | |
| # This fails about half the time in CI. | |
| # capture viewport 540x1080 | |
| test x/net directories expanded | |
| path /golang.org/x/net@v0.31.0 | |
| wait {{$ready}} | |
| click [data-test-id="directories-toggle"] | |
| eval {{$scrollTop}} | |
| eval {{$hideElements}} | |
| sleep 3s | |
| capture fullscreen | |
| capture fullscreen 540x1620 | |
| # TODO: https://go.dev/issue/51020 | |
| test empty jump to modal | |
| path /golang.org/x/tools@v0.1.1 | |
| wait {{$ready}} | |
| click [data-test-id="jump-to-button"] | |
| eval {{$hideElements}} | |
| capture viewport | |
| test standard library package | |
| path /errors@go1.16.3 | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test really long import path | |
| path /github.com/envoyproxy/go-control-plane@v0.9.8/envoy/config/filter/network/http_connection_manager/v2 | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| test package that exists in multiple modules at the same versions | |
| path /github.com/hashicorp/vault/api@v1.0.3 | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| test no documentation | |
| path /github.com/tendermint/tendermint@v0.34.10/cmd/contract_tests | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| test module that is also a package | |
| path /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 {{$hideElements}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| test package not at latest version of a module | |
| path /github.com/julieqiu/api-demo/oldpkg | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| test standard library | |
| path /std@go1.16.3 | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test package with multiple licenses | |
| path /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 {{$hideElements}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| test package with multi-GOOS | |
| path /github.com/creack/pty@v1.1.11 | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| eval {{$hideLinksHeading}} | |
| sleep 1s | |
| capture viewport | |
| # This fails around 40% of the time with an 11-pixel difference. That is due to | |
| # a slightly longer scrollbar. Changing "viewport" to "fullscreen" reveals that | |
| # the real difference is the page length: there is extra blank space at the | |
| # bottom of varying size. | |
| # I have not been able to fix that or understand why it happens. | |
| # capture viewport 540x1080 | |
| test retracted package | |
| path /k8s.io/client-go@v1.5.2 | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| test deprecated package | |
| path /github.com/jba/bit | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| capture viewport | |
| capture viewport 540x1080 | |
| # The dockerized chromedp behaves oddly with this test | |
| # when doing a fullscreen capture. | |
| # Part of the way down in the display, the page begins | |
| # again from the top. | |
| # So do a viewport capture instead. | |
| test package with deprecated symbols index | |
| path /database/sql/driver@go1.16.3#pkg-index | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| sleep 2s | |
| capture viewport | |
| # Screen doesn't scroll to index section in chromedp. | |
| # It works on a phone, however. | |
| #capture viewport 540x1080 | |
| # Same as the above, but for symbol doc. | |
| test package with deprecated symbols symbol | |
| path /database/sql/driver@go1.16.3#ColumnConverter | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| sleep 1s | |
| capture viewport | |
| # Screen doesn't scroll to symbol doc in chromedp. | |
| # It works on a phone, however. | |
| #capture viewport 540x1080 | |
| test about | |
| path /about | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test badge | |
| path /badge/ | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test error | |
| status 400 | |
| path /bad.package@v1.0-badversion | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test 404 with fetch button | |
| status 404 | |
| path /github.com/package/does/not/exist | |
| sleep 1s | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test home | |
| path / | |
| click .go-Carousel-dot | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test license policy | |
| path /license-policy | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test search help | |
| path /search-help | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test search no results | |
| path /search?q=aoeuidhtns | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test sub-repositories | |
| path /golang.org/x | |
| capture fullscreen | |
| capture fullscreen 540x1080 | |
| test nav submenu | |
| path /github.com/jba/bit | |
| wait {{$ready}} | |
| eval {{$hideElements}} | |
| sleep 3s | |
| click .js-desktop-menu-hover | |
| capture viewport |