Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/sdk-6948-v8-bsstag-host-recognition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@wdio/browserstack-service": patch
---

fix(util): recognize `*.bsstag.com` hosts as BrowserStack (internal staging, SDK-6948)

`getCloudProvider` and `isBrowserstackInfra` only matched `browserstack.com`, so a session pointed at an internal staging env (`*.bsstag.com`) was classified as non-BrowserStack — the service then skipped its instrumentation and GRR host rewriting, and the WebDriver hub stayed on production. Recognize `bsstag` / `.bsstag.com` in both guards. Ports the main/v9 fix (#56/#65) to the v8 line.
6 changes: 3 additions & 3 deletions packages/browserstack-service/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,11 +1034,11 @@ export function getCloudProvider(browser: WebdriverIO.Browser | WebdriverIO.Mult
// Loop through all instances
for (const instanceName of browser.instances) {
const instance = (browser as any)[instanceName] as WebdriverIO.Browser
if (instance.options && instance.options.hostname && instance.options.hostname.includes('browserstack')) {
if (instance.options && instance.options.hostname && (instance.options.hostname.includes('browserstack') || instance.options.hostname.includes('bsstag'))) {
return 'browserstack'
}
}
} else if (browser.options && browser.options.hostname && browser.options.hostname.includes('browserstack')) { // Single browser instance
} else if (browser.options && browser.options.hostname && (browser.options.hostname.includes('browserstack') || browser.options.hostname.includes('bsstag'))) { // Single browser instance
return 'browserstack'
}
return 'unknown_grid'
Expand Down Expand Up @@ -1168,7 +1168,7 @@ export function isBrowserstackInfra(config: BrowserstackConfig & Options.Testrun
// a utility function to check if the hostname is browserstack

const isBrowserstack = (str: string ): boolean => {
return str.includes('browserstack.com')
return str.includes('browserstack.com') || str.includes('bsstag.com')
}

if ((config.hostname) && !isBrowserstack(config.hostname)) {
Expand Down
Loading