I’m normally very conservative when it comes to adopting new development tools. I want to Get Stuff Done™, not waste my time playing with the latest shiny new toy.
Nevertheless, when Capybara came out I jumped right on it.
Capybara came onto the scene with an impressively clean codebase, and it brought with it one revolutionary idea: a totally consistent developer-facing API for writing tests and a dead-simple way of swapping in and out back-ends ("drivers" in Capybara-speak), even on a scenario-by-scenario basis.
So my first experience with Capybara was dropping Selenium for Culerity. Culerity may have its own problems, but it has been orders of magnitude more robust for me than Selenium ever was. (It may be that Selenium has improved since I last had to use it, but from comments I read on mailing lists I see that it is still bring a lot of pain to quite a few unfortunate people out there.)
JRuby and Bundler
For me the main problem that Culerity has is that it brings in a dependency on JRuby into a project which is otherwise pure MRI. This in turn wreaks havoc as far as Bundler is concerned. I’m probably one of the least favorite posters on the Bundler issue tracker due to the number of times I’ve pointed out problems with using Bundler in a mixed MRI/JRuby environment; in short, it is a tricky issue, and nobody sane would do it unless there were no viable alternatives.
Cabybara to the rescue, again
This set-up works, but the dependency on JRuby and the problems it causes for Bundler are an annoyance.
Nevertheless, the driver model of Capybara and the consistent API allow me to consider switching to alternative back-ends without having to sweep over my entire test suite making changes.
- Then there’s Akephalos, which I’d never even heard about until I read this post; it’s apparently Jonas Nicklas’ favorite driver right now (Jonas is the author of Capybara), and somehow manages to build on top of the Java HtmlUnit without needing to go through JRuby. I’m going to have a look into it and will be curious to see how it does this.
The great thing about Capybara is that you’re free to try out alternatives like this with a very low commitment. Flip a switch and try it out, if you’re not happy, just flip it back.