wdio-geckodriver-service

WebdriverIO service to start & stop GeckoDriver

Usage no npm install needed!

<script type="module">
  import wdioGeckodriverService from 'https://cdn.skypack.dev/wdio-geckodriver-service';
</script>

README

WDIO GeckoDriver Service

This service helps you to run GeckoDriver seamlessly when running tests with the WDIO testrunner. This service does not require a Selenium server, but uses the geckodriver NPM package that wraps the GeckoDriver for you.

Example capabilities:

capabilities: [{
    browserName: 'firefox'
}]

Installation

npm install wdio-geckodriver-service --save-dev

You have to install geckodriver separately, as it's a peerDependency of this project, and you're free to choose what version to use. Install it using:

npm install geckodriver --save-dev

Configuration

By design, only Firefox is available (when installed on the host system). In order to use the service you need to add geckodriver to your service array:

// wdio.conf.js
export.config = {
    // MANDATORY: Add geckodriver to service array.
    // Default: empty array
    services: [
        [
            'geckodriver',
            // service options
            {
                // OPTIONAL: Arguments passed to geckdriver executable.
                // Check geckodriver --help for all options. Example:
                // ['--log=debug', '--binary=/var/ff50/firefox']
                // Default: empty array
                args: ['--log=info'],

                // The path where the output of the Geckodriver server should
                // be stored (uses the config.outputDir by default when not set).
                logs: './logs'
            }
        ]
    ],
};

For more information on WebdriverIO see the homepage.