Skip to content

fix(CDPBrowser): report connection errors on failed steps, skip screenshots without rendering - #5747

Merged
DavertMik merged 2 commits into
4.xfrom
fix/cdp-connect-error-and-screenshots
Oct 11, 2026
Merged

DavertMik merged 2 commits into
4.xfrom
fix/cdp-connect-error-and-screenshots

Conversation

@DavertMik

Copy link
Copy Markdown
Contributor

Summary

  • Real connection error in failure summary. Core only logs errors thrown by a helper's _before, so when Lightpanda could not be started or reached, every test failed on its first step with Cannot read properties of null (reading 'send'). _before now keeps the connection error and _beforeStep rethrows it, so each failure shows the real cause (e.g. "Lightpanda has no endpoint configured, no binary could be resolved…"). A fresh Error is thrown per step so each failure is attributed to its own test file.
  • Screenshots don't fail tests on Lightpanda. saveScreenshot and saveElementScreenshot print 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:

  • no Lightpanda binary or server: all failures report the not-installed error, each with its own file
  • Lightpanda running: a test calling I.saveScreenshot() and I.saveElementScreenshot() passes, --debug shows saveScreenshot skipped: this browser has no rendering engine

Known follow-up

When a test fails, the screenshot plugin still records test.artifacts.screenshot after saveScreenshot resolves, so on Lightpanda it points to a file that was never written.

🤖 Generated with Claude Code

DavertMik and others added 2 commits October 11, 2026 22:50
…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>
@DavertMik
DavertMik merged commit 252ab25 into 4.x Oct 11, 2026
15 checks passed
@DavertMik
DavertMik deleted the fix/cdp-connect-error-and-screenshots branch October 11, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant