Cucumber.js in-browser runner
DISCLAIMER This project is at its experimental stage. It's not tested and might be buggy.
A Cucumber.js runner for browsers Node.js middleware.
CukeStall lets you run a Cucumber feature suite against a Node.js web application right from your web browser.
Plug CukeStall connect middleware into your app to serve it to the browser:
var connect = require'connect';var CukeStall = require'cukestall';var app = connect;appuseconnectlogger'test';// your app code goes here ...appuseCukeStallrunnerfeaturePaths: __dirname + '/features/my.feature'stepDefsPaths: __dirname + '/features/step_definitions/stepdefs.js'supportCodePaths: __dirname + '/features/support/cukestall.js';applisten1337;
It is common to perform "short-circuit" actions from within step definitions and hooks. For example, you might need to wipe out the whole database before every scenario. To do so, you can use backdoors.
Backdoors are routes added on top of your existing application.
appuseCukeStallrunnerfeaturePaths: __dirname + '/features/my.feature'stepDefsPaths: __dirname + '/features/step_definitions/stepdefs.js'supportCodePaths: __dirname + '/features/support/cukestall.js'backdoors:// this backdoor will allow a step definition on the browser side// to empty the database:MyDbdropAll;resend"DB emptied.";;
The backdoor can be triggered by POSTing to
// features/support/cukestall.jsthisBefore$post'/cukestall/reset_all' nullcallback;;;