wdio-webdriver-service
v1.0.1
Published
WebdriverIO service to start & stop WebDriver component (geckodriver, chrome driver)
Downloads
125
Maintainers
Readme
WDIO WebDriver Service
(Based on wdio-selenium-standalone-service)
This service helps you to run Chromedriver or Geckodriver seamlessly when running tests with the WDIO testrunner. It uses:
- geckodriver NPM package for runnings tests with Firefox.
- chromedriver NPM package for runnings tests with Chrome.
Note - this service does not require a Selenium server, but uses ChromeDriver or GeckoDriver to communicate with the browser directly. It supports:
capabilities: [{
browserName: 'firefox'
}]
and
capabilities: [{
browserName: 'chrome'
}]
Installation
The easiest way is to keep wdio-webdriver-service
as a devDependency in your package.json
.
{
"devDependencies": {
"wdio-webdriver-service": "~0.1"
}
}
You can simple do it by:
npm install wdio-webdriver-service --save-dev
Instructions on how to install WebdriverIO
can be found here.
Configuration
To use the service you need to add webdriver
to your service array:
// wdio.conf.js
export.config = {
port: '9515',
path: '/',
// ...
services: ['webdriver'],
// ...
webDriverType: 'geckodriver',
webDriverLogs: './',
webDriverArgs: ['--silent'],
webDriverKillProcess: false, // to kill webdriver (chromedriver or geckodriver) process after complete, default true
};
Options
webDriverLogs
Path where all logs from the WebDriver server should be stored.
Type: String
webDriverType
Type of the driver component to use.
Possible values: geckodriver
, chromedriver
Type: String
webDriverArgs
Arguments to run driver component binary with. Note that options for Gecko driver and Chrome driver are different.
More info:
Gecko driver options:
-b BINARY/--binary BINARY Path to the Firefox binary to use. --connect-existing Connecting to an existing Firefox instance. --host HOST Host to use for the WebDriver server. Defaults to 127.0.0.1. --log LEVEL Set the Gecko and geckodriver log level. --marionette-port PORT Port to use for connecting to the Marionette remote protocol. -p PORT/--port PORT Port to use for the WebDriver server. Defaults to 4444.
Chrome driver options:
--port=PORT Port to listen on --adb-port=PORT Adb server port --verbose Log verbosely --version Print the version number and exit --silent Log nothing --url-base Base URL path prefix for commands, e.g. wd/url --port-server Address of server to contact for reserving a port --whitelisted-ips Comma-separated whitelist of remote IPv4 addresses which are allowed to connect to ChromeDriver
Type: Array
For more information on WebdriverIO see the homepage.
TODO list
- [x] add support for Gecko driver
- [x] add support for Chrome driver
- [ ] add support for Edge driver
- [ ] add support for Safari driver