sauce 0.17.3 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,10 +5,15 @@ module Sauce
5
5
  class Driver < ::Capybara::Driver::Selenium
6
6
  def browser
7
7
  unless @browser
8
+ puts "[Connecting to Sauce OnDemand...]"
8
9
  config = Sauce::Config.new
9
- @sauce_tunnel = Sauce::Connect.new(:host => "127.0.0.1", :port => rack_server.port)
10
+ @domain = "#{rand(10000)}.test"
11
+ @sauce_tunnel = Sauce::Connect.new(:host => "127.0.0.1",
12
+ :port => rack_server.port,
13
+ :domain => @domain,
14
+ :quiet => true)
10
15
  @sauce_tunnel.wait_until_ready
11
- @browser = Sauce::Selenium2.new(:name => "Capybara")
16
+ @browser = Sauce::Selenium2.new(:name => "Capybara", :browser_url => "http://#{@domain}")
12
17
  at_exit do
13
18
  @browser.quit
14
19
  @sauce_tunnel.disconnect
@@ -23,8 +28,7 @@ module Sauce
23
28
  if path =~ /^http/
24
29
  path
25
30
  else
26
- config = Sauce::Config.new
27
- config.browser_url + path.to_s
31
+ "http://#{@domain}#{path}"
28
32
  end
29
33
  end
30
34
  end
@@ -34,3 +38,11 @@ end
34
38
  Capybara.register_driver :sauce do |app|
35
39
  Sauce::Capybara::Driver.new(app)
36
40
  end
41
+
42
+ # Switch Cucumber stories tagged with @selenium to use sauce
43
+ begin
44
+ Before("@selenium") do
45
+ Capybara.current_driver = :sauce
46
+ end
47
+ rescue NoMethodError
48
+ end
@@ -88,7 +88,7 @@ module Sauce
88
88
  def to_desired_capabilities
89
89
  {
90
90
  :browserName => BROWSERS[browser] || browser,
91
- :browserVersion => browser_version,
91
+ :version => browser_version,
92
92
  :platform => PLATFORMS[os] || os,
93
93
  :name => @opts[:job_name]
94
94
  }.update(@opts.reject {|k, v| [:browser, :browser_version, :os, :job_name].include? k})
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sauce}
5
- s.version = "0.17.3"
5
+ s.version = "0.17.4"
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"]
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: 83
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 17
9
- - 3
10
- version: 0.17.3
9
+ - 4
10
+ version: 0.17.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Grove