Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ruby Development

Alex Rodionov edited this pageOct 16, 2017 ·5 revisions

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 (likego -T to list targets) all work.

Setting up

Tests will be run with your local Ruby installation, which should be a version >= 1.9.2.Make sure you have bundler and our dependencies installed by running

  1. gem install bundler
  2. ./go //rb:bundle

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 thebuild/rb directory. You can play with your changes in a REPL from there:

cd build/rb && bundle console

Using/requiring the ruby code fromrb/lib directly is not recommended.

You can build the gem with./go //rb:gem:build, which will place the gem inbuild/. See ReleasingSelenium for how to make a gem release.

Testing

CommandDescription
./go //rb:unit-testRun unit tests for WebDriver.
./go //rb:firefox-testRun integration tests for Firefox - replace "firefox" with any driver.
./go //rb:remote-firefox-testRun integration tests for Firefox on standalone server

Try./go -T | grep //rb to see all the Ruby targets.

You can also run enable debug mode by passinglog=1 to the Rake target and run a single scenario by passingexample="full name of test".

Dependencies

All Ruby dependencies are packaged in the repository. This means that you only need to have Ruby 2.0+ installed on your system to build and test Ruby bindings.

On the other hand, all the dependencies versions are locked in the repository, so from time to time we need to update them. To do that, you need to perform the following:

  1. Switch tominimum required Ruby version (see gemspec).
  2. BUNDLE_GEMFILE="rb/Gemfile" bundle update.

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:git diff > my-feature.patch
  4. Create anew issue, attach the patch and add the Lang-Ruby label.

Notice for Users

This wiki is not where you want to be!Visit the Wiki Home for more useful links

For Developers and Contributors

Getting Involved
Triaging Issues
Releasing Selenium

Binding Specific Information

Ruby Development
Python Bindings
Ruby Bindings
WebDriverJs

Being Processed

This content is being evaluated for where it belongs

Architectural Overview
Automation Atoms
HtmlUnitDriver
Lift Style API
LoadableComponent
Logging
PageFactory
RemoteWebDriver
Xpath In WebDriver

Archived

Moved toOfficial Documentation

Bot Style Tests
Buck
Continuous Integration
Crazy Fun Build
Design Patterns
Desired Capabilities
Developer Tips
Domain Driven Design
Firefox Driver
Firefox Driver Internals
Focus Stealing On Linux
Frequently Asked Questions
Google Summer Of Code
Grid Platforms
History
Internet Explorer Driver
InternetExplorerDriver Internals
Next Steps
PageObjects
RemoteWebDriverServer
Roadmap
Scaling WebDriver
SeIDE Release Notes
Selenium Emulation
Selenium Grid 4
Selenium Help
Shipping Selenium 3
The Team
TLC Meetings
Untrusted SSL Certificates
WebDriver For Mobile Browsers
Writing New Drivers

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp