Skip to content
grunt-webdriver is a grunt plugin to run Selenium tests with Mocha and WebdriverIO
Pull request Compare This branch is 12 commits behind webdriverio:master.
Failed to load latest commit information.
tasks removed obsolete dependencies Sep 3, 2015
test added test, put sauce creds into jenkins Sep 3, 2015
.gitignore - removed ununsed nodeunit and grunt-clean plugins Mar 13, 2013

grunt-webdriver Build Status Join the chat at

grunt-webdriver is a grunt plugin to run selenium tests with the WebdriverIO testrunner, called wdio

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install --save-dev grunt-webdriver

This grunt plugin only runs with WebdriverIO >=v3.x. Make sure you have the latest WebdriverIO version installed as dependency:

npm install --save-dev webdriverio

Once the plugin has been installed, it may be enabled inside your Gruntfile
with this line of JavaScript:


The "webdriver" task


In your project's Gruntfile, add a section named webdriver to the data object passed into grunt.initConfig(). Your test should contain a configFile property with a path to your wdio config. You can pass in additional options as cli arguments.

Run this task with the grunt webdriver command.

  webdriver: {
    test: {
        configFile: './test/wdio.conf.js'
  // ...

The plugin is an easy helper to run WebdriverIO tests using the wdio test runner. You can find more information about the test runner on our docs page.

Example using Sauce Labs

To use a cloud service like Sauce Labs make sure you define host and port properties like in the example below as well as authenticate yourself with your username and key.

  webdriver: {
    options: {
        user: SAUCE_USERNAME,
        key: SAUCE_ACCESS_KEY
    test: {
        configFile: './test/wdio.conf.js'
  // ...


All options get passed into to the wdio process. You should define your main configurations within your wdio config file. The plugin allows you to easy overwrite them. You can find all available cli arguments here:

Using CoffeeScript

If you like to write your tests in CoffeeScript just add the following on the top of your Gruntfile and you are set.


module.exports = function(grunt) {
    // Project configuration.
        // ...


Please fork, add specs, and send pull requests! In lieu of a formal styleguide, take care to maintain the existing coding style.

Something went wrong with that request. Please try again.