The changes done as a part of this fork have now been merged into @wdio/browserstack-service, so we will be deprecating this package. Please install the service using:
npm install @wdio/browserstack-service --save-dev
# WebdriverIO Browserstack Service
The official BrowserStack WebdriverIO service that integrates your WebdriverIO test suite with BrowserStack.
You can simply do it by:
npm install @browserstack/wdio-browserstack-service --save-dev
Instructions on how to install WebdriverIO
can be found here.
WebdriverIO has Browserstack support out of the box. You should simply set user
and key
in your wdio.conf.js
file. This service plugin provides supports 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.config = {
// ...
user: process.env.BROWSERSTACK_USERNAME,
key: process.env.BROWSERSTACK_ACCESS_KEY,
services: [
['@browserstack/wdio-browserstack-service', {
browserstackLocal: true
}]
],
// ...
};
In order to authorize to the BrowserStack service your config needs to contain a user
and key
option.
Set this to true to enable routing connections from Browserstack cloud through your computer.
Type: Boolean
Default: false
Cucumber only. Set this to true to enable updating the session name to the Scenario name if only a single Scenario was ran. Useful when running in parallel with wdio-cucumber-parallel-execution.
Type: Boolean
Default: false
Specified optional will be passed down to BrowserstackLocal.
Type: Object
Default: {}
List of available local testing modifiers to be passed as opts:
If doing simultaneous multiple local testing connections, set this uniquely for different processes -
opts = { localIdentifier: 'randomstring' };
To enable verbose logging -
opts = { verbose: 'true' };
Note - Possible values for 'verbose' modifier are '1', '2', '3' and 'true'
To route all traffic via local(your) machine -
opts = { forceLocal: 'true' };
To test local folder rather internal server, provide path to folder as value of this option -
opts = { f: '/my/awesome/folder' };
To kill other running Browserstack Local instances -
opts = { force: 'true' };
To disable local testing for Live and Screenshots, and enable only Automate -
opts = { onlyAutomate: 'true' };
To use a proxy for local testing -
opts = {
proxyHost: '127.0.0.1',
proxyPort: '8000',
proxyUser: 'user',
proxyPass: 'password',
};
To use local proxy in local testing -
opts = {
localProxyHost: '127.0.0.1',
localProxyPort: '8000',
localProxyUser: 'user',
localProxyPass: 'password',
};
To use PAC (Proxy Auto-Configuration) in local testing -
opts = { 'pac-file': '<pac_file_abs_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' };
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 more information on WebdriverIO see the homepage.