`
yanzilee9292
  • 浏览: 528293 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

RubyDevelopment on selenium

 
阅读更多

 

Introduction

This page details how to build and test the Ruby code in Selenium.

Details

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.

Building

After making changes, you need to build the code (this is needed since we depend on other parts of the project):

  • ./go //rb:firefox
  • ./go //rb:chrome
  • etc.

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.

Testing

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)

 

Contributing

  1. Make your feature addition or bug fix.
  2. Add tests for it. This is important so we don't break it in a future version unintentionally.
  3. Create a patch: svn diff > my-feature.patch
  4. Create a new issue, attach the patch and add the Lang-Ruby label. 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics