Skip to content

feat: Playwright browser audit with HTML fallback - #5

Open
KhyFee wants to merge 1 commit into
andrewcb22:mainfrom
KhyFee:feat/playwright-browser-audit
Open

feat: Playwright browser audit with HTML fallback#5
KhyFee wants to merge 1 commit into
andrewcb22:mainfrom
KhyFee:feat/playwright-browser-audit

Conversation

@KhyFee

Copy link
Copy Markdown

Summary

Adds an optional Playwright browser audit layer that captures desktop/mobile screenshots and console errors, while keeping the fast HTML scanner as the default/fallback.

Changes

  • lib/audit/runBrowserAudit.ts — Chromium capture + screenshots + console errors
  • runAudit(url, { browser: true }) prefers Playwright; falls back to HTML fetch when browsers are missing
  • Extend AuditResult with optional browser payload
  • API accepts { "url", "browser": true }
  • Document in CONTRIBUTING.md / README
  • Add playwright as a devDependency

Why

Closes#1

Test plan

  • npm run build succeeds
  • POST /api/audit without browser still returns HTML-path results (browser.mode: html-fallback)
  • With npx playwright install chromium + { "browser": true }, response includes screenshots + consoleErrors (or falls back cleanly if install missing)

Sign up for freeto 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.

Add Playwright browser audit with screenshots

1 participant

@KhyFee