Repository navigation
Record the page and a screenshot when a journey fails - #44
Merged
Merged
Conversation
…cdp run output A failing journey now carries the page's URL and a PNG of the viewport, written to failure.png in the artifacts folder when there is one. JourneyFailure.Describe adds them as Page and Screenshot lines, so a test host and the CLI show the same thing. ScreenshotOnFailure turns the capture off. The CLI still fences everything from the page. An unmet feature block is one line with its reason, and a refused request that repeats is listed once with its count. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A screenshot can show private data on a page, so it is taken only with ScreenshotOnFailure or --screenshot-on-failure. The failure still records the page's URL. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The CLI prints no image, so a capture with nowhere to go was taken and thrown away. 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.
A failing journey now carries the URL of the page it stopped on and a PNG of the viewport, and
cdp runprints less noise for the same run.Why
JourneyFailureheld a line, a command and a message. A host running journeys against a live site (docs-builder'sdocs-journeys, and the TUnit tests throughNullean.Snapshots) could say which step broke and nothing about what the page looked like.cdp runalso fenced every unmetfeatureblock and printed a refused request once per occurrence.What
A failure records the page
JourneyFailuregainsUrl,ScreenshotandScreenshotPath. The runner takes the capture before it disposes the context, with a 5 second limit, and a page that is gone leaves them out. With an artifacts folder the PNG is written tofailure.png.JourneyOptions.ScreenshotOnFailure(defaulttrue) turns it off.DescribeaddsPage:andScreenshot:lines, so the TUnit message and the CLI say the same.cdp runprints lessAn unmet
featureblock is one line with its reason and no fence, marked by the newCheckpoint.IsSkipso page text cannot imitate it. A repeated refused request is listed once with(xN). A failure putsurl:inside the fence with the message, and prints-- screenshot: <path>outside it, since the host chose the path. The fence stays on for every output: a terminal is no proof that a person is reading.Existing tests
Three tests compared a whole
JourneyFailurewithShould().Be. They now compare line, command and message, because the record also holds the page.Verify
dotnet test -c ReleaseBreaking the capture (
Screenshot = null) fails two runner tests, and removing theIsSkipbranch fails the CLI skip test.Out of scope: no release. docs-builder picks this up once a version is tagged.
🤖 Generated with Claude Code