fix: declare browser.setCustomTags on WebdriverIO.Browser type (SDK-6882)#53
Open
Bhargavi-BS wants to merge 2 commits into
Open
fix: declare browser.setCustomTags on WebdriverIO.Browser type (SDK-6882)#53Bhargavi-BS wants to merge 2 commits into
Bhargavi-BS wants to merge 2 commits into
Conversation
…882) Port of harshit-browserstack/webdriverio#5 to the standalone repo. The command works at runtime but TypeScript consumers hit TS2339 because the declaration lives only in src/@types/bstack-service-types.d.ts, which is never emitted into the shipped build/index.d.ts. Adding it to the declare global block in src/index.ts ships the augmentation to consumers. No runtime change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
xxshubhamxx
previously approved these changes
Jul 16, 2026
Collaborator
|
rest lgtm |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dandonarahul2002
approved these changes
Jul 16, 2026
xxshubhamxx
approved these changes
Jul 16, 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.
Port of harshit-browserstack/webdriverio#5 to the standalone repo.
What
Declares
browser.setCustomTags(key, value)on the globalWebdriverIO.Browserinterface so TypeScript consumers of@wdio/browserstack-servicecan call it without a compile error.Why
Jira SDK-6882: a WebdriverIO + Mocha (TypeScript) customer on
@wdio/browserstack-service@9.29.1hit:The command works at runtime (the service attaches it, and the customer's test calling it passed) — the failure is compile-time only. The
setCustomTags/a11y declarations live insrc/@types/bstack-service-types.d.tsbut that file usesdeclare namespaceand is pulled in only via/// <reference path>from internal source, so it is never emitted into the shippedbuild/index.d.ts(the packagetypesentry). Consumers therefore receive nosetCustomTagsonWebdriverIO.Browser.Fix
Add
setCustomTagsto theWebdriverIO.Browseraugmentation in thedeclare globalblock ofsrc/index.ts, which is emitted tobuild/index.d.tsand delivered to consumers:Merges cleanly with the existing ambient declaration (identical signature). Runtime behavior unchanged.
Port notes (drift vs the fork PR)
The fork PR was authored against
webdriverio/webdriverio@main, where thedeclare globalblock has nointerface Browser, so it added a new one. This repo'smainalready ships aninterface Browseraugmentation insrc/index.ts(the a11y methods —getAccessibilityResultsSummary,getAccessibilityResults,performScan,startA11yScanning,stopA11yScanning), so thesetCustomTagsmember is added to that existing block instead of declaring a second one. This also means the fork PR's noted follow-up ("the a11y methods share the same non-shipping cause") is already addressed in this repo for those methods.Verification
npx tsc --noEmit -p packages/browserstack-serviceexits 0 (afternpm run generate) — no duplicate-identifier conflict with the ambientbstack-service-types.d.tsdeclaration.packages/browserstack-service: 1004 passed / 0 failed (identical to basemain— type-only change).TS2339against the pristine published 9.29.1 tgz and compiled clean against the patched build.🤖 Generated with Claude Code