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

README.markdown

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

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

Features

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

Installation

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

Configuration

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: '127.0.0.1',
    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.

grunt.initConfig({
    integration: {
        src: ['test/integration/**/*.js']
    }
});

Usage

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

License

MIT