diff options
| author | Jonathan Amsterdam <jba@google.com> | 2024-11-13 15:25:53 -0500 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2024-11-20 17:58:17 +0000 |
| commit | ea85ca2ca55b2a1cc68edd47b32efb1baf309ec2 (patch) | |
| tree | 55db0571d428f2018f46ee6116c7dd2db2e64578 /cmd | |
| parent | 78dc39e838a4aa2cd40c80077b41313825e2e911 (diff) | |
| download | go-x-website-ea85ca2ca55b2a1cc68edd47b32efb1baf309ec2.tar.xz | |
cmd/screentest: rename pathname to path
That part of a URL is properly called a path.
Change-Id: I4ce1765e99a3e2d76bb600b90cdc4fd6f6e320f1
Reviewed-on: https://go-review.googlesource.com/c/website/+/627601
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/golangorg/testdata/screentest/godev.txt | 28 | ||||
| -rw-r--r-- | cmd/golangorg/testdata/screentest/relnotes.txt | 4 | ||||
| -rw-r--r-- | cmd/screentest/main.go | 12 | ||||
| -rw-r--r-- | cmd/screentest/screentest.go | 4 | ||||
| -rw-r--r-- | cmd/screentest/testdata/cached.txt | 2 | ||||
| -rw-r--r-- | cmd/screentest/testdata/fail.txt | 4 | ||||
| -rw-r--r-- | cmd/screentest/testdata/pass.txt | 6 | ||||
| -rw-r--r-- | cmd/screentest/testdata/readtests-ends-with-capture.txt | 2 | ||||
| -rw-r--r-- | cmd/screentest/testdata/readtests-filter.txt | 4 | ||||
| -rw-r--r-- | cmd/screentest/testdata/readtests-no-capture.txt | 2 | ||||
| -rw-r--r-- | cmd/screentest/testdata/readtests.txt | 8 | ||||
| -rw-r--r-- | cmd/screentest/testdata/readtests2.txt | 4 |
12 files changed, 40 insertions, 40 deletions
diff --git a/cmd/golangorg/testdata/screentest/godev.txt b/cmd/golangorg/testdata/screentest/godev.txt index 1ef62bcc..b33a4b6a 100644 --- a/cmd/golangorg/testdata/screentest/godev.txt +++ b/cmd/golangorg/testdata/screentest/godev.txt @@ -1,72 +1,72 @@ windowsize 1536x960 test homepage -pathname / +path / capture fullscreen capture fullscreen 540x1080 test why go case studies -pathname /solutions/case-studies +path /solutions/case-studies capture fullscreen capture fullscreen 540x1080 test why go use cases -pathname /solutions/use-cases +path /solutions/use-cases capture fullscreen capture fullscreen 540x1080 test getting started -pathname /learn/ +path /learn/ capture fullscreen capture fullscreen 540x1080 test docs -pathname /doc/ +path /doc/ capture fullscreen capture fullscreen 540x1080 test playground -pathname /play/ +path /play/ capture fullscreen capture fullscreen 540x1080 test blog -pathname /blog/ +path /blog/ capture fullscreen capture fullscreen 540x1080 test blog post -pathname /blog/12years +path /blog/12years capture fullscreen capture fullscreen 540x1080 test help -pathname /help/ +path /help/ status 301 capture fullscreen capture fullscreen 540x1080 test effective go -pathname /doc/effective_go +path /doc/effective_go capture fullscreen capture fullscreen 540x1080 test release notes -pathname /doc/devel/release +path /doc/devel/release capture fullscreen capture fullscreen 540x1080 test about -pathname /project +path /project capture fullscreen capture fullscreen 540x1080 test tour -pathname /tour/welcome/1 +path /tour/welcome/1 capture fullscreen capture fullscreen 540x1080 test code of conduct -pathname /conduct +path /conduct capture fullscreen capture fullscreen 540x1080 diff --git a/cmd/golangorg/testdata/screentest/relnotes.txt b/cmd/golangorg/testdata/screentest/relnotes.txt index 866f8250..fa3cb364 100644 --- a/cmd/golangorg/testdata/screentest/relnotes.txt +++ b/cmd/golangorg/testdata/screentest/relnotes.txt @@ -1,11 +1,11 @@ windowsize 1536x960 test rl0 -pathname /doc/go1 +path /doc/go1 capture fullscreen {{range ints 1 22}} test rl{{.}} - pathname /doc/go1.{{.}} + path /doc/go1.{{.}} capture fullscreen {{end}} diff --git a/cmd/screentest/main.go b/cmd/screentest/main.go index e7e88df9..4b7bfc92 100644 --- a/cmd/screentest/main.go +++ b/cmd/screentest/main.go @@ -12,7 +12,7 @@ result. The comparisons are driven by a script file in a format described below. screentest [flags] testURL wantURL file ... The first two arguments are the URLs being tested and the URL of the desired result, -respectively. The remaining arguments are script file pathnames. +respectively. The remaining arguments are script file paths. The URLs can be actual URLs for http:, https:, file: or gs: schemes, or they can be slash-separated file paths (even on Windows). @@ -57,7 +57,7 @@ with the dimensions of the screenshots to be compared. For example, here is a trivial script: test about - pathname /about + path /about capture fullscreen This script has a single test case. The first line names the test. @@ -83,9 +83,9 @@ Use test NAME to create a name for the test case. test about page -Use pathname PATH to set the page to visit at each origin. +Use path PATH to set the page to visit at each origin. - pathname /about + path /about Use status CODE to set an expected HTTP status code. The default is 200. @@ -122,13 +122,13 @@ Each capture directive creates a new test case for a single page. windowsize 1536x960 test homepage - pathname / + path / capture viewport capture viewport 540x1080 capture viewport 400x1000 test about page - pathname /about + path /about capture viewport capture viewport 540x1080 capture viewport 400x1000 diff --git a/cmd/screentest/screentest.go b/cmd/screentest/screentest.go index c247f25d..b3349da3 100644 --- a/cmd/screentest/screentest.go +++ b/cmd/screentest/screentest.go @@ -288,7 +288,7 @@ func readTests(file, testURL, wantURL string, common common) (_ []*testcase, err return nil, fmt.Errorf("strconv.Atoi(%q): %w", args, err) } - case "PATHNAME": + case "PATH": if test == nil { return nil, errors.New("directive must be in a test") } @@ -331,7 +331,7 @@ func readTests(file, testURL, wantURL string, common common) (_ []*testcase, err return nil, errors.New("directive must be in a test") } if test.path == "" { - return nil, errors.New("missing pathname") + return nil, errors.New("missing path") } test.screenshotType = viewportScreenshot // default to viewportScreenshot test.viewportWidth = width diff --git a/cmd/screentest/testdata/cached.txt b/cmd/screentest/testdata/cached.txt index 2c75a8bf..7b8aaa55 100644 --- a/cmd/screentest/testdata/cached.txt +++ b/cmd/screentest/testdata/cached.txt @@ -1,5 +1,5 @@ windowsize 1536x960 test homepage -pathname / +path / capture viewport diff --git a/cmd/screentest/testdata/fail.txt b/cmd/screentest/testdata/fail.txt index 6bb7b7e0..17e53726 100644 --- a/cmd/screentest/testdata/fail.txt +++ b/cmd/screentest/testdata/fail.txt @@ -1,9 +1,9 @@ test homepage -pathname / +path / capture viewport test 404 missing selector -pathname /404 +path /404 wait [role='treeitem'][aria-selected='true'] capture viewport diff --git a/cmd/screentest/testdata/pass.txt b/cmd/screentest/testdata/pass.txt index 8bfcc83b..0d74917e 100644 --- a/cmd/screentest/testdata/pass.txt +++ b/cmd/screentest/testdata/pass.txt @@ -1,13 +1,13 @@ test homepage -pathname / +path / capture viewport test not found -pathname /page-not-found +path /page-not-found status 404 capture test notfound fragment -pathname /page-not-found-with-fragment#fragment +path /page-not-found-with-fragment#fragment status 404 capture diff --git a/cmd/screentest/testdata/readtests-ends-with-capture.txt b/cmd/screentest/testdata/readtests-ends-with-capture.txt index 6f47c8bf..d3b16391 100644 --- a/cmd/screentest/testdata/readtests-ends-with-capture.txt +++ b/cmd/screentest/testdata/readtests-ends-with-capture.txt @@ -1,5 +1,5 @@ test foo -pathname bar +path bar capture fullscreen click something diff --git a/cmd/screentest/testdata/readtests-filter.txt b/cmd/screentest/testdata/readtests-filter.txt index cf08d47d..aec55ef7 100644 --- a/cmd/screentest/testdata/readtests-filter.txt +++ b/cmd/screentest/testdata/readtests-filter.txt @@ -1,8 +1,8 @@ test foo -pathname p +path p capture fullscreen capture viewport 20x30 test bar -pathname p +path p capture fullscreen diff --git a/cmd/screentest/testdata/readtests-no-capture.txt b/cmd/screentest/testdata/readtests-no-capture.txt index b90a564e..a2665732 100644 --- a/cmd/screentest/testdata/readtests-no-capture.txt +++ b/cmd/screentest/testdata/readtests-no-capture.txt @@ -1,5 +1,5 @@ test foo -pathname / +path / test bar wait foo diff --git a/cmd/screentest/testdata/readtests.txt b/cmd/screentest/testdata/readtests.txt index d187e04d..faa00ead 100644 --- a/cmd/screentest/testdata/readtests.txt +++ b/cmd/screentest/testdata/readtests.txt @@ -1,21 +1,21 @@ windowsize 1536x960 test go.dev homepage -pathname / +path / capture fullscreen capture fullscreen 540x1080 test about page -pathname /about +path /about capture fullscreen test homepage element -pathname / +path / click .go-Carousel-dot capture element .go-Carousel test net package doc -pathname /net +path /net wait [role="treeitem"][aria-expanded="true"] capture viewport capture viewport 540x1080 diff --git a/cmd/screentest/testdata/readtests2.txt b/cmd/screentest/testdata/readtests2.txt index e44c1925..e39c0708 100644 --- a/cmd/screentest/testdata/readtests2.txt +++ b/cmd/screentest/testdata/readtests2.txt @@ -1,11 +1,11 @@ windowsize 100x200 test about -pathname /about +path /about capture test eval -pathname /eval +path /eval eval console.log('hello, world!') capture |
