Skip to content
This repository
Browse code

Update the README to prune some out-dated suggestions

  • Loading branch information...
commit be420e7c8c7a0a17b4afc7ea216ab769712144f5 1 parent 925ec4c
R. Tyler Croy authored June 10, 2012

Showing 1 changed file with 38 additions and 144 deletions. Show diff stats Hide diff stats

  1. 182  README.markdown
182  README.markdown
Source Rendered
... ...
@@ -1,20 +1,30 @@
1  
-Sauce OnDemand is a Selenium testing cloud service, developed by Sauce Labs Inc
2  
-(saucelabs.com). This is the Ruby client adapter for Sauce OnDemand.
  1
+# Sauce OnDemand for Ruby
3 2
 
4  
-Features
5  
---------
  3
+Sauce OnDemand is a Selenium-based browser testing service offered by [Sauce
  4
+Labs](https://www.saucelabs.com).
6 5
 
7  
-*   Drop-in replacement for Selenium::Client::Driver that takes care of connecting to Sauce OnDemand
8  
-*   RSpec, Test::Unit, and Rails integration for tests, including automatic setup of Sauce Connect
9  
-*   ActiveRecord-like interface for job metadata: Find/create/destroy
10 6
 
11  
-Install
12  
--------
  7
+## Installation
13 8
 
14  
-`gem install sauce`
  9
+```bash
  10
+    % gem install sauce
  11
+```
15 12
 
16  
-Rails Integration
17  
--------
  13
+
  14
+## Suggested Toolchain
  15
+
  16
+
  17
+The Sauce gem has been optimized to work most effectively with
  18
+[Cucumber](https://www.cukes.info) and
  19
+[Capybara](http://jnicklas.github.com/capybara/).
  20
+
  21
+You can read more about how to get started with [Cucumber and Capybara on this
  22
+wiki
  23
+page](https://github.com/saucelabs/sauce\_ruby/wiki/Cucumber-and-Capybara).
  24
+
  25
+
  26
+
  27
+## Legacy Rails Integration
18 28
 
19 29
 You can use either RSpec or Test::Unit with Rails and Sauce OnDemand.  To get started, run the generator:
20 30
 
@@ -28,11 +38,11 @@ configuration, which you can tweak inside the `Sauce.config` block if necessary.
28 38
 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):
29 39
 
30 40
     require "spec_helper"
31  
-    
  41
+
32 42
     describe "my app" do
33 43
       it "should have a home page" do
34  
-        page.open "/"
35  
-        page.is_text_present("Welcome Aboard").should be_true
  44
+        s.get 'http://localhost:3001/'
  45
+        assert s.page_source.include? 'Welcome aboard'
36 46
       end
37 47
     end
38 48
 
@@ -45,11 +55,11 @@ Here's how you run RSpec tests with Sauce OnDemand using rake:
45 55
 Here's an example test for Test::Unit.  Drop something like this in test/selenium/example\_test.rb:
46 56
 
47 57
     require "test_helper"
48  
-    
  58
+
49 59
     class DemoTest < Sauce::RailsTestCase
50 60
       test "my app", do
51  
-        page.open "/"
52  
-        assert page.is_text_present('Welcome aboard')
  61
+        s.get 'http://localhost:3001/'
  62
+        assert s.page_source.include? 'Welcome aboard'
53 63
       end
54 64
     end
55 65
 
@@ -57,138 +67,22 @@ Here's how you run Test::Unit tests with Sauce OnDemand using rake:
57 67
 
58 68
 `rake test:selenium:sauce`
59 69
 
60  
-RSpec integration without Rails
61  
--------------------------------
62  
-
63  
-First, configure with your account info:
64  
-
65  
-`sauce config USERNAME ACCESS_KEY`
66  
-
67  
-And here's an example test.  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):
68  
-
69  
-    #!/usr/bin/env ruby
70  
-    #
71  
-    # Sample RSpec test case using the Sauce gem
72  
-    #
73  
-    require "rubygems"
74  
-    require "sauce"
75  
-    
76  
-    # This should go in your spec_helper.rb file if you have one
77  
-    Sauce.config do |config|
78  
-      config.browser_url = "http://saucelabs.com/"
79  
-      config.browsers = [
80  
-        ["Linux", "firefox", "3.6."]
81  
-      ]
82  
-    
83  
-      # uncomment this if your server is not publicly accessible
84  
-      #config.application_host = "localhost"
85  
-      #config.application_port = "80"
86  
-    end
87  
-    
88  
-    # If this goes in spec/selenium/foo_spec.rb, you can omit the :type parameter
89  
-    describe "The Sauce Labs website", :type => :selenium do
90  
-      it "should have a home page" do
91  
-        page.open "/"
92  
-        page.is_text_present("Sauce Labs").should be_true
93  
-      end
94  
-    
95  
-      it "should have a pricing page" do
96  
-        page.open "/"
97  
-        page.click "link=Pricing"
98  
-        page.wait_for_page_to_load 30000
99  
-        page.is_text_present("Free Trial").should be_true
100  
-      end
101  
-    end
102 70
 
103  
-Test::Unit integration without Rails
104  
-------------------------------------
105  
-
106  
-First, configure with your account info:
107  
-
108  
-`sauce config USERNAME ACCESS_KEY`
109  
-
110  
-And here's an example test:
111  
-
112  
-    #!/usr/bin/env ruby
113  
-    #
114  
-    # Sample Test:Unit test case using the Sauce gem
115  
-    #
116  
-    require "test/unit"
117  
-    require "rubygems"
118  
-    require "sauce"
119  
-    
120  
-    # This should go in your test_helper.rb file if you have one
121  
-    Sauce.config do |config|
122  
-      config.browser_url = "http://saucelabs.com/"
123  
-      config.browsers = [
124  
-        ["Linux", "firefox", "3.6."]
125  
-      ]
126  
-    
127  
-      # uncomment this if your server is not publicly accessible
128  
-      #config.application_host = "localhost"
129  
-      #config.application_port = "80"
130  
-    end
131  
-    
132  
-    class ExampleTest < Sauce::TestCase
133  
-        def test_sauce
134  
-            page.open "/"
135  
-            assert page.title.include?("Sauce Labs")
136  
-        end
137  
-    end
138  
-
139  
-Direct use of the Selenium Client driver
140  
-----------------------------------------
141  
-
142  
-First, configure with your account info:
143  
-
144  
-`sauce config USERNAME ACCESS_KEY`
145  
-
146  
-And here's an example test:
147  
-
148  
-    require 'rubygems'
149  
-    require 'sauce'
150  
-    selenium = Sauce::Selenium.new(:browser_url => "http://saucelabs.com",
151  
-        :browser => "firefox", :browser_version => "3.", :os => "Windows 2003",
152  
-        :job_name => "My first test!")
153  
-    selenium.start
154  
-    selenium.open "/"
155  
-    selenium.stop
  71
+### Contributing to the Gem
156 72
 
157  
-Note on Patches/Pull Requests
158  
------------------------------ 
  73
+*  Fork the project.
  74
+*  Make your feature addition or bug fix.
  75
+*  Please add RSpec tests for your changes, as we don't create a new release of the gem unless all tests are passing.
  76
+*  Commit
  77
+*  Send a pull request. Bonus points for topic branches.
159 78
 
160  
-*   Fork the project.
161  
-*   Make your feature addition or bug fix.
162  
-*   Add tests for it. This is important so we don't break it in a future version unintentionally.
163  
-*   Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
164  
-*   Send me a pull request. Bonus points for topic branches.
165 79
 
166  
-Testing the Gem
167  
----------------
  80
+### Testing the Gem
168 81
 
169  
-The tests in test/ need a bit of setup to get running:
  82
+Running the full test suite will require [RVM](http://rvm.beginrescueend.com)
170 83
 
171  
-if you're on Ubuntu:
172  
-
173  
-* sudo aptitude install expect libsqlite3-dev
174  
-
175  
-For all platforms:
176  
-
177  
-* Install RVM: bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
178  
-* If you're in a headless environment, set SAUCE_TEST_NO_LOCAL=y in your environment
179 84
 * Set SAUCE_USERNAME and SAUCE_ACCESS_KEY in your environment to valid Sauce OnDemand credentials
180 85
 * bundle install
181  
-* rake test
182  
-
183  
-If you want tests to go a bit faster, globally install the gems with native extensions:
184  
-
185  
-* rvm use 1.8.7@global
186  
-* gem install ffi sqlite3 json
187  
-* rvm use 1.9.2@global
188  
-* gem install ffi sqlite3 json
189  
-* rvm use default
190  
-
191  
-Copyright
192  
----------
  86
+* rake spec:unit # Will just run the unit tests
  87
+* rake test      # Will run *all* the tests and can be slow
193 88
 
194  
-Copyright (c) 2009-2011 Sauce Labs Inc. See LICENSE for details.

0 notes on commit be420e7

Please sign in to comment.
Something went wrong with that request. Please try again.