fix(webdriver-utils): propagate labels onto comparisonData for POA snapshots#2239
Open
prklm10 wants to merge 6 commits into
Open
fix(webdriver-utils): propagate labels onto comparisonData for POA snapshots#2239prklm10 wants to merge 6 commits into
prklm10 wants to merge 6 commits into
Conversation
…apshots POA snapshots dropped any `labels` set on per-screenshot options because WebdriverUtils.captureScreenshot only forwarded `sync`, `testCase`, and `thTestCaseExecutionId` from options onto the returned comparisonData. Labels never reached percy.upload → sendComparison → createSnapshot (which converts labels to `tags` for the API), so POA tags were always empty regardless of SDK input. Adds the missing forward and tests at three layers: - webdriver-utils: new unit specs for captureScreenshot covering label propagation, missing labels, playwright provider, and error rethrow. - client: sendComparison spec asserting labels become `tags` on the snapshot POST body. - core: /percy/automateScreenshot spec asserting labels survive the API handler and reach percy.upload. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…n test Drop the full-stack /automateScreenshot labels propagation spec. The labels behavior is already covered by the focused unit specs in webdriver-utils (captureScreenshot) and client (sendComparison). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…egression test" This reverts commit 923a52c.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ptureScreenshot Branch coverage for captureScreenshot dropped to 66.67% (lines 17-18) because every existing spec passes both `options` and `buildInfo`, leaving the default-parameter branches untaken. Adds a spec that calls captureScreenshot with both omitted to exercise the defaults. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
rishigupta1599
approved these changes
May 25, 2026
…agation # Conflicts: # packages/core/test/api.test.js
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
labels—WebdriverUtils.captureScreenshotforwardedsync,testCase, andthTestCaseExecutionIdfromoptionsonto the returnedcomparisonDatabut notlabels, so labels never reachedpercy.upload→sendComparison→createSnapshot(which converts labels totagson the snapshot POST). The result: POAtagswere always empty regardless of SDK input.packages/webdriver-utils/src/index.js:42.Root cause
packages/webdriver-utils/src/index.jsTests
packages/webdriver-utils/test/index.test.js(new) — 5 specs forWebdriverUtils.captureScreenshot:packages/client/test/client.test.js—sendComparisonspec assertslabels: 'qa, smoke,release'becomestags: [{id: null, name: 'qa'}, ...]on the snapshot POST body.packages/core/test/api.test.js—/percy/automateScreenshotspec asserts labels survivepercyAutomateRequestHandlerand reachpercy.upload.Test plan
cd packages/webdriver-utils && yarn test— 231/231 pass (incl. 5 new specs)cd packages/client && yarn test— new sendComparison labels spec passes (one pre-existing unrelated PAC-proxy test fails on Node URL message format)cd packages/core && yarn test— full suite has pre-existing Chromium install failures unrelated to this change; new API spec was added following the existing/automateScreenshottest patternslabelsset and confirmtagsare populated on the resulting snapshot in the Percy dashboard🤖 Generated with Claude Code