At CDD we use a fairly strange stack to run our automated in-browser (Selenium RC) integration tests.
When we started writing these tests back in 2007, we used the best technology we knew of that was then available, a Rails plugin called funkytown, since-abandoned brainchild of Pivotal Labs. Funkytown’s code is a little weird, and we’ve had to fix bugs and inflexibilities from time to time. We monkeypatched its rake tasks. Over the years we updated the bundled version of the selenium RC jar file several times.
We wrote another library (selenium-spec, which we open sourced once a while back) on top of funkytown that integrated selenium tests into rspec, provided the ability to chain examples (see this blog post), as well as
some webrat-like helper methods, except better, enabling code like element('results').should be_visible.
So that’s what we’ve been using for a few years now. It’s not pretty, but it works. When cucumber and webrat came out, all the buzz made me think that we’d inevitably switch over some day in the beautiful future when everything will be perfect. However, I recently had the opportunity to try them out on a another pet project of mine, and I was surprised to learn that even though they have a much bigger install base than our install base of one, our crazy stack turns out to be better.
There are three major problems with cucumber/webrat/selenium RC, as far as I can tell:
- You can’t really use fixtures.
- Debugger breakpoints in your application code don’t work.
- I swear there was a number three.
All of those (well, at least the first two) aren’t true of our crazy stack, and I wouldn’t want to give them up.
There are some nice things about cucumber/webrat. The annotations are neat, and it’s kind of cool that you can run your tests as both Rails integration and selenium RC tests (although I imagine once your tests get realistically complex at all that is no longer so assured).
Perhaps a good opportunity, one day in that beautiful future, for us to clean up our stack, rebase it on some more modern infrastructure (or rewrite our own), and open source what for us has been a really useful tool.