views:

172

answers:

3

Has anyone tried creating end user (potentially online, potentially to be printed) help/documentation out of your cucumber scenarios? Or taken screenshots for use in documentation using RSpec and Selenium RC's ability to do so?

For Cucumber, I'm imagining something like:

Scenario: If you want to add a link
Given I am on the edit blog post page
When I press the "add link" button
And I type in a link URL "http://stackoverflow.com"
And I click "OK"
Then the blog post should have 1 link

Translating to the documentation:

If you want to add a link, go to the edit blog post page. Press the "add link" button and type a URL, like "http://stackoverflow.com", into the link URL field. Click "OK".

Would it be worth my time to try and, for one, write something to parse my Cucumber features into documentation, and two, to write/structure my Cucumber features in such a way as to create good documentation? Would the resulting documentation end up sounding really boring without much variation in the structure?

Is there anything else out there like this idea? Doxygen looks like it's more for code documentation than end-user documentation.

What about automatically taking screenshots? This seems like a more fruitful path-- just reuse the code that takes a screenshot when an RSpec test fails and have it take one in prescribed situations. Is there a better way to do this?

A: 

Sounds cool. Maybe you don't want some of the cucumber scenarios available to the whole world. If a developer put something sensitive, like people's names / development passwords; or a website exploit was discovered and a cucumber scenario was written to verify it was patched.

Sean B
+1  A: 

You should take a look at the cucumber-screenshot gem. It looks like it does exactly what you want--taking HTML or (if you're on a Mac) PNG screenshots of each step in your scenarios. (I was playing with my own version of this idea for a while last year. I dropped it pretty early on, so you're probably better off with cucumber-screenshot, but feel free to take anything you can use from Visible Cukes too).

Moss Collum
+1  A: 

I use Lowdown (http://lowdownapp.com) to communicate features back and forth with clients. The whole point of cucumber is that it's business specific, so you shouldn't have to translate it to another format for documentation. I kinda see where you're going, though.

You can use http://seleniumshots.com/ for getting screenshots from your app from the tests. I don't know if it's out of beta yet, though.

wesgarrison