sauce 0.16.1 → 0.16.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,36 @@
1
+ require 'capybara'
2
+
3
+ module Sauce
4
+ module Capybara
5
+ class Driver < ::Capybara::Driver::Selenium
6
+ def browser
7
+ unless @browser
8
+ config = Sauce::Config.new
9
+ @sauce_tunnel = Sauce::Connect.new(:host => "127.0.0.1", :port => rack_server.port)
10
+ @sauce_tunnel.wait_until_ready
11
+ @browser = Sauce::Selenium2.new(:name => "Capybara")
12
+ at_exit do
13
+ @browser.quit
14
+ @sauce_tunnel.disconnect
15
+ end
16
+ end
17
+ @browser
18
+ end
19
+
20
+ private
21
+
22
+ def url(path)
23
+ if path =~ /^http/
24
+ path
25
+ else
26
+ config = Sauce::Config.new
27
+ config.browser_url + path.to_s
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+
34
+ Capybara.register_driver :sauce do |app|
35
+ Sauce::Capybara::Driver.new(app)
36
+ end
data/sauce.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sauce}
5
- s.version = "0.16.1"
5
+ s.version = "0.16.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Sean Grove", "Eric Allen", "Steven Hazel"]
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  "lib/generators/sauce/install/install_generator.rb",
32
32
  "lib/generators/sauce/install/templates/sauce.rake",
33
33
  "lib/sauce.rb",
34
+ "lib/sauce/capybara.rb",
34
35
  "lib/sauce/client.rb",
35
36
  "lib/sauce/config.rb",
36
37
  "lib/sauce/connect.rb",
@@ -55,7 +56,8 @@ Gem::Specification.new do |s|
55
56
  "test/helper.rb",
56
57
  "test/test_config.rb",
57
58
  "test/test_connect.rb",
58
- "test/test_selenium.rb"
59
+ "test/test_selenium.rb",
60
+ "test/test_selenium2.rb"
59
61
  ]
60
62
  s.homepage = %q{http://github.com/saucelabs/sauce}
61
63
  s.require_paths = ["lib"]
@@ -0,0 +1,9 @@
1
+ require File.expand_path("../helper", __FILE__)
2
+
3
+ class TestSelenium2 < Test::Unit::TestCase
4
+ def test_successful_connection_from_environment
5
+ selenium = Sauce::Selenium2.new(:job_name => "Sauce gem test suite: test_selenium2.rb")
6
+ selenium.navigate.to "http://www.example.com/"
7
+ selenium.quit
8
+ end
9
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce
3
3
  version: !ruby/object:Gem::Version
4
- hash: 93
4
+ hash: 91
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 16
9
- - 1
10
- version: 0.16.1
9
+ - 2
10
+ version: 0.16.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Grove
@@ -167,6 +167,7 @@ files:
167
167
  - lib/generators/sauce/install/install_generator.rb
168
168
  - lib/generators/sauce/install/templates/sauce.rake
169
169
  - lib/sauce.rb
170
+ - lib/sauce/capybara.rb
170
171
  - lib/sauce/client.rb
171
172
  - lib/sauce/config.rb
172
173
  - lib/sauce/connect.rb
@@ -192,6 +193,7 @@ files:
192
193
  - test/test_config.rb
193
194
  - test/test_connect.rb
194
195
  - test/test_selenium.rb
196
+ - test/test_selenium2.rb
195
197
  has_rdoc: true
196
198
  homepage: http://github.com/saucelabs/sauce
197
199
  licenses: []