Skip to content

This is the Ruby client adapter for testing with Sauce Labs, a Selenium-based browser testing service (saucelabs.com).

License

Notifications You must be signed in to change notification settings

prudhvi/sauce_ruby

 
 

Repository files navigation

Sauce for Ruby

Build Status Dependency Status

This is the Ruby client adapter for testing with Sauce Labs, a Selenium-based browser testing service.

There is more information on the wiki, so be sure to look there for information too!

Installation

    % gem install sauce

Suggested Toolchain

The Sauce gem has been optimized to work most effectively with Cucumber and Capybara.

To get started with Sauce and Cucumber, install the appropriate gem:

    % gem install sauce-cucumber

And then read more how to get started with Cucumber and Capybara on this wiki page.

With Capybara && Sauce::Connect

Capybara on a random port. Sauce::Connect expects a port from a specific range. So, you need to pick one of :

80, 443, 888, 2000, 2001, 2020, 2222, 3000, 3001, 3030, 3333, 4000, 4001, 4040, 4502, 4503, 5000, 5001, 5050, 5555, 6000, 6001, 6060, 6666, 7000, 7070, 7777, 8000, 8001, 8003, 8031, 8080, 8081, 8888, 9000, 9001, 9080, 9090, 9999, 49221

Then set Capybara to do that with Capybara.server_port = the_chosen_port

The Browsers Array

When setting up the gem, you can pass a list of browsers:

Sauce.config do |c|
  c.browsers = [
    ["windows","firefox","18"],
    ["windows","opera","11"]
  ]
end

Then, depending on your test framework:

RSpec 2

Place your specs in the spec/selenium folder, or tag the example group with :sauce => true

RSpec 1

Give your tests a :type of :selenium, eg describe Aioli, :type => :selenium do

Tests will be run against each combination, sequentially and automagically.

If you don't place your tests in these locations, only the first browser in the array will run.

Work is continuing in magic browser delights for other tools. (PSST: If you have ideas, please let us know!)

Contributing to the Gem

  • Fork the GitHub project
  • Create a branch to perform your work in, this will help make your pull request more clear.
  • Write some RSpec tests to demonstrate your desired capability or exhibit the bug you're fixing.
  • Make your feature addition or bug fix.
  • Commit
  • Send a pull request! :)

Testing the Gem

Running the full test suite will require RVM

  • Set SAUCE_USERNAME and SAUCE_ACCESS_KEY in your environment to valid Sauce credentials or create an ondemand.yml in the following format:

      access_key: <yourkeyhere>
      username: <yourusernamehere>
    
  • Invoke bundle install to install the gems necessary to work with the Sauce gem

  • Running rake spec:unit will run the RSpec unit tests

  • If you'd like to run the entire test suit, rake test will run all the integration tests, but requires the Sauce credentials to be set up properly as these tests will run actual jobs on Sauce.

About

This is the Ruby client adapter for testing with Sauce Labs, a Selenium-based browser testing service (saucelabs.com).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 97.9%
  • Shell 1.5%
  • JavaScript 0.6%