What is Celerity?
Celerity is a JRuby wrapper around HtmlUnit – a headless Java browser with JavaScript support. It provides a simple API for programmatic navigation through web applications. Celerity aims at being API compatible with Watir.
Features
- Fast - No time-consuming GUI rendering or unessential downloads
- Easy to use - Simple API
- JavaScript support
- Scalable - Java threads lets you run tests in parallel
- Portable - Cross-platform thanks to the JVM
- Unintrusive - No browser window interrupting your workflow (runs in background)
Requirements
- JRuby (download) (installation)
- Java 6 (download)
Background
FINN.no is a top provider of online classifieds in Europe. Consequently automated functional testing is an essential part of our quality assurance effort. As of spring 2008 our Watir test suite, consisting of 340 test cases (which only covers part of our application), completes in 3 hours. Obviously, not optimal for an agile development environment.
We need a faster alternative. At the same time, we enjoy working with Ruby and Watir's API. By providing this API on top of HtmlUnit, we hope to significantly speed up test suite execution, while avoiding a rewrite of our existing test suite. Early benchmarks are available.
Installing Celerity
$ jruby -S gem install celerity
Code example
= Celerity::Browser.new
browser.goto('http://www.google.com')
browser.text_field(:name, 'q').value = 'Celerity'
browser.button(:name, 'btnG').click
puts "yay" if browser.text.include? 'celerity.rubyforge.org'
browser
For more examples and help, check our wiki.
How to submit patches
Read the 8 steps for fixing other people's code. The repository is hosted at GitHub
. Failing specs for issues/features are most welcome!
License
Celerity is licensed under the GPLv3 license.
Contact
Comments are welcome. You can reach us through our mailing lists, our forum, or our individual email addresses below.