This is the webdriverio browser provider plugin for TestCafe. It uses the latest version of webdriverio to connect to Selenium/Appium server.
npm install -D https://github.com/fnlctrl/testcafe-browser-provider-webdriverio.git
A selenium compatible server (Selenium, Selenoid, Zalenium, Appium, etc.) up and running.
Also note that this plugin requires node>=7.6 with native async/await support
If you run tests from the command line, use the browser alias when specifying browsers. The '-c 2' parameter will split the tests up and run them across two browsers concurrently. Omit this if it is not needed.
testcafe -c 2 webdriverio:chrome 'path/to/test/file.js'
When you use API, pass the alias to the browsers()
method:
testCafe
.createRunner()
.src('path/to/test/file.js')
.browsers('webdriverio:chrome')
.concurrency(2)
.run();
The browser version and platform can be specified along with the browser name alias in the format:
webdriverio:browserName[@version][:platform][:device]
For example:
- webdriverio:chrome
- webdriverio:chrome@52.0
- webdriverio:chrome@52.0:linux
When using with Appium server, device name must be specified:
- webdriverio:chrome:android:my-device-name
for android devices, device names can be found with adb devices
Use the following optional environment variable to set additional configuration options:
-
REMOTE_HOST
- (optional) the hostname to the remote server. Default: 'localhost'. -
REMOTE_PORT
- (optional) the port to the remote server. Default: '4444'. -
ENABLE_VNC
- (optional) useENABLE_VNC=true
to addenableVNC: true
incapabilities
option for webdriverio. Default: false.