Repository navigation
Show a failure screenshot under the error, on request - #58
Merged
Merged
Conversation
JourneySnapshotOptions gains ScreenshotOnFailure, and the console runner and snap journey run take --screenshot-on-failure. The image is written to failure.png in the journey's artifacts folder and drawn under the error with Nullean.TerminalImages on a terminal that can show images. A failure names the page it stopped on, from Nullean.Cdp 0.10.0. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
--screenshot-on-failuretakes a screenshot when a journey step fails, writes it tofailure.png, and draws it under the error on a terminal that can show images.Why
A failing journey says which step broke and what the error was, but not what the page looked like. nullean/cdp#44 (released as 0.10.0) records the page's URL and, on request, a PNG of the viewport. The console runner from nullean/snapshots#56 did not use either.
What
The option and the flag
JourneySnapshotOptions.ScreenshotOnFailureandJourneyRunOptions.ScreenshotOnFailureturn the capture on, andsnap journey runtakes--screenshot-on-failure. It is off unless asked for, because a page can show private data. A journey that fails writesfailure.pnginto its artifacts folder (the one next to its received transcript forsnap), and the failure message names the file.The image under the error
On a terminal, the reporter draws the screenshot after the error and before the page, screenshot and rerun rows, with Nullean.TerminalImages (Kitty, Ghostty, iTerm2, WezTerm, Sixel, half blocks otherwise), at most 100 columns and 30 rows. In CI, in a pipe, with
NULLEAN_TERMINAL_IMAGES=none, or when the terminal cannot show images, it draws nothing, and a failure to draw never fails a run.The page a step stopped on
A failure now shows
Page:with the address the step stopped on, from Nullean.Cdp 0.10.0. It replaces theLast open:line when the failure has one. The runner also saysEvery selected journey was skipped, so nothing was checked.itself, so a wrapper tool does not have to.Verify
NULLEAN_TERMINAL_IMAGES=blocksforces half blocks, which also draw in a pty. Dropping the option from the run options failsTheScreenshotOptionReachesTheJourneyRun. The two verified snapshots of failing runs change by one line each (Last open:becomesPage:).🤖 Generated with Claude Code