WebDriverIO BrowserStack service for Automate
A WebdriverIO service for BrowserStack users on Automate, enabling testing on 3,000+ real browsers and devices with support for local testing and test analytics.
The WebdriverIO BrowserStack Service enables seamless integration between WebdriverIO and BrowserStack, allowing you to run tests across real devices and browsers at scale. This guide walks you through the setup, configuration, and key options needed to run automated tests using BrowserStackβs cloud infrastructure, including support for local testing and test observability features.
BrowserStack credentials
Ensure you have set your BrowserStack credentials as environment variables.
export BROWSERSTACK_USERNAME="YOUR_USERNAME"
export BROWSERSTACK_ACCESS_KEY="YOUR_ACCESS_KEY"
Configurationβ
Add your BrowserStack service settings to wdio.conf.js
. Here is an example configuration file to help you get started with:
Optionsβ
The following table lists the supported WebDriverIO BrowserStack (wdio.conf.js
) capabilities and how they must be defined in the configuration file:
Capability | Description | Example usage in wdio.conf.js
|
---|---|---|
browserName |
Specify the browser name to run the test on | browserName: βchromeβ |
browserVersion |
Define the version of the browser | browserVersion: βlatestβ |
os |
Operating system to run tests on | βbstack:optionsβ: { os: βWindowsβ } |
osVersion |
Version of the operating system | βbstack:optionsβ: { osVersion: β10β } |
deviceName |
Specify the device for mobile testing | βbstack:optionsβ: { deviceName: βSamsung Galaxy S20β } |
buildName |
Custom build name for your test run | βbstack:optionsβ: { buildName: βMy Buildβ } |
projectName |
Custom project name | βbstack:optionsβ: { projectName: βMy Projectβ } |
source |
Identifier for the framework and version used | βbstack:optionsβ: { source: βwebdriverio:my-app:v1.0β } |
networkLogs |
Enable network logs | βbstack:optionsβ: { networkLogs: true } |
consoleLogs |
Set console log level | βbstack:optionsβ: { consoleLogs: βinfoβ } |
debug |
Enable debugging mode | βbstack:optionsβ: { debug: true } |
idleTimeout |
Timeout in seconds before ending an idle session | βbstack:optionsβ: { idleTimeout: 90 } |
seleniumLogs |
Enable Selenium logs | βbstack:optionsβ: { seleniumLogs: true } |
buildIdentifier |
Placeholder for CI build number | buildIdentifier: β#${BUILD_NUMBER}β |
browserstackLocal |
Enable Local Testing | browserstackLocal: true |
opts.forceLocal |
Force local testing even when external connection is available | opts: { forceLocal: true } |
opts.localIdentifier |
Identifier for your local instance | opts: { localIdentifier: βmy-localβ } |
forcedStop |
Force stop Local binary | forcedStop: false |
sessionNameFormat |
Format for test session names | sessionNameFormat: (config, capabilities) => { return βMy Testβ; } |
sessionNamePrependTopLevelSuiteTitle |
Prepend top-level suite title to session name | sessionNamePrependTopLevelSuiteTitle: true |
sessionNameOmitTestTitle |
Omit test title from session name | sessionNameOmitTestTitle: true |
skipSessionStatus |
Skip automatic session status reporting | skipSessionStatus: true |
preferScenarioName |
Prefer scenario name for session naming | preferScenarioName: true |
skipSessionName |
Skip setting session name | skipSessionName: true |
testObservabilityOptions.buildName |
Build name used for observability tracking | testObservabilityOptions: { buildName: βMy Buildβ } |
testObservabilityOptions.projectName |
Project name used for observability tracking | testObservabilityOptions: { projectName: βMy Projectβ } |
testObservabilityOptions.buildTag |
Tags to categorize your build | testObservabilityOptions: { buildTag: [βtag1β, βtag2β] } |
accessibility |
Enable accessibility testing | accessibility: true |
accessibilityOptions.wcagVersion |
WCAG version to use for compliance checks | accessibilityOptions: { wcagVersion: βwcag21aβ } |
accessibilityOptions.includeIssueType.bestPractice |
Include best practice issues in the report | includeIssueType: { bestPractice: true } |
accessibilityOptions.includeIssueType.needsReview |
Include review-needed issues in the report | includeIssueType: { needsReview: false } |
accessibilityOptions.includeTagsInTestingScope |
Tags to include in accessibility scan | includeTagsInTestingScope: [βFirstβ] |
accessibilityOptions.excludeTagsInTestingScope |
Tags to exclude from accessibility scan | excludeTagsInTestingScope: [βTwiceβ] |
percy |
Enable Percy for visual testing | percy: false |
percyCaptureMode |
Percy capture mode | percyCaptureMode: βautoβ |
turboscale |
Enable TurboScale optimization | turboscale: false |
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!