emit screenshot-on-failure in v8#7
Open
Bhargavi-BS wants to merge 2 commits into
Open
Conversation
…binary flow (SDK-6277)
In the v8 CLI/binary flow (BrowserstackCLI.isRunning()===true) the browser
command/result listeners that capture a screenshot WebDriver command result
were registered only in the !isRunning() branch, so a user's saveScreenshot()/
takeScreenshot() on failure was captured on the device but never forwarded to
Test Observability (no TEST_SCREENSHOT event). v7 has no binary, so the
listeners register and screenshots upload — hence works v7, broken v8.
Fix:
- service.ts: register the command/result listeners in the CLI branch too.
- insights-handler.ts: in CLI mode forward the screenshot to the binary over
gRPC as a TEST_SCREENSHOT log via trackEvent(LOG) (the worker's direct-HTTP
upload is not authorized in the v8 central-auth flow); skip the direct
per-command HTTP log in CLI mode.
- wdioMochaTestFramework.ts: honor the incoming logEntry.kind (default TEST_LOG)
so the screenshot keeps kind TEST_SCREENSHOT.
Verified end-to-end against a v8 repro: cloud accepted the screenshot upload
(server={"success":true}).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xxshubhamxx
approved these changes
Jun 10, 2026
xxshubhamxx
left a comment
There was a problem hiding this comment.
Please run a quick sanity test on TRA and confirm that screenshots are being uploaded and received correctly from our side.
amaanbs
approved these changes
Jun 11, 2026
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.
…binary flow (SDK-6277)
In the v8 CLI/binary flow (BrowserstackCLI.isRunning()===true) the browser command/result listeners that capture a screenshot WebDriver command result were registered only in the !isRunning() branch, so a user's saveScreenshot()/ takeScreenshot() on failure was captured on the device but never forwarded to Test Observability (no TEST_SCREENSHOT event). v7 has no binary, so the listeners register and screenshots upload — hence works v7, broken v8.
Fix:
Verified end-to-end against a v8 repro: cloud accepted the screenshot upload (server={"success":true}).
Proposed changes
Types of changes
Checklist
Backport Request
v9and doesn't need to be back-ported#XXXXXFurther comments
Reviewers: @webdriverio/project-committers