Repository navigation
fix(CDPBrowser): report connection errors on failed steps, skip screenshots without rendering - #5747
Merged
Merged
Conversation
…nshots without rendering Helper _before errors are only logged by core, so when the browser could not be started or reached the first step failed with "Cannot read properties of null (reading 'send')". The connection error is now kept and rethrown before each step, so the failure summary shows the real cause. saveScreenshot and saveElementScreenshot no longer throw on browsers without a rendering engine (Lightpanda); they print a debug message and return. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g engine Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
_before, so when Lightpanda could not be started or reached, every test failed on its first step withCannot read properties of null (reading 'send')._beforenow keeps the connection error and_beforeSteprethrows it, so each failure shows the real cause (e.g. "Lightpanda has no endpoint configured, no binary could be resolved…"). A freshErroris thrown per step so each failure is attributed to its own test file.saveScreenshotandsaveElementScreenshotprint a debug message and return when the browser has no rendering engine, instead of throwing. Lightpanda docs updated.Verification
Ran
examples/codecept.Lightpanda.config.js:I.saveScreenshot()andI.saveElementScreenshot()passes,--debugshowssaveScreenshot skipped: this browser has no rendering engineKnown follow-up
When a test fails, the
screenshotplugin still recordstest.artifacts.screenshotaftersaveScreenshotresolves, so on Lightpanda it points to a file that was never written.🤖 Generated with Claude Code