Capabilities
A capability is a definition for a remote interface. It helps WebdriverIO to understand in which browser or mobile environment you like to run your tests on. Capabilities are less crucial when developing tests locally as you run it on one remote interface most of the time but becomes more important when running a large set of integration tests in CI/CD.
The format of a capability object is well defined by the WebDriver specification. The WebdriverIO testrunner will fail early if user defined capabilities do not adhere to that specification.
Custom Capabilities
While the amount of fixed defined capabilities is very low, everyone can provide and accept custom capabilities that are specific to the automation driver or remote interface:
Browser Specific Capability Extensions
goog:chromeOptions
: Chromedriver extensions, only applicable for testing in Chromemoz:firefoxOptions
: Geckodriver extensions, only applicable for testing in Firefoxms:edgeOptions
: EdgeOptions for specifying the environment when using EdgeDriver for testing Chromium Edge
Cloud Vendor Capability Extensions
sauce:options
: Sauce Labsbstack:options
: BrowserStacktb:options
: TestingBot- and many more...
Automation Engine Capability Extensions
WebdriverIO Capabilities to manage browser driver options
WebdriverIO manages installing and running browser driver for you. WebdriverIO uses a custom capability that allows you to pass in parameters to the driver.
wdio:chromedriverOptions
Specific options passed into Chromedriver when starting it.
wdio:geckodriverOptions
Specific options passed into Geckodriver when starting it.
wdio:edgedriverOptions
Specific options passed into Edgedriver when starting it.
wdio:safaridriverOptions
Specific options passed into Safari when starting it.
wdio:maxInstances
Maximum number of total parallel running workers for the specific browser/capability. Takes precedence over maxInstances and maxInstancesPerCapability.
Type: number
wdio:specs
Define specs for test execution for that browser/capability. Same as the regular specs
configuration option, but specific to the browser/capability. Takes precedence over specs
.
Type: (String | String[])[]
wdio:exclude
Exclude specs from test execution for that browser/capability. Same as the regular exclude
configuration option, but specific to the browser/capability. Takes precedence over exclude
.
Type: String[]
wdio:enforceWebDriverClassic
By default, WebdriverIO attempts to establish a WebDriver Bidi session. If you don't prefer that, you can set this flag to disable this behavior.
Type: boolean
Common Driver Options
While all driver offer different parameters for configuration, there are some common ones that WebdriverIO understand and uses for setting up your driver or browser: