You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 88d9a0a
Browse filesBrowse the repository at this point in the historyBrowse files
Attach a screenshot to every non-Pass check result
Feature 1 of 4 requested large improvements. A report reader
investigating a Fail/Warn previously had to re-run formwatch against
the form (possibly already fixed, or a different failure by then) just
to see what the page actually looked like. Every check that comes back
non-Pass — a real Fail/Warn, or a synthetic one from a timeout/error —
now carries a full-page PNG screenshot, embedded as a
data:image/png;base64 URI directly in --html/--json output.
Design: added the `base64` crate (std has no encoder; hand-rolling one
correctly is exactly the kind of standard-wheel ponytail says not to
reinvent) and a `capture_screenshot` helper in checks.rs. Split
run_safely's error/timeout-conversion logic into a new pure
`run_with_timeout` so the existing browser-free unit tests
(run_with_timeout_converts_an_error_into_a_warn_result_instead_of_propagating
etc.) keep testing that logic without needing a real Page just because
run_safely itself now does — run_safely is a thin wrapper that also
attaches a screenshot to any non-Pass result. run_custom_checks gets
the same treatment for consistency.
CheckResult gained `screenshot: Option<String>`, `#[serde(default)]` so
existing history files without the field still deserialize. Verified
the "non-Pass only" condition is real by inverting it (`== Pass`
instead of `!= Pass`) and watching the new end-to-end test catch it
both ways — a real Fail with no screenshot, and (implicitly) a Pass
that would carry one.
Wired into templates/report.html (an <img> per non-Pass check) and a
short "(screenshot captured — see --html/--json report)" note in the
plain-text/colored output, since a terminal can't render an image
inline.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments