Headless: per-test testRoot HTML + screenshot snapshots on failure (#8) #21

Open
orchestrator wants to merge 2 commits from wip/issue-08 into integration/wave2
Member

Per #8 (lead decision: headless only, no in-browser snapshot).

  • On failure, for each failing test that rendered into testRoot, write testRoot.outerHTML + a screenshot of its sandbox iframe to the artifacts dir (timestamped per-test filenames), and log the paths. Empty testRoot is skipped.
  • Uses the data-* hooks (data-test-status/data-test-name/data-file-src, plus new data-test-file-src/data-test-active on iframes).
  • All paths guarded so snapshotting can never turn a failure into a crash; keeps the existing full-page artifacts.

Verification

  • Build; sadpath failure writes full-page artifacts and logs the empty-testRoot skip; a testRoot-rendering fixture produces the .html + .png; smoke additions.

Closes #8

Base: integration/wave2 is the integration point this branch was based on, so this PR's diff shows only this issue's changes.

Per #8 (lead decision: **headless only**, no in-browser snapshot). - On failure, for each failing test that rendered into `testRoot`, write `testRoot.outerHTML` + a screenshot of its sandbox iframe to the artifacts dir (timestamped per-test filenames), and log the paths. Empty `testRoot` is skipped. - Uses the `data-*` hooks (`data-test-status`/`data-test-name`/`data-file-src`, plus new `data-test-file-src`/`data-test-active` on iframes). - All paths guarded so snapshotting can never turn a failure into a crash; keeps the existing full-page artifacts. ## Verification - Build; `sadpath` failure writes full-page artifacts and logs the empty-`testRoot` skip; a `testRoot`-rendering fixture produces the `.html` + `.png`; smoke additions. Closes #8 > **Base:** `integration/wave2` is the integration point this branch was based on, so this PR's diff shows **only this issue's changes**.
On failure, for every failing test whose sandbox #test-root has content,
write testRoot.outerHTML plus a screenshot of the owning sandbox iframe to
the artifacts dir, named <sanitized-file>.<sanitized-test>.{html,png}, and
log the paths. Skips tests with an empty testRoot; keeps the existing
full-page screenshot/DOM snapshot. Best-effort and guarded so snapshotting
can never turn a failure into a crash.

Add a smoke fixture that renders into testRoot and fails, asserting the
per-test .html + .png artifacts are written.
P1: add data-test-file-src / data-test-active structural hooks to the
sandbox iframes and locate them by data-* (drop class-based .active and
src-hash matching); classes stay styling-only.

P2:
- wrap the entire snapshot/screenshot path (incl. locator construction) in
  try/catch so it can never propagate.
- restore the inline display/width/height forced onto inactive iframes
  after the screenshot.
- include the run timestamp in per-test artifact filenames, matching the
  full-page convention, so re-runs never clobber.
- document the shared-sandbox caveat (multiple failures in one file retain
  only the last testRoot; unreachable with default stop-on-failure).
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin wip/issue-08:wip/issue-08
git switch wip/issue-08

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch integration/wave2
git merge --no-ff wip/issue-08
git switch wip/issue-08
git rebase integration/wave2
git switch integration/wave2
git merge --ff-only wip/issue-08
git switch wip/issue-08
git rebase integration/wave2
git switch integration/wave2
git merge --no-ff wip/issue-08
git switch integration/wave2
git merge --squash wip/issue-08
git switch integration/wave2
git merge --ff-only wip/issue-08
git switch integration/wave2
git merge wip/issue-08
git push origin integration/wave2
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
legend/gooey-test!21
No description provided.