browserstack-node-sdk

1.33.1 • Public • Published

browserstack-node-sdk

Node SDK for browserstack selenium-webdriver tests

Running Jest, Mocha and Cucumber tests in multiple platforms using SDK

Add browserstack-node-sdk as a dev-dependency,

npm i -D browserstack-node-sdk
#or
yarn add --dev browserstack-node-sdk

Setup

npx setup --username userName --key accessKey
  • Adds a browserstack.yml file at root of your project with your auth keys BrowserStack Username and Access Key, browserstack configs and platforms. See sample config file here
  • Adds a new command for running tests on browserstack in scripts tag of package.json,
# before

"scripts": {
    # Jest tests
    "jest-test": "jest ...args",

    # Mocha tests
    "mocha-test": "mocha ...args",

    # Cucumber tests
    "cucumber-test": "cucumber-js ...args",

  },

# after

"scripts": {
    # Jest tests
    "jest-test": "jest ...args",
    "browserstack-jest-test": "browserstack-node-sdk jest ...args",

    # Mocha tests
    "mocha-test": "mocha ...args",
    "browserstack-mocha-test": "browserstack-node-sdk mocha ...args",

    # Cucumber tests
    "cucumber-test": "cucumber-js ...args",
    "browserstack-cucumber-test": "browserstack-node-sdk cucumber-js ...args"
  },

Run tests on browserstack by running

npm run browserstack-jest-test
# or
npm run browserstack-mocha-test
# or
npm run browserstack-cucumber-test

Sample test scripts are available in the jest-js-browserstack, mocha-browserstack & cucumber-js-browserstack repositories.

/browserstack-node-sdk/

    Package Sidebar

    Install

    npm i browserstack-node-sdk

    Weekly Downloads

    27,973

    Version

    1.33.1

    License

    SEE LICENSE IN LICENSE.md

    Unpacked Size

    1.96 MB

    Total Files

    173

    Last publish

    Collaborators

    • browserstack