Add Q promises goodness to cucumberjs steps.
In a step definition file, before defining and Given, When, or Then
steps, pass the step object to qcumber.
module.exports=function(){require('qcumber')(this);this.Given(/asynchronouscondition/,function(){returntrue;});}Now, any step definitions will promise to behave. Any step that throws an exception will be marked as a failure. Any step that returns normally will count as a success. Any step that returns a promise-like will behave asynchronously, counting as a success if the promise resolves, or a failure if the promise rejects.
module.exports=function(){require('qcumber')(this);this.Given(/asynchronouscondition/,function(){returntrue;});this.When(/anasynchronousaction/,function(){returnHTTP.Request.get_with_promise('http://localhost');});this.Then(/afailurecondition/,function(){thrownewError('A failure occured in this step.');});}