npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wdio/browserstack-service

v9.21.0

Published

WebdriverIO service for better Browserstack integration

Readme

WebdriverIO BrowserStack Service

A WebdriverIO service that manages local tunnel and job metadata for BrowserStack users.

Installation

The easiest way is to keep @wdio/browserstack-service as a devDependency in your package.json, via:

npm install @wdio/browserstack-service --save-dev

Instructions on how to install WebdriverIO can be found here.

Configuration

WebdriverIO has BrowserStack support out of the box. You should set user and key in your wdio.conf.js file. This service plugin provides support for BrowserStack Tunnel. Set browserstackLocal: true also to activate this feature. Reporting of session status on BrowserStack will respect strict setting of Cucumber options.

// wdio.conf.js
export const config = {
    // ...
    user: process.env.BROWSERSTACK_USERNAME,
    key: process.env.BROWSERSTACK_ACCESS_KEY,
    services: [
        ['browserstack', {
            testReporting: true,
            testReportingOptions: {
                projectName: "Your project name goes here",
                buildName: "The static build job name goes here e.g. Nightly regression"
            },
            browserstackLocal: true
        }]
    ],
    // ...
};

Options

In order to authorize to the BrowserStack service your config needs to contain a user and key option.

testReporting

Test Observability is an advanced test reporting tool that gives insights to improve your automation tests and helps you debug faster. It’s enabled by default by setting the testObservability​ flag as true for all users of browserstack-service. You can disable this by setting the testObservability​ flag to false.

Once your tests finish running, you can visit Test Reporting and Analytics to debug your builds with additional insights like Unique Error Analysis, Automatic Flaky Test Detection, and more.

You can use Test Observability even if you don’t run your tests on the BrowserStack infrastructure. Even if you run your tests on a CI, a local machine, or even on other cloud service providers, Test Observability can still generate intelligent test reports and advanced analytics on your tests.

If you want to use Test Reporting and Analytics without running your tests on BrowserStack infrastructure, you can set your config as follows:

// wdio.conf.js
export const config = {
    // ...
    services: [
        ['browserstack', {
            testReporting: true,
            testReportingOptions: {
                user: process.env.BROWSERSTACK_USERNAME,
                key: process.env.BROWSERSTACK_ACCESS_KEY,
                projectName: "Your project name goes here",
                buildName: "The static build job name goes here e.g. Nightly regression"
            }
        }]
    ],
    // ...
};

You can explore all the features of Test Reporting and Analytics in this sandbox or read more about it here.

browserstackLocal

Set this to true to enable routing connections from BrowserStack cloud through your computer.

Type: Boolean Default: false

forcedStop

Set this to true to kill the BrowserStack Local process on complete, without waiting for the BrowserStack Local stop callback to be called. This is experimental and should not be used by all. Mostly necessary as a workaround for this issue.

Type: Boolean Default: false

app

Appium set this with the app file path available locally on your machine to use the app as application under test for Appium sessions.

Type: String or JsonObject Default: undefined

List of available app values:

path

Use locally available app file path as an application under test for Appium.

services: [
  ['browserstack', {
    app: '/path/to/local/app.apk'
    // OR
    app: {
      path: '/path/to/local/app.apk'
    }
  }]
]

Pass custom_id while the app upload.

services: [
  ['browserstack', {
    app: {
      path: '/path/to/local/app.apk',
      custom_id: 'custom_id'
    }
  }]
]

id

Use the app URL returned after uploading the app to BrowserStack.

services: [
  ['browserstack', {
    app: 'bs://<app-id>'
    // OR
    app: {
      id: 'bs://<app-id>'
    }
  }]
]

custom_id

use custom_id of already uploaded apps

services: [
  ['browserstack', {
    app: 'custom_id'
    // OR
    app: {
      custom_id: 'custom_id'
    }
  }]
]

shareable_id

use shareable_id of already uploaded apps

