Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Pure Javascript Cucumber
JavaScript Ruby

This branch is 360 commits behind cucumber:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
example
features
lib
spec
.gitignore
.gitmodules
.npmignore
.travis.yml
Gemfile
Gemfile.lock
Guardfile
History.md
LICENSE
Procfile
README.md
Rakefile
cucumber.yml
package.json

README.md

Cucumber.js Build Status

Cucumber, the popular Behaviour-Driven Development tool, brought to your JavaScript stack.

It runs on both Node.js and modern web browsers.

Try it now: http://cucumber.no.de!

Development status

Cucumber.js is still a work in progress. Here is its current status.

Cucumber Technology Compatibility Kit

FeatureStatus
Core (scenarios, steps, mappings)Done
BackgroundDone1
Calling steps from step defsTo do
CommentsDone
Command-line interfaceDone1, 2
Command-line optionsTo do2
Data tablesDone
Doc StringsDone
Failing stepsDone
HooksTo do
I18nTo do
JSON formatterTo do
Pretty formatterTo do2
Scenario outlines and examplesTo do
Stats collectorTo do
Step argument transformsTo do
TagsTo do
Undefined stepsDone
Wire protocolTo do
WorldDone
  1. Not certified by Cucumber TCK yet.
  2. Considered for removal from Cucumber TCK.

Cucumber.js-specific features

FeatureStatus
BackgroundDone1
CoffeeScript supportDone
Command-line interfaceDone
  1. Will be certified by Cucumber TCK.

Prerequesites

Cucumber.js was tested on:

  • Node.js 0.4, 0.5, 0.6
  • Google Chrome
  • Firefox
  • Safari

Use it

A very young example app is now available.

Setup for using in Node.js and running tests

Install the required dependencies:

$ npm link

Play

$ node example/server.js

Then go to localhost:9797.

Run tests

Specs

$ node_modules/.bin/jasmine-node spec

Features & documentation

There is a common set of features shared by all cucumber implementations. It's called the Technology Compatibility Kit or TCK. Find more on the Cucumber TCK repository.

The official way of running them is through Cucumber-ruby and Aruba. Ruby and Bundler are required for this to work.

$ git submodule update --init
$ bundle
$ rm -rf doc; ARUBA_REPORT_DIR=doc cucumber features/cucumber-tck -r features

You can then open the generated documentation:

$ open doc/features/cucumber-tck/*.html # might open a lot of files ;)

In addition to that, Cucumber.js is able to run the features for itself too:

$ ./bin/cucumber.js features/cucumber-tck -r features

There are a few other Cucumber.js-dependent features. Execute everything:

$ ./bin/cucumber.js

Rake

Alternatively, you can run everything with the help of Rake:

$ git submodule update --init
$ bundle
$ rake

Debug messages

You can display debug messages by setting the DEBUG_LEVEL environment variable. It goes from 1 to 5. 5 will diplay everything, 1 will only print out the critical things.

$ DEBUG_LEVEL=5 ./bin/cucumber.js

It even works with Aruba:

$ rm -rf doc; DEBUG_LEVEL=5 ARUBA_REPORT_DIR=doc cucumber features/cucumber-tck -r features
$ open doc/features/cucumber-tck/*.html # you'll see debug messages in Aruba-generated docs
Something went wrong with that request. Please try again.