Skip to content

Release 1.1.5 — Playwright snippet names platform, not os - #4

Merged
jochen-testingbot merged 1 commit into
mainfrom
fix/playwright-platform-capability
Sep 22, 2026
Merged

jochen-testingbot merged 1 commit into
mainfrom
fix/playwright-platform-capability

Conversation

@jochen-testingbot

Copy link
Copy Markdown
Contributor

The bug

setupTestingBot's Playwright config snippet (src/tools/project.ts:398) emitted os: 'WIN11' into the wss://cloud.testingbot.com/playwright query string.

The hub never reads os. Utils.generateCapabilities in ws-hub (src/utils.ts:93-96) sets the session platform from platform or platformName and nothing else:

if (params.platform) {
    capabilities.platform = params.platform.toString()
} else if (params.platformName) {
    capabilities.platform = params.platformName.toString()
}

os still lands in desiredCapabilities via the catch-all loop at src/utils.ts:48-50, so it gets forwarded downstream as a stray key — but Capabilities.platform stays undefined and toDesiredCaps() (src/models/capabilities.ts:60) omits platform from the payload. Result: anyone pasting the snippet silently ran on the default platform instead of Windows 11, with no error to hint at it.

src/tools/cdp.ts:19 and the selenium/wdio snippets in the same file already use platform/platformName. The Playwright snippet was the only outlier.

The fix

One line: os: 'WIN11' → platform: 'WIN11'.

Test

Added a regression test asserting the snippet contains platform: 'WIN11' and not os: 'WIN11'. Verified it fails against the old line and passes against the fix. Full suite: 255 passed (19 files); lint, format:check and tsc clean.

Not changed

The flat query-param form is correct here and is not a limitation:

  • name and build are read flat by the hub (utils.ts:84, :88).
  • Putting tb:options in a query string would actually break — the handler at utils.ts:179 does for (const option in tbOptions), and a query param arrives as a string, so it would iterate character indices. The richer form over WS is ?capabilities=<urlencoded JSON>, which parseQueryParams JSON-parses and spreads flat.
  • realDevice does not exist in ws-hub at all; it's a Selenium-hub concept.

Release

Version bumped to 1.1.5; manifest.json and server.json synced via npm run version:sync.

…t os

The Playwright config snippet emitted `os: 'WIN11'` into the wss://cloud.testingbot.com/playwright
query string. The hub only maps `platform` or `platformName` onto the session platform
(ws-hub src/utils.ts, Utils.generateCapabilities); `os` falls into the catch-all loop that
copies every param into desiredCapabilities, so Capabilities.platform stays undefined and
toDesiredCaps() omits platform entirely. Anyone pasting the snippet got the default OS with
no error rather than Windows 11.

cdp.ts and the selenium/wdio snippets already use platform/platformName — the Playwright one
was the outlier. Regression test asserts the snippet contains `platform: 'WIN11'` and no
`os: 'WIN11'`.
@jochen-testingbot
jochen-testingbot merged commit 9927faa into main Sep 22, 2026
5 checks passed
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