Repository navigation
Release 1.1.5 — Playwright snippet names platform, not os - #4
Merged
Merged
Conversation
…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'`.
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.
The bug
setupTestingBot's Playwright config snippet (src/tools/project.ts:398) emittedos: 'WIN11'into thewss://cloud.testingbot.com/playwrightquery string.The hub never reads
os.Utils.generateCapabilitiesin ws-hub (src/utils.ts:93-96) sets the session platform fromplatformorplatformNameand nothing else:osstill lands indesiredCapabilitiesvia the catch-all loop atsrc/utils.ts:48-50, so it gets forwarded downstream as a stray key — butCapabilities.platformstaysundefinedandtoDesiredCaps()(src/models/capabilities.ts:60) omitsplatformfrom 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:19and the selenium/wdio snippets in the same file already useplatform/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 notos: 'WIN11'. Verified it fails against the old line and passes against the fix. Full suite: 255 passed (19 files); lint, format:check andtscclean.Not changed
The flat query-param form is correct here and is not a limitation:
nameandbuildare read flat by the hub (utils.ts:84,:88).tb:optionsin a query string would actually break — the handler atutils.ts:179doesfor (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>, whichparseQueryParamsJSON-parses and spreads flat.realDevicedoes not exist in ws-hub at all; it's a Selenium-hub concept.Release
Version bumped to 1.1.5;
manifest.jsonandserver.jsonsynced vianpm run version:sync.