services: [
  ['browserstack', {
    app: 'username/custom_id'
    // OR
    app: {
      shareable_id: 'username/custom_id'
    }
  }]
]

preferScenarioName

Cucumber only. Set the BrowserStack Automate session name to the Scenario name if only a single Scenario ran. Useful when running in parallel with wdio-cucumber-parallel-execution.

Type: Boolean Default: false

sessionNameFormat

Customize the BrowserStack Automate session name format.

Type: Function Default (Cucumber/Jasmine): (config, capabilities, suiteTitle) => suiteTitle Default (Mocha): (config, capabilities, suiteTitle, testTitle) => suiteTitle + ' - ' + testTitle

sessionNameOmitTestTitle

Mocha only. Do not append the test title to the BrowserStack Automate session name.

Type: Boolean Default: false

sessionNamePrependTopLevelSuiteTitle

Mocha only. Prepend the top level suite title to the BrowserStack Automate session name.

Type: Boolean Default: false

setSessionName

Automatically set the BrowserStack Automate session name.

Type: Boolean Default: true

setSessionStatus

Automatically set the BrowserStack Automate session status (passed/failed).

Type: Boolean Default: true

buildIdentifier

buildIdentifier is a unique id to differentiate every execution that gets appended to buildName. Choose your buildIdentifier format from the available expressions:

  • BUILD_NUMBER: Generates an incremental counter with every execution
  • DATE_TIME: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
services: [
  ['browserstack', {
    buildIdentifier: '#${BUILD_NUMBER}'
  }]
]

Build Identifier supports usage of either or both expressions along with any other characters enabling custom formatting options.

opts

BrowserStack Local options.

Type: Object Default: {}

List of available local testing modifiers to be passed as opts:

Local Identifier

If doing simultaneous multiple local testing connections, set this uniquely for different processes -

opts = { localIdentifier: "randomstring" };

Verbose Logging

To enable verbose logging -

opts = { verbose: "true" };

Note - Possible values for 'verbose' modifier are '1', '2', '3' and 'true'

Force Local

To route all traffic via local(your) machine -

opts = { forceLocal: "true" };

Folder Testing

To test local folder rather internal server, provide path to folder as value of this option -

opts = { f: "/my/awesome/folder" };

Force Start

To kill other running BrowserStack Local instances -

opts = { force: "true" };

Only Automate

To disable local testing for Live and Screenshots, and enable only Automate -

opts = { onlyAutomate: "true" };

Proxy

To use a proxy for local testing -

  • proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
  • proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
  • proxyUser: Username for connecting to proxy (Basic Auth Only)
  • proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
opts = {
  proxyHost: "127.0.0.1",
  proxyPort: "8000",
  proxyUser: "user",
  proxyPass: "password",
};

Local Proxy

To use local proxy in local testing -

  • localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
  • localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used
  • localProxyUser: Username for connecting to proxy (Basic Auth Only)
  • localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
opts = {
  localProxyHost: "127.0.0.1",
  localProxyPort: "8000",
  localProxyUser: "user",
  localProxyPass: "password",
};

PAC (Proxy Auto-Configuration)

To use PAC (Proxy Auto-Configuration) in local testing -

  • pac-file: PAC (Proxy Auto-Configuration) file’s absolute path
opts = { "pac-file": "<pac_file_abs_path>" };

Binary Path

By default, BrowserStack local wrappers try downloading and executing the latest version of BrowserStack binary in ~/.browserstack or the present working directory or the tmp folder by order. But you can override these by passing the -binarypath argument. Path to specify local Binary path -

opts = { binarypath: "/path/to/binary" };

Logfile

To save the logs to the file while running with the '-v' argument, you can specify the path of the file. By default the logs are saved in the local.log file in the present woring directory. To specify the path to file where the logs will be saved -

opts = { verbose: "true", logFile: "./local.log" };

For a detailed list of BrowserStack WebdriverIO services, see the BrowserStack documentation for App Automate(app testing) and Automate (web testing).

For more information on WebdriverIO see the homepage.