sauce 0.17.6 → 0.17.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,7 +39,7 @@ require 'sauce'
39
39
  Sauce.config do |conf|
40
40
  conf.browser_url = "http://#{rand(100000)}.test/"
41
41
  conf.browsers = [
42
- ["Windows 2003", "firefox", "3."]
42
+ ["Windows 2003", "firefox", "3.6."]
43
43
  ]
44
44
  conf.application_host = "127.0.0.1"
45
45
  conf.application_port = "3001"
@@ -37,16 +37,17 @@ module Sauce
37
37
  def generate_config
38
38
  @random_id ||= rand(100000)
39
39
  return <<-CONFIG
40
- require 'sauce'
41
-
42
- Sauce.config do |conf|
43
- conf.browser_url = "http://#{@random_id}.test/"
44
- conf.browsers = [
45
- ["Windows 2003", "firefox", "3."]
46
- ]
47
- conf.application_host = "127.0.0.1"
48
- conf.application_port = "3001"
49
- end
40
+
41
+ require 'sauce'
42
+
43
+ Sauce.config do |conf|
44
+ conf.browser_url = "http://#{@random_id}.test/"
45
+ conf.browsers = [
46
+ ["Windows 2003", "firefox", "3.6."]
47
+ ]
48
+ conf.application_host = "127.0.0.1"
49
+ conf.application_port = "3001"
50
+ end
50
51
  CONFIG
51
52
  end
52
53
  end
data/lib/sauce/connect.rb CHANGED
@@ -16,7 +16,8 @@ module Sauce
16
16
  options.delete(:tunnel_port)
17
17
  config = Sauce::Config.new(options)
18
18
  args = ['-u', config.username, '-k', config.access_key, '-s', host, '-p', port, '-d', config.domain, '-t', tunnel_port]
19
- @pipe = IO.popen((["exec", "\"#{Sauce::Connect.find_sauce_connect}\""] + args).join(' '))
19
+ @pipe = IO.popen((["exec", "\"#{Sauce::Connect.find_sauce_connect}\""] + args + ["2>&1"]).join(' '))
20
+ @process_status = $?
20
21
  at_exit do
21
22
  Process.kill("INT", @pipe.pid)
22
23
  while @ready
@@ -34,7 +35,11 @@ module Sauce
34
35
  if line =~ /- (Problem.*)$/
35
36
  @error = $1
36
37
  end
37
- puts line unless options[:quiet]
38
+ if line =~ /== Missing requirements ==/
39
+ @error = "Missing requirements"
40
+ options[:quiet] = false
41
+ end
42
+ $stderr.puts line unless options[:quiet]
38
43
  end
39
44
  @ready = false
40
45
  }
@@ -42,10 +47,14 @@ module Sauce
42
47
 
43
48
  def wait_until_ready
44
49
  start = Time.now
45
- while !@ready and (Time.now-start) < TIMEOUT
50
+ while !@ready and (Time.now-start) < TIMEOUT and @error != "Missing requirements"
46
51
  sleep 0.4
47
52
  end
48
53
 
54
+ if @error == "Missing requirements"
55
+ raise "Missing requirements"
56
+ end
57
+
49
58
  if !@ready
50
59
  raise "Sauce Connect failed to connect after #{TIMEOUT} seconds"
51
60
  end
@@ -13,7 +13,10 @@ module Sauce
13
13
  class Selenium2
14
14
  def initialize(opts={})
15
15
  @config = Sauce::Config.new(opts)
16
- @driver = ::Selenium::WebDriver.for(:remote, :url => "http://#{@config.username}:#{@config.access_key}@#{@config.host}:#{@config.port}/wd/hub", :desired_capabilities => @config.to_desired_capabilities)
16
+ http_client = Selenium::WebDriver::Remote::Http::Default.new
17
+ http_client.timeout = 300 # Browser launch can take a while
18
+ @driver = ::Selenium::WebDriver.for(:remote, :url => "http://#{@config.username}:#{@config.access_key}@#{@config.host}:#{@config.port}/wd/hub", :desired_capabilities => @config.to_desired_capabilities, :http_client => http_client)
19
+ http_client.timeout = 90 # Once the browser is up, commands should time out reasonably
17
20
  end
18
21
 
19
22
  def method_missing(meth, *args)
data/sauce.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sauce}
5
- s.version = "0.17.6"
5
+ s.version = "0.17.7"
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"]
9
- s.date = %q{2011-02-25}
9
+ s.date = %q{2011-03-10}
10
10
  s.default_executable = %q{sauce}
11
11
  s.description = %q{A Ruby interface to Sauce Labs' services. Start/stop tunnels, retrieve Selenium logs, access video replays, etc.}
12
12
  s.email = %q{help@saucelabs.com}
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: 87
4
+ hash: 85
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 17
9
- - 6
10
- version: 0.17.6
9
+ - 7
10
+ version: 0.17.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Grove
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-02-25 00:00:00 -08:00
20
+ date: 2011-03-10 00:00:00 -08:00
21
21
  default_executable: sauce
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency