Add Jest + Playwright BrowserStack SDK sample#2
Open
saraswati-padmawar wants to merge 4 commits into
Open
Conversation
Sample test (bstackdemo add-to-cart) + local test (BrowserStack Local via bs-local.com:45454), browserstack.yml, package.json with browserstack-node-sdk run scripts, and README. Follows the standardized Automate sample template. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Node SDK's jest flow gates Playwright support on resolving @playwright/test
from node_modules (src/bin/jest/command.js: getPackageVersion('@playwright/test')).
With only 'playwright' installed, detection never fired, the SDK skipped its
BrowserType.launch patch, and chromium.launch() ran locally instead of routing to
BrowserStack. Switch the dependency and imports to @playwright/test.
Verified: chromium.launch() now routes to wss://cdp.browserstack.com/playwright.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirrors browserstack/node-js-playwright-browserstack. Runs the public bstackdemo sample test + BrowserStack Local test against a python http.server harness, using org BROWSERSTACK_USERNAME/ACCESS_KEY secrets. Strips yml credential placeholders so the secrets take effect. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Populates this customer-facing sample repo (previously skeleton: README + CODEOWNERS + Semgrep only) with a working Jest + Playwright sample driven by the BrowserStack Node SDK.
What's included
tests/bstack_sample.test.js— public bstackdemo.com add-to-cart scenariotests/bstack_local_test.test.js— BrowserStack Local scenario (bs-local.com:45454)browserstack.yml— credentials, 3 platforms (Win/Chrome, macOS/WebKit, Win/Firefox), Local toggle,framework: playwright,testReporting: truepackage.json—sample-test/sample-local-testscripts viabrowserstack-node-sdk jestjest.config.js/jest.local.config.js,.gitignore, READMEReferences
framework-matrix.md(browserstack-node-sdk jest)framework: playwrightmirrors the existingcodecept-js-playwright-browserstackprecedentnode-js-playwright-browserstackVerified on BrowserStack
Ran end-to-end against BrowserStack Automate (Node 20):
npm run sample-testf16ab3c9d13416a67e75e01079107bc92c3fd255bs-local.com:45454)npm run sample-local-testProject: BrowserStack Samples.
🤖 Generated with Claude Code