Skip to content

Add a screen crawler that reports on every route - #15

Merged
aevnsvi merged 4 commits into
mainfrom
screen-crawler
Oct 29, 2026
Merged

aevnsvi merged 4 commits into
mainfrom
screen-crawler

Conversation

@aevnsvi

@aevnsvi aevnsvi commented Oct 29, 2026

Copy link
Copy Markdown

Adds a Playwright screen crawler that opens every route of the UI and writes a report an agent or a person can act on without looking at the pages.

What it visits: every route declared in src/app-routes.tsx (read as text, so a route entry that cannot be parsed fails the crawl instead of being skipped), plus / and one path no route matches, in the light and dark theme, at desktop (1440x900) and phone (390x844) width, signed in as a test account. Route parameters are resolved from the first object of the matching API list (GET only); where there is nothing to resolve from, a placeholder is used and the report says params: placeholder.

It only navigates and reads: it never clicks, types or submits, and sends no request of its own besides loading pages and the GET list calls for parameters.

Run it against any deployment

export PULP_UI_E2E_BASE_URL=https://pulp.example.org/ui/
export PULP_UI_E2E_ACCOUNTS=/path/to/accounts.json   # same file as the remote projects
PULP_UI_CRAWL_OUT=crawl-report npx playwright test --project='crawl-*' --workers=3
node e2e/crawl/verify-report.mjs crawl-report
  • Projects: crawl-light-desktop, crawl-dark-desktop, crawl-light-phone, crawl-dark-phone.
  • PULP_UI_CRAWL_ACCOUNT=viewer crawls as the read-only account (403 answers are then expected); the default is admin.
  • PULP_UI_CRAWL_OUT is the output directory (default crawl-report/, ignored by git). Reports show a deployment's data and URLs, so keep them on the machine that ran the crawl; no workflow runs the crawler.

Report format

  • <slug>.<theme>.<viewport>.json and .png per screen: route, url, params, theme, viewport, account, title, errorBoundary, loadMs, settled, screenshot, consoleErrors, pageErrors, failedRequests, duplicateRequests, axe violations, and the UI build stamp. The anonymous 401 from login/, 403 answers for the viewer, and the console lines they cause are marked expected and not counted.
  • summary.md: one row per screen, worst first (ties by route, theme, width), followed by the findings grouped across screens. It names no host.
  • index.json: written only after every screen of every route was captured, so an interrupted crawl leaves none.
  • verify-report.mjs <dir> exits non-zero when the index is missing, a route lacks one of the four combinations, a screenshot is missing, a report lacks a field or belongs to another run. It checks completeness only.

Reports and does not gate

Findings never fail the crawl; only a screen that cannot be crawled does. The unit tests of the route parser, the summary and the checker run with npm test.

@axe-core/playwright is added as a dev dependency, pinned to 4.13.0.

The crawler reads the route list from the application source, opens each
screen signed in as a test account and writes a JSON report and a screenshot
per screen: title, error boundary, console and page errors, failed and
repeated requests, and accessibility findings from axe. It only navigates
and reads. One Playwright project covers the light theme at desktop width;
output goes to the ignored crawl-report directory.
Add dark and phone projects, resolve route parameters from the first object
of the matching API list (a placeholder when there is none, recorded in the
report), and summarise a finished run into summary.md and index.json. The
index is written only when every screen of every route was captured, and
verify-report.mjs refuses an incomplete or mixed-run output directory without
ever failing on the findings themselves.
The title lookup waited for an element a crashed page never renders until the
test timed out, so a crashed screen failed the crawl instead of being
reported. The lookup now gives up after a second and falls back to the
document title.
@aevnsvi
aevnsvi merged commit 9783936 into main Oct 29, 2026
6 checks passed
@aevnsvi
aevnsvi deleted the screen-crawler branch October 29, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant