sauce 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2U0MmM0ZDc3ZDU3ZjIyYTlkYzQ4MzAyM2YxMzgzNmI2MWZjZGZmOA==
4
+ N2JjYzUwNDFiY2E4NDk2ZWY3ODY2MjliMzE4YzUyMDlmYzA0Yzc1ZQ==
5
5
  data.tar.gz: !binary |-
6
- ZDAyMzRiOWZkZDVlYjQzOTE1NmM0YWZhODMxYzFiYTYyNDY3YWRiOA==
6
+ N2Q2OTJlZTM3ODIzMjU2ZTM3ZGIzOWNiYmU5NTVlYWI0NDI0NTg0ZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjA4MGU4ZWU5MGEwZmZkOWI2YmNmMjQ5YjZlYTVlZjhmZTMxMDY3M2NjZGI5
10
- NDA2YjNlOTA5NWZmYTFmM2NhZjJlOTdkY2ViOTk4YTRmMmU3NDhjMDBkYWU5
11
- MDU2M2Q3MzUwMjNjZGVjNzZiNzc2ZDRlZWViMjViMTI3MzhiMTQ=
9
+ ZGMyODQ0YWZmZmE5NDA2Nzk2Y2QwY2MwZWFmZDM5MWE5NDNkMjY3MDhkMTNk
10
+ YjAwZGExMDRkZWE0NTBkZjFlNTkwZDRhNTk3ZTgwNTEzMzBiNzUyZGU0MjE3
11
+ NzIzMDkwNjgxZGRlZGUxY2ViM2FiMTM5NDA4OTU0OTZkOGI0ZWE=
12
12
  data.tar.gz: !binary |-
13
- NDA2ZmFmMTE3ZmFjZTU0ZGFhNDdmMTYzYjRjMTdlNTMwNzFmZTJhMDY5ZjQ4
14
- MTcxODlkNzM5YTdjNDRkYTM4YTczYWRlMjYwODY5MjJjODEzNWE1NzFkNTJh
15
- NTg1ZDVhNDhkZmVkMzBjNzBiYmZhYzI0NzYxN2ExZTgxYmRkYTg=
13
+ Zjg5Mjk4Zjg4YjhkYjVjOTU1ZTE3MWU1NjM5MWNhY2I2ZDRkOWQxMWEyYWIw
14
+ Nzc1NTkyZTkwNWEyOTkwZGQxM2VhM2MxZTBhMGNjNjRiMmIzZmUwOGU5ZDhi
15
+ Y2JjYjZmZDBmZGIyNWY3NzkyZDMxN2EwNGQzOTg5YWQxZTE3YmQ=
@@ -119,7 +119,7 @@ module Sauce
119
119
  end
120
120
 
121
121
  Capybara.register_driver :sauce do |app|
122
- Sauce::Capybara::Driver.new(app)
122
+ driver = Sauce::Capybara::Driver.new(app)
123
123
  end
124
124
 
125
125
  # Monkeypatch Capybara to not use :selenium driver
@@ -66,7 +66,7 @@ module Sauce
66
66
  sauce-advisor single-window user-extensions-url firefox-profile-url
67
67
  max-duration idle-timeout build custom-data tunnel-identifier
68
68
  selenium-version command-timeout prerun prerun-args screen-resolution
69
- disable-popup-handler avoid-proxy public}
69
+ disable-popup-handler avoid-proxy public name}
70
70
 
71
71
  def self.get_application_port
72
72
  port_index = ENV["TEST_ENV_NUMBER"].to_i
@@ -83,7 +83,7 @@ module Sauce
83
83
 
84
84
  @undefaulted_opts.merge! load_options_from_yaml
85
85
  @undefaulted_opts.merge! load_options_from_environment
86
- @undefaulted_opts.merge! load_options_from_heroku
86
+ @undefaulted_opts.merge! load_options_from_heroku unless ENV["SAUCE_DISABLE_HEROKU_CONFIG"]
87
87
  @undefaulted_opts.merge! Sauce.get_config.opts rescue {}
88
88
  @undefaulted_opts.merge! opts
89
89
  @opts.merge! @undefaulted_opts
@@ -143,7 +143,7 @@ module Sauce
143
143
  :browserName => BROWSERS[browser] || browser,
144
144
  :version => browser_version,
145
145
  :platform => PLATFORMS[os] || os,
146
- :name => @opts[:job_name],
146
+ :name =>@opts[:job_name],
147
147
  :client_version => client_version
148
148
  }
149
149
 
@@ -35,6 +35,11 @@ module Sauce
35
35
  :desired_capabilities => @config.to_desired_capabilities,
36
36
  :http_client => http_client)
37
37
  http_client.timeout = 90 # Once the browser is up, commands should time out reasonably
38
+
39
+ @driver.file_detector = lambda do |args|
40
+ file_path = args.first.to_s
41
+ File.exist?(file_path) ? file_path : false
42
+ end
38
43
  end
39
44
 
40
45
  def method_missing(meth, *args)
@@ -89,8 +89,8 @@ if defined?(ActiveSupport::TestCase)
89
89
  end
90
90
 
91
91
  begin
92
- if Object.const_defined? "Test"
93
- if Test.const_defined? "Unit"
92
+ if Object.const_defined? :Test
93
+ if Test.const_defined? :Unit
94
94
  require 'test/unit/testcase'
95
95
  module Sauce
96
96
  class TestCase < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  module Sauce
2
2
  MAJOR_VERSION = '3.1'
3
- PATCH_VERSION = '2'
3
+ PATCH_VERSION = '3'
4
4
 
5
5
  def version
6
6
  "#{MAJOR_VERSION}.#{PATCH_VERSION}"
