1 Commits
Author SHA1 Message Date
clawbot 581d1e9390 test/viewport/README.md rewritten sentence by sentence
check / check (push) Canceled after 0s
What the test does comes first, then the widths, the checks, the
canned network, what it cannot check, the files, and its relation to
the unit tests. The repo's history and issue references are gone;
every sentence is under about 30 words.

Model: fable-5-1
2026-10-26 03:40:07 +00:00
2 changed files with 590 additions and 528 deletions

No files matched your search

+579 -517
View File
File diff suppressed because it is too large. Load diff
+11 -11
View File
@@ -7,15 +7,15 @@ in a real browser:
make frontend-viewport-test make frontend-viewport-test
``` ```
First it runs the unit tests. Then it builds the page into `dist/`. It serves It runs the unit tests, builds the page into `dist/`, and serves it from the
`dist/` with the nginx image and the `configs/nginx.conf` that the Docker image same nginx image, with the same `configs/nginx.conf`, as the Docker image.
ships. Before the browser starts, it fetches `/` and `/no-such-page`, which Before the browser starts, it checks that `/`, and a path nginx answers with the
nginx answers with the page. Both must carry `Cache-Control: no-cache` and a page, are served with `Cache-Control: no-cache` and a `Content-Security-Policy`
`Content-Security-Policy` header. Then it starts a headless Chrome in a header. Then it starts a headless Chrome in a container and opens the page in it
container and opens the page in it at each width. For each width it measures the at each width. For each width it measures the layout inside the page and checks
layout inside the page and checks the measurements in Node. The checks decide the measurements in Node. The checks decide pass or fail. Screenshots and a
pass or fail. Screenshots and a `results.json` land in `tmp/viewport/`, for a `results.json` land in `tmp/viewport/`, for a person to look at when a check
person to look at when a check fails. fails.
The test is not part of `make check`: it needs Docker and takes minutes, and The test is not part of `make check`: it needs Docker and takes minutes, and
`make test` has to finish in under 60 seconds. `make test` has to finish in under 60 seconds.
@@ -51,7 +51,7 @@ Four more widths are fixed, each for a stated reason:
## The checks ## The checks
A failed check does not stop the others. Every check runs at every width, and none stops the others.
- `app-rendered`: at least 10 WAN host rows exist, and at least 5 rows show a - `app-rendered`: at least 10 WAN host rows exist, and at least 5 rows show a
number as their latency. Without this, the other checks could pass against a number as their latency. Without this, the other checks could pass against a
@@ -99,7 +99,7 @@ So the rows show one-, two- and three-digit latencies and some unreachable rows,
and the layout is tested against that spread. The request to and the layout is tested against that spread. The request to
`http://192.168.1.1` is answered, so the `Local Gateway` row appears. `http://192.168.1.1` is answered, so the `Local Gateway` row appears.
At each width, the test sets the interval to 1 second and waits until at least 5 On each page, the test sets the interval to 1 second and waits until at least 5
rows show a latency before it measures. The page discards its first round, so rows show a latency before it measures. The page discards its first round, so
this reaches a filled page without waiting out two rounds at 3 seconds. this reaches a filled page without waiting out two rounds at 3 seconds.