The IT Refinery

ajax testing with steamed cucumbers

For a long while I’ve wanted an easy way to test AJAX code using cucumber that didn’t require complicated setup or a change in the language I use to write step definitions. I like the portability and repeatability that always using the common webrat step definitions gives me. So, when someone mentioned Sven Fuchs’ and Clemens Kofler’s Steam to me, I gave it a try. After a little bit of frustration due to a misunderstanding about Steam being able to run with the vanilla webrat_steps.rb file (it won’t quite), and then some more frustration due to the fact my own Javascript wasn’t behaving as I expected (doh!), I had a working AJAX test suite.

I have added a version of webrat_steps.rb to Steam that runs under webrat and Steam seamlessly, you can find it at: webrat_compatible_steps.rb

If you’re looking for an easy way to test AJAX with cucumber, you might want to give Steam a go.