This page details how to build and test the Ruby code in Selenium.
The CrazyFunBuild runs on a bundled JRuby jar and is based on Rake. Use the 'go' Rake wrapper to run the targets. Unfortunately, rvm sets GEM_HOME and causes trouble for our jruby-complete.jar. If you use rvm, you should disable it (rvm use system) before using the go script.
Since this is just a wrapper for Rake, familiar commands (like go -T to list targets) all work.
After making changes, you need to build the code (this is needed since we depend on other parts of the project):
Build results go in the build/rb directory. You can play with your changes in irb from there:
irb -I build/rb/lib -r selenium-webdriver
Using/requiring the ruby code from rb/lib directly is not recommended.
Most of the Ruby targets should work on both MRI (using rake //rb:<target>) or the bundled JRuby jar (using ./go //rb:<target>). One notable exception is the //rb:remote-test target, which relies on being able to compile the server jar. You can however do the build with JRuby/go, then use rake to run the tests.
For MRI, it's a good idea to run rake //rb:install-gems to make sure you have the dependencies installed.
./go //rb:unit-test | Run unit tests for WebDriver. |
./go //rb:firefox-test | Run integration tests for Firefox - replace "firefox" with any driver. |
./go //rb:rc-client-unit-test | Run unit tests for selenium-client (Se 1.x/RC) |
./go //rb:rc-client-integration-test | Run integration tests for selenium-client (Se 1.x/RC) |