grunt-cucumberjs

Generates documentation from Cucumber features

npm install grunt-cucumberjs
7 downloads in the last day
17 downloads in the last week
131 downloads in the last month

grunt-cucumberjs

Runs cucumberjs features and output results in various formats including html.

Getting Started

This plugin requires Grunt ~0.4.1

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 grunt-cucumberjs --save-dev

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

grunt.loadNpmTasks('grunt-cucumberjs');

The "cucumberjs" task

Overview

In your project's Gruntfile, add a section named cucumberjs to the data object passed into grunt.initConfig().

grunt.initConfig({
  cucumberjs: {
    options: {
      format: 'html',
      output: 'my_report.html',
      theme: 'bootstrap'
    },
    my_features: ['features/feature1.feature', 'features/feature2.feature'],
    other_features: {
      options: {
        output: 'other_report.html'
      },
      src: ['other_features/feature1.feature', 'other_features/feature2.feature']
    }
  }
});

Usage

#runs all features specified in task
$ grunt cucumberjs 

#run specific features
$ grunt cucumberjs --features=features/myFeature.feature

Options

options.steps

Type: String Default: ''

passes the value as --steps parameter to cucumber.

options.tags

Type: String Default: ''

passes the value as --tags parameter to cucumber.

options.theme

Type: String Default: 'foundation' Available: ['foundation', 'bootstrap', 'simple']

Specifies which theme to use for the html report

options.templateDir

Type: String Default: 'features/templates'

Location of your custom templates. Simply name the template the same as the one you are trying to override and grunt-cucumberjs will use it over the default template

options.output

Type: String Default: 'features_report.html'

Report output location. Please also include the appropriate extension. For example use js for json format.

options.format

Type: String Default: 'html' Available: ['pretty', 'progress', 'json', 'summary', 'html']

The output format for the tests.

npm loves you