Repository navigation
Add a screen crawler that reports on every route - #15
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 saysparams: 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
crawl-light-desktop,crawl-dark-desktop,crawl-light-phone,crawl-dark-phone.PULP_UI_CRAWL_ACCOUNT=viewercrawls as the read-only account (403 answers are then expected); the default isadmin.PULP_UI_CRAWL_OUTis the output directory (defaultcrawl-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>.jsonand.pngper 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 fromlogin/, 403 answers for the viewer, and the console lines they cause are markedexpectedand 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/playwrightis added as a dev dependency, pinned to 4.13.0.