Sometimes you inherit a non Ruby based web app written in PHP, Perl, Java, C#, or Python and you want to create an automated functional/acceptance test suite to minimize the amount of manual QA you need to do. Selenium is a great tool for doing just that and at Common Sense Media I created the Selenium Continuous Integration Runner to make it easy to run Selenese based tests from your Continuous Integration Server such as Hudson, Cruise Control, or Teamcity. That said, Selenese based tests leave something to be desired in terms of readability and maintainability.
The Ruby camp is often at the forefront of great testing frameworks with Aslak HellesÃ¸y often leading the charge with innovations like RSpec and Cucumber. I’d read and played around with Cucumber on Rails based apps and was loving the concept of english language specs that are actually executable as well. But when my friend and former colleague Chris Kimm mentioned that the testing group at his company was using it to test their Java application, I started to get excited as that was the problem I was about to try and tackle at VolunteerMatch.
However, getting the project structure in place required a little help from the Cucumber mailing list and in the hopes of saving others the time, I’ve published the Standalone Cucumber Test Suite to Github. It’s simply a Cucumber project designed to test a non Ruby web application with a sample search.feature that uses Google search as the basis for the test. It uses Capybara with the Selenium Webdriver on the backend but you can also switch it to use Culerity or Webrat if you don’t want it actually firing up a real browser to run the tests. Fork it or download it to start testing your existing website with Cucumber!