The `browserstack-node-sdk` is a Node.js library designed to facilitate running Selenium WebDriver tests on the BrowserStack cloud platform using popular JavaScript test runners like Jest, Mocha, and Cucumber. Currently at version 1.52.0, it primarily offers a command-line interface (CLI) to configure and execute tests against various browser and OS combinations defined in a `browserstack.yml` configuration file. While the SDK supports programmatic integration, its common usage pattern involves an `npx setup` command to initialize project configuration and wrapper CLI commands (e.g., `browserstack-node-sdk jest`) to orchestrate test execution on BrowserStack. Release cadence is frequent, indicated by minor version increments, focusing on compatibility and new platform support rather than major breaking changes. Its key differentiator is simplifying the integration of existing Node.js test suites with BrowserStack's extensive device farm through a streamlined setup and execution workflow, abstracting away much of the boilerplate associated with configuring remote Selenium grids.
npm install browserstack-node-sdkVerified import paths — ran on the pinned version, not inferred.
Demonstrates installation, initial setup with environment variables, and execution of tests on BrowserStack via the generated CLI commands.
Set `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables, or verify them in `browserstack.yml`. Run `npx setup` again if the `browserstack.yml` is missing or corrupted.
Ensure outbound access to `*.browserstack.com` is allowed. Validate proxy settings and try running tests on an alternative network to rule out local environment issues.
Ensure the `.browserstack` folder exists and has read/write permissions. On Linux/macOS, use `chmod -R 755 ~/.browserstack`.
Check for recent updates to your test framework. If issues persist, revert to a known-working version or compare your project's dependencies against BrowserStack's sample projects.
Refer to the official BrowserStack documentation and sample `browserstack.yml` files (e.g., in `jest-js-browserstack` repo) to ensure correct formatting and required fields. Use the SDK Config Generator if available.
Set `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` as environment variables or update the `browserstack.yml` file.
Run `npx setup --username <your_username> --key <your_access_key>` to generate the `browserstack.yml` file. Ensure it's in the project root.
Install the required test runner as a dev dependency (e.g., `npm i -D jest`) and ensure it's runnable from your project's scripts.
Check proxy settings, firewall rules, and ensure `browserstack-local` is correctly configured and can establish a connection. Consult BrowserStackLocal documentation for advanced troubleshooting.
No dependency data recorded yet.