Opinionated Programmer - Jo Liss's musings on enlightened software development.

Capybara roundup

Here is a roundup of recent changes in and around Capybara. Where they apply to the Capybara source, they are not included in any release yet, so make sure you are using the edge version from GitHub (and be prepared for things to break here and there ^_^).

  • The Celerity and Culerity drivers have been extracted into the capybara-celerity and capybara-culerity gems (5c4f28, by Gabriel Sobrinho). They will be officially supported until (at least) Capybara 1.0, but Jonas recommends using Akephalos as your HtmlUnit driver.
  • For RSpec, Capybara now supports :type => :request example groups, as suggested by the rspec-rails gem (558e7b, by yours truly). See the README, section “Using Capybara with RSpec”.
  • There is now an (optional) acceptance test DSL for RSpec (f4897f, by Jonas Nicklas and Nicklas Ramhöj). See the README (section “Using Capybara with RSpec”) or Jeff Kreeftmeijer’s blog post.
  • The Selenium driver now waits for Ajax requests (021b87, by Maurizio Giambalvo, Jonas, and Nicklas). Search the README for :resynchronize for more info.
  • Capybara now prefers visible over hidden elements (408423, by Jonas and Nicklas, configurable with Capybara.prefer_visible_elements).
  • The RSpec matchers, which are responsible for giving you nice error messages (and allow you to write should_not have_css without breaking asynchronous JavaScript, though that’s not documented yet), have been improved and are now used in Cucumber as well. Jonas says they might still change a bit, so don’t rely on them too much.
  • John Firebaugh wrote a capybara-firebug gem to run Capybara with Firebug enabled.

Miscellaneous tips and tricks from around the web:

Anything else? Leave a comment!

P.S. Thanks to Elabs for continuing to put company resources into Capybara! Did you know you can hire them to do agile web development for you? (Full disclosure: I’m not affiliated.)