Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Autotest Integration

aslakhellesoy edited this page Aug 13, 2010 · 31 revisions

Cucumber comes with an autotest plugin that will hook into the regular autotest cycle to run the features after the tests/specs. The plugin is disabled by default but can be turned on by setting the AUTOFEATURE environment variable to ‘true’. For example:

$ AUTOFEATURE=true autospec

If you always want to have the plugin run then you can export the variable in your .bash_profile or other shell file like so:

POSIX shell:

$ export AUTOFEATURE=true

Windows command shell:

$ set AUTOFEATURE=true

By default the plugin will run all the features in the features dir. To change the way the features are ran with autotest create an ‘autotest’ profile in your cucumber.yml. Please see Running Features for more information about profiles.

Why is it disabled by default?

Autotest is geared toward the Red→Green→Refactor cycle on an object level (unit-tests.) These object level specs/tests are generally highly focused and isolated per object so breaks can be detected on a very detailed level. The suites are meant to run extremely fast to give the developer quick feedback. Cucumber on the other hand provides end-to-end application level testing. By executing the entire stack features can help find integration failures between objects and provide large coverage to prevent regressions. A side effect of this is that features are generally much slower than object level specs. Due to their relative slowness and non-focused nature they may not be realistic to run along side the object-level suite. Of course every project is different and every developer has different workflow preferences.

Clone this wiki locally