@@ -203,6 +203,14 @@ describe Sauce::Config do
203
203
  end
204
204
  end
205
205
 
206
+ context 'with a :name set' do
207
+ subject do
208
+ Sauce::Config.new(:name => 'As Sweet').to_desired_capabilities[:name]
209
+ end
210
+
211
+ it {should eq "As Sweet"}
212
+ end
213
+
206
214
  context 'platforms' do
207
215
  it 'should refer to Windows 2003 as WINDOWS' do
208
216
  config = Sauce::Config.new(:os => "Windows 2003")
@@ -0,0 +1,15 @@
1
+ require "spec_helper"
2
+
3
+ describe Sauce::Selenium2 do
4
+ describe "#file_detector" do
5
+ it "should return the path of files when they exist" do
6
+ Selenium::WebDriver::Remote::Bridge.any_instance.stub(:create_session).and_return({})
7
+
8
+ path = __FILE__
9
+
10
+ client = Sauce::Selenium2.new()
11
+ bridge = client.driver.instance_variable_get(:@bridge)
12
+ bridge.file_detector.call([path]).should eq path
13
+ end
14
+ end
15
+ end
@@ -1,56 +1,59 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe Sauce::Selenium2 do
4
- let(:mock_driver) { Hash.new }
4
+ describe "itself" do
5
5
 
6
- before :each do
7
- ::Selenium::WebDriver.should_receive(:for).and_return(mock_driver)
8
- end
9
-
10
- describe '#initialize' do
11
- it 'should work without arguments' do
12
- client = Sauce::Selenium2.new
13
- client.should_not be nil
6
+ before :each do
7
+ mock_driver = double(::Selenium::WebDriver::Driver)
8
+ mock_driver.stub(:file_detector=)
9
+ ::Selenium::WebDriver.should_receive(:for).and_return(mock_driver)
14
10
  end
15
11
 
16
- it 'should pass the job_name argument into the config' do
17
- expected = 'Dummy Job Name'
18
- client = Sauce::Selenium2.new(:job_name => expected)
19
- client.config[:job_name].should == expected
12
+ describe '#initialize' do
13
+ it 'should work without arguments' do
14
+ client = Sauce::Selenium2.new
15
+ client.should_not be nil
16
+ end
17
+
18
+ it 'should pass the job_name argument into the config' do
19
+ expected = 'Dummy Job Name'
20
+ client = Sauce::Selenium2.new(:job_name => expected)
21
+ client.config[:job_name].should == expected
22
+ end
20
23
  end
21
- end
22
24
 
23
25
 
24
- context 'with an initialized object' do
25
- before :each do
26
- @client = Sauce::Selenium2.new
27
- end
26
+ context 'with an initialized object' do
27
+ before :each do
28
+ @client = Sauce::Selenium2.new
29
+ end
28
30
 
29
- describe '#stop' do
30
- it 'should call quit on the driver' do
31
- @client.driver.should_receive(:quit).and_return(true)
32
- @client.stop
31
+ describe '#stop' do
32
+ it 'should call quit on the driver' do
33
+ @client.driver.should_receive(:quit).and_return(true)
34
+ @client.stop
35
+ end
33
36
  end
34
- end
35
37
 
36
- describe '#session_id' do
37
- it 'should query the driver for the session_id' do
38
- expected = 101
39
- bridge = double('bridge')
40
- bridge.should_receive(:session_id).and_return(expected)
41
- @client.driver.should_receive(:bridge).and_return(bridge)
42
- @client.session_id.should == expected
38
+ describe '#session_id' do
39
+ it 'should query the driver for the session_id' do
40
+ expected = 101
41
+ bridge = double('bridge')
42
+ bridge.should_receive(:session_id).and_return(expected)
43
+ @client.driver.should_receive(:bridge).and_return(bridge)
44
+ @client.session_id.should == expected
45
+ end
43
46
  end
44
- end
45
47
 
46
- describe '#method_missing' do
47
- it 'should pass #navigate#to onto the driver' do
48
- url = 'http://example.com'
49
- navigator = double('navigator')
50
- navigator.should_receive(:to).with(url).and_return(true)
51
- @client.driver.should_receive(:navigate).and_return(navigator)
48
+ describe '#method_missing' do
49
+ it 'should pass #navigate#to onto the driver' do
50
+ url = 'http://example.com'
51
+ navigator = double('navigator')
52
+ navigator.should_receive(:to).with(url).and_return(true)
53
+ @client.driver.should_receive(:navigate).and_return(navigator)
52
54
 
53
- @client.navigate.to url
55
+ @client.navigate.to url
56
+ end
54
57
  end
55
58
  end
56
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Lacey
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-08-09 00:00:00.000000000 Z
16
+ date: 2013-08-13 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: capybara
@@ -264,6 +264,7 @@ files:
264
264
  - spec/sauce/config/load_defaults_spec.rb
265
265
  - spec/sauce/cucumber_spec.rb
266
266
  - spec/sauce/driver_pool_spec.rb
267
+ - spec/sauce/file_detector_spec.rb
267
268
  - spec/sauce/jasmine_spec.rb
268
269
  - spec/sauce/parallel/test_broker_spec.rb
269
270
  - spec/sauce/selenium_spec.rb
@@ -317,6 +318,7 @@ test_files:
317
318
  - spec/sauce/config/load_defaults_spec.rb
318
319
  - spec/sauce/cucumber_spec.rb
319
320
  - spec/sauce/driver_pool_spec.rb
321
+ - spec/sauce/file_detector_spec.rb
320
322
  - spec/sauce/jasmine_spec.rb
321
323
  - spec/sauce/parallel/test_broker_spec.rb
322
324
  - spec/sauce/selenium_spec.rb