Skip to content

docs: docs-tests harness for Console UI drift detection#2669

Draft
marcel-rbro wants to merge 5 commits into
masterfrom
docs/ui-tests
Draft

docs: docs-tests harness for Console UI drift detection#2669
marcel-rbro wants to merge 5 commits into
masterfrom
docs/ui-tests

Conversation

@marcel-rbro

@marcel-rbro marcel-rbro commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Part of #2671

What

Adds docs-tests/ — a docs-as-tests harness that catches when the platform docs claim something the Console UI no longer does (a renamed tab, a moved route, a relabeled button).

Model: an adjustable list of docs pages → AI-extracted assertions → a committed, reviewed baseline → evaluated against Console staging with Playwright. Failures point back to source_file:line so the offending prose is one click away.

pages.json ──extract──▶ assertions/*.json ──Playwright──▶ output/issues.json
(page list)  (claude -p)  (committed baseline)  (vs staging)   (drift report)

How it's split

The pipeline splits on determinism, which also keeps the public CI clean:

  • AI extraction (scripts/extract*.sh) — non-deterministic, run locally / on-demand; a human reviews the diff and commits assertions/. No API key in CI.
  • Evaluation (pnpm test) — deterministic given the stored assertion set; this is the part intended to run as a scheduled GitHub Action (modeled on lychee.yml), reading the committed baseline and reporting drift.

Assertion kinds

route (path reachable), element_tab, element_button, element_text (documented label/heading visible on the page named in at).

Notes for review

  • This PR adds the harness only. The assertions/ baseline is generated in a follow-up commit so you can review the extraction output as a separate diff.
  • No secrets are committed — the staging target and any login session are gitignored and provided via env/secrets at run time.
  • Known gaps documented in the README: detail-page fixtures, global nav-group check, session-gated pages, multi-step flows, CI wiring. Deferred deliberately; coverage starts with routes + landing-page elements.

🤖 Generated with Claude Code

Docs-as-tests for the Apify Console: extract UI claims (routes, tabs,
buttons, headings) from platform docs with an LLM, store them as a
reviewed baseline under assertions/, and verify them against Console
staging with Playwright. Failures point back to source_file:line.

- pages.json: adjustable list of docs pages to cover
- scripts/extract*.sh: LLM extraction (run locally, commit the result)
- tests/from-doc.spec.ts: evaluate the stored assertions (CI-friendly)
- reporters/issues-reporter.ts: machine-readable drift report

No secrets committed; auth.json and .env are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added t-docs Issues owned by technical writing team. tested Temporary label used only programatically for some analytics. labels Jun 22, 2026
@marcel-rbro marcel-rbro added the documentation Improvements or additions to documentation. label Jun 22, 2026
@apify-service-account

apify-service-account commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

✅ Preview for this PR (commit 93c4ef7) is ready at https://pr-2669.preview.docs.apify.com (see action run).

marcel-rbro and others added 2 commits June 22, 2026 14:14
- portable read loop in extract-all.sh (macOS bash 3.2 has no mapfile)
- detach claude stdin so it doesn't drain the page list when looped
- slice the <output> block with perl so single-line tag+JSON also parses

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Narrow the manifest to four fixture-free landing pages (console index,
settings, billing, store) and commit the AI-extracted baseline: 53
assertions (21 route, 15 text, 11 tab, 6 button).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
marcel-rbro and others added 2 commits June 22, 2026 17:01
Replace the interactive auth.setup.ts + auth.json storageState handoff with
a worker-scoped fixture that logs in fresh each run from
CONSOLE_STAGING_USER_EMAIL/_PASSWORD (.env locally, GitHub Secrets in CI) and
keeps the session in memory. Nothing is written to or read from disk, so no
auth file has to pre-exist in the GitHub Action. Seeded user has no 2FA, so
it's a plain email+password submit; drop the setup project and pnpm auth.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The worker auth fixture assumed a single combined sign-in form; Apify's
sign-in is two-step (email -> Next -> password -> Log in), both steps on
/sign-in. Pin the real selectors, avoid the SSO buttons, and wait on
domcontentloaded (the Console SPA never reaches networkidle).

Add timestamped step logging to the login fixture so a slow or stuck
login is visible instead of a silent hang before any test reports.

Also adds the pnpm workspace + lockfile so docs-tests installs in
isolation, and documents the staging-user vars in .env.example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. t-docs Issues owned by technical writing team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants