Sauce OnDemand is a Selenium testing cloud service, developed by Sauce Labs Inc (saucelabs.com). This is the Ruby client adapter for Sauce OnDemand.
Go to file
R. Tyler Croy 8ac48b8de7 Move the cucumber code out into it's own gem 2012-08-14 21:28:33 -07:00
bin Refactor/cleanup the `sauce` binary, adding some defaults into the `connect` subcommand 2012-03-15 11:30:50 -07:00
examples Move the cucumber code out into it's own gem 2012-08-14 21:28:33 -07:00
gemfiles Make `rake spec:selenium:sauce` *run* inside the rails2-demo with Appraisal, but it doesn't pass 2012-05-24 20:14:27 -07:00
gems Move the cucumber code out into it's own gem 2012-08-14 21:28:33 -07:00
generators/sauce Whoops...got my logic inverted 2011-03-24 16:11:48 -07:00
lib Move the cucumber code out into it's own gem 2012-08-14 21:28:33 -07:00
spec Move the cucumber code out into it's own gem 2012-08-14 21:28:33 -07:00
support Prune the Selenium 1 server code and support for running selenium-server.jar locally 2012-03-20 02:47:00 -07:00
test Refactor test_job into an rspec test 2012-03-30 20:43:24 -07:00
.document
.gitignore Ignore some Rails cruft in the examples directory 2012-05-24 20:14:27 -07:00
Gemfile Add a couple of Rake tasks to support running Jasmine tests against Sauce Labs 2012-06-20 16:35:37 -07:00
LICENSE Updating copyright statement 2010-11-02 17:13:21 -07:00
README.markdown damnit, rtyler beat me to this one Revert "adding beehive badge to readme" 2012-06-26 16:47:39 -07:00
Rakefile Add support to building and releasing the peripheral gems 2012-08-11 16:23:32 -07:00
sauce.gemspec Add capybara to the "sauce core" dependency list 2012-08-11 16:23:32 -07:00

README.markdown

Sauce OnDemand for Ruby

Build Status

Sauce OnDemand is a Selenium-based browser testing service offered by Sauce Labs.

Installation

    % gem install sauce

Suggested Toolchain

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

You can read more about how to get started with Cucumber and Capybara on this wiki page.

Legacy Rails Integration

You can use either RSpec or Test::Unit with Rails and Sauce OnDemand. To get started, run the generator:

script/generate sauce USERNAME ACCESS_KEY

The generator will take care of setting up your helpers with Sauce OnDemand configuration, which you can tweak inside the Sauce.config block if necessary.

Example RSpec test for Rails

Here's an example test for RSpec. Drop something like this in spec/selenium/example.rb. (Because of the way RSpec categorizes tests, the "spec/selenium" directory tree is required for the integration to work properly):

require "spec_helper"

describe "my app" do
  it "should have a home page" do
    s.get 'http://localhost:3001/'
    assert s.page_source.include? 'Welcome aboard'
  end
end

Here's how you run RSpec tests with Sauce OnDemand using rake:

rake spec:selenium:sauce

Example Test::Unit test for Rails

Here's an example test for Test::Unit. Drop something like this in test/selenium/example_test.rb:

require "test_helper"

class DemoTest < Sauce::RailsTestCase
  test "my app", do
    s.get 'http://localhost:3001/'
    assert s.page_source.include? 'Welcome aboard'
  end
end

Here's how you run Test::Unit tests with Sauce OnDemand using rake:

rake test:selenium:sauce

Contributing to the Gem

  • Fork the project.
  • Make your feature addition or bug fix.
  • Please add RSpec tests for your changes, as we don't create a new release of the gem unless all tests are passing.
  • Commit
  • Send a pull request. Bonus points for topic branches.

Testing the Gem

Running the full test suite will require RVM

  • Set SAUCE_USERNAME and SAUCE_ACCESS_KEY in your environment to valid Sauce OnDemand credentials
  • bundle install
  • rake spec:unit # Will just run the unit tests
  • rake test # Will run all the tests and can be slow