Introducing cukecooker: writing cucumber scenarios with aid

In our development team we want our testers to start writing cucumber features. I know, BDD, the features should be written before the code, but a tester could later add scenarios which we haven’t previously thought or regression features for bugs.

For writing the scenarios she could learn the steps from other features or just browse the step definition files, but I felt it was a little uncomfortable, specially having to deal with regular expressions. So we thought about writing a script that lists all step definitions in a project: then she could browse the list, copy what she needed and fill in the parameters.

I went a step further: why not generating a page that allows her to browse steps, select one, fill in the parameters and then write it to a scenario? After doing this for many steps he could copy and paste the resulting scenario to the feature file. Autocompletion, no need to deal with regular expressions, just one copy and paste, nice colors (well, this last point might not be true).

And so cukecooker was born. You can think of it as a Cucumber IDE. To install it:

gem install cukecooker

To run it:

cukecooker

or

cukecooker path/to/your/project

This will generate an HTML file. Open it and start writing cucumber scenarios. Here are some screenshots.

This is the step selection part, where typing in the input above filters the steps, you can navigate them using the arrow keys and choose one pressing enter (or using the mouse):

cukecooker filter steps

Once you select a step you can fill in the parameters:
cukecooker complete parameters

For steps which require a table or a multiline string I just put a big “TODO: complete this”… maybe in a future I’ll include an editor for that.

Enjoy!

One Response to Introducing cukecooker: writing cucumber scenarios with aid

  1. Pingback: Delicious Bookmarks for December 31st from 03:02 to 03:17 « Lâmôlabs

Leave a Reply

Your email address will not be published. Required fields are marked *


two − 2 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>