<commit_before>Introduction
---
> CLI tool for generating [Cucumber](https://github.com/cucumber/cucumber-js) Specs to run in a web browser

Installation
---
[![Build Status](https://travis-ci.org/bustardcelly/cucumberjs-browser.png?branch=master)](https://travis-ci.org/bustardcelly/cucumberjs-browser)

```
npm  install -g cucumberjs-browser
```

Why?
---
There are a few examples out in the wild that demonstrate how to write [CucumberJS](https://github.com/cucumber/cucumber-js) specs _in_ the browser and/or _for_ the browser:

* [HTML example from CucumberJS](https://github.com/cucumber/cucumber-js/tree/master/example)
* [cukecipes](https://github.com/jbpros/cukecipes)
* [karma-cucumberjs](https://github.com/s9tpepper/karma-cucumberjs)

Good libraries and examples, but I wanted to be able to write my feature specs, support and step definitions as I normally would that are run under the CucumberJS CLI for node, and have them simply execute in the browser without having to modify them to fit another runtime or environment.

Additionally, I wanted to be able to define custom listeners that will provide feedback from your run specs dependent on my development needs and CI endpoint.

### Further Reading
A few articles have been written with further details on incorporating into your project and test automation routines:

* [BDD in Javascript: CucumberJS and The Browser](http://custardbelly.com/blog/blog-posts/2014/02/10/cucumberjs-tests-browser/index.html)
* [BDD in Javascript: CucumberJS and The Browser II](http://custardbelly.com/blog/blog-posts/2014/02/12/cucumberjs-browser-update/index.html)

### Note:
As of February 9th, 2014, there is only the following listeners that can be assigned:

* TAP (using the node-tap module)
* UI (basic example of printing specs to DOM)

_More to come..._

How?
---
The cucumberjs-browser cli tool bundles feature specs, support files and step definitions into standalone [browserify](http://browserify.org/)-ied modules. 

These references are injected into a testrunner template which instantiated a new [CucumberJS](https://github.com/cucumber/cucumber-js) runtime when the testrunner is loaded in a browser. When a format listener is defined, the page and/or console are updated as specs are run.

All this is donw without having to change the way you write your specs as you normally do!

Usage
---
```
cucumberjs-browser [-o outdir] [-f format] [--tmpl template] [--features features]
```

### outdir
The directory to generate the web-based cucumber task-runner.

_Default:_ __/browser-cukes__

### template
The default template to use in generating the main task-runner page. Most likely you will want to provide your own custom template that also loads your projects libraries and stylesheets. There is a default template that should be used as an example of what is required to properly run the specs in a browser.

_Default:_ [/template/cucumber-testrunner.template](https://github.com/bustardcelly/cucumberjs-browser/blob/master/template/cucumber-testrunner.template)

### features
The directory path for the Cucumber feature specs.

This location is used in globbing and bundling support and step files from the following locations under the directory:

* /support/**/*.js
* /step_definitions/**/*.js

_Default:_ __/features__

### format
The format to provide in the browser.

Formats are delivered by assigning a listener to the CucumberJS runtime in the browser. Currently, these listeners are internally to this library and are bundled and deployed to the specified output directory. In the future I would like to open up the possibility of assigning custom formatters/listeners.

Possible values (_as of February 9th, 2014_):

* ui
* tap

_Default:_ __none__<commit_msg>additona of sauclabs listenr/reporter to documentation.<commit_after>Introduction
---
> CLI tool for generating [Cucumber](https://github.com/cucumber/cucumber-js) Specs to run in a web browser

Installation
---
[![Build Status](https://travis-ci.org/bustardcelly/cucumberjs-browser.png?branch=master)](https://travis-ci.org/bustardcelly/cucumberjs-browser)

```
npm  install -g cucumberjs-browser
```

Why?
---
There are a few examples out in the wild that demonstrate how to write [CucumberJS](https://github.com/cucumber/cucumber-js) specs _in_ the browser and/or _for_ the browser:

* [HTML example from CucumberJS](https://github.com/cucumber/cucumber-js/tree/master/example)
* [cukecipes](https://github.com/jbpros/cukecipes)
* [karma-cucumberjs](https://github.com/s9tpepper/karma-cucumberjs)

Good libraries and examples, but I wanted to be able to write my feature specs, support and step definitions as I normally would that are run under the CucumberJS CLI for node, and have them simply execute in the browser without having to modify them to fit another runtime or environment.

Additionally, I wanted to be able to define custom listeners that will provide feedback from your run specs dependent on my development needs and CI endpoint.

### Further Reading
A few articles have been written with further details on incorporating into your project and test automation routines:

* [BDD in Javascript: CucumberJS and The Browser](http://custardbelly.com/blog/blog-posts/2014/02/10/cucumberjs-tests-browser/index.html)
* [BDD in Javascript: CucumberJS and The Browser II](http://custardbelly.com/blog/blog-posts/2014/02/12/cucumberjs-browser-update/index.html)

### Note:
As of February 15th, 2014, there is only the following listeners that can be assigned:

* TAP (using the node-tap module)
* UI (basic example of printing specs to DOM)
* SAUCELABS (uses QUnit reporting model to hook into saucelabs reporter)

_More to come..._

How?
---
The cucumberjs-browser cli tool bundles feature specs, support files and step definitions into standalone [browserify](http://browserify.org/)-ied modules. 

These references are injected into a testrunner template which instantiated a new [CucumberJS](https://github.com/cucumber/cucumber-js) runtime when the testrunner is loaded in a browser. When a format listener is defined, the page and/or console are updated as specs are run.

All this is donw without having to change the way you write your specs as you normally do!

Usage
---
```
cucumberjs-browser [-o outdir] [-f format] [--tmpl template] [--features features]
```

### outdir
The directory to generate the web-based cucumber task-runner.

_Default:_ __/browser-cukes__

### template
The default template to use in generating the main task-runner page. Most likely you will want to provide your own custom template that also loads your projects libraries and stylesheets. There is a default template that should be used as an example of what is required to properly run the specs in a browser.

_Default:_ [/template/cucumber-testrunner.template](https://github.com/bustardcelly/cucumberjs-browser/blob/master/template/cucumber-testrunner.template)

### features
The directory path for the Cucumber feature specs.

This location is used in globbing and bundling support and step files from the following locations under the directory:

* /support/**/*.js
* /step_definitions/**/*.js

_Default:_ __/features__

### format
The format to provide in the browser.

Formats are delivered by assigning a listener to the CucumberJS runtime in the browser. Currently, these listeners are internally to this library and are bundled and deployed to the specified output directory. In the future I would like to open up the possibility of assigning custom formatters/listeners.

Possible values (_as of February 15th, 2014_):

* ui
* tap
* saucelabs

_Default:_ __none__
{'fraction_non_alphanumeric': 0.08371604776276079, 'fraction_numerical': 0.007348117045007217, 'mean_word_length': 4.666914498141264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7160801', 'n_tokens_mistral': 2250, 'n_tokens_neox': 2121, 'n_words': 901}