Run Integration Tests using Selenium, Mocha, a Server, and a Browser
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib more fixing Dec 20, 2013
.gitignore pkg Dec 19, 2013
.jshintrc pkg Dec 19, 2013
.travis.yml play around Dec 20, 2013
package.json move deps around Dec 20, 2013


grunt-integration Build Status Dependency Status help me on gittip flattr.png

Run Integration Tests using Selenium, Mocha, a Server, and a Browser


These are the goals of grunt-integration.

  • Start a local selenium server instance
  • Start a local program, such as node application
  • Wait for the program to listen on a specific port
  • Execute integration tests using Mocha and WebDriver
  • Using real browsers, such as Chrome
  • Automatically, in one command
  • Less painful installation process, please!

Read the article on Pony Foo


You'll need node, java. If you have apt-get, you can get java using the command below. If you like clicking on things, just google for a jdk distribution, and install that.

sudo apt-get install openjdk-7-jdk -y

Then install grunt-integration from npm.

npm install --save-dev grunt-integration


Here are the default options.

Option Default Details
program 'node app' This will be spawned and expected to listen
program_port process.env.TEST_PORT or 3333 Which port will you use?
program_inherit true Will program output be printed to the terminal?
selenium_inherit false Will selenium server output be printed to the terminal?
tests See below These are the options passed to mocha

Here are the default tests options. Note that if you want to change something in options.tests, you'll need to replace the whole object, so just copy and paste the defaults, and work from there. That's just how this.options() works in Grunt at the moment.

tests: {
    hostname: '',
    port: 4444,
    usePromises: true,
    concurrency: 1,
    browsers: [{ browserName: 'chrome' }],
    timeout: 40000,
    reporter: 'spec'

These defaults are good enough that you don't need to touch any of it to get started.

You can just configure it like this to get started.

    integration: {
        src: ['test/integration/**/*.js']


For usage examples, you're going to have to sink your teeth in wd.