Skip to content

fix(util): recognize *.bsstag.com hosts as BrowserStack (internal staging)#56

Open
AakashHotchandani wants to merge 1 commit into
mainfrom
sdk-6948-wdio-bsstag-host-recognition
Open

fix(util): recognize *.bsstag.com hosts as BrowserStack (internal staging)#56
AakashHotchandani wants to merge 1 commit into
mainfrom
sdk-6948-wdio-bsstag-host-recognition

Conversation

@AakashHotchandani

Copy link
Copy Markdown
Collaborator

What

getCloudProvider() and isBrowserstackInfra() in util.ts only recognize *.browserstack.com hosts. When a run targets an internal staging hub — e.g. hub-<env>.bsstag.com, which the SDK produces via the BROWSERSTACK_STAGING_ENV config-server override — those checks return unknown_grid / false, so the service treats the session as a non-BrowserStack grid. That disables:

  • the accessibility scan (isBrowserstackSession() → false)
  • session status / naming
  • app-automate session handling

Change

Recognize .bsstag.com in both host checks (2 sites in getCloudProvider, 1 in isBrowserstackInfra). This is the wdio-service analog of browserstack-javaagent PR #2010's isBrowserstackHubUrl fix (which added .bsstag.com to the hub regex).

// getCloudProvider
hostname.includes('browserstack')  ->  (hostname.includes('browserstack') || hostname.includes('bsstag'))
// isBrowserstackInfra
str.endsWith('.browserstack.com')  ->  str.endsWith('.browserstack.com') || str.endsWith('.bsstag.com')

.bsstag.com is BrowserStack's own staging domain, so this only broadens recognition to internal staging hosts; prod behavior is unchanged.

Validation

Full green wdio App-Automate run against a staging env (rengg-stag-app-a11y): 2 tests passed, the App A11y hook-scan executed (accessibilityScanStarted: true), and a11y results were polled from the staging app-accessibility-<env>.bsstag.com host. Related: browserstack-binary PR #1550 (the SDK-side BROWSERSTACK_STAGING_ENV override).

🤖 Generated with Claude Code

…ging)

getCloudProvider() and isBrowserstackInfra() only matched *.browserstack.com, so a
session run against an internal staging hub (e.g. hub-<env>.bsstag.com, used by the
SDK's BROWSERSTACK_STAGING_ENV config-server override) was treated as a
non-BrowserStack grid — which disables the accessibility scan, session status/naming,
and app-automate handling.

Recognize .bsstag.com hosts too, in both host checks. Mirrors browserstack-javaagent
PR #2010's isBrowserstackHubUrl fix.

Validated: full green wdio App-Automate run against a staging env with the App A11y
hook-scan executing and results polled from the staging app-accessibility host.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AakashHotchandani
AakashHotchandani requested a review from a team as a code owner July 17, 2026 06:06
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