sauce 0.17.8 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -165,8 +165,10 @@ module Sauce
165
165
  @browser = Sauce.cached_session(:host => "127.0.0.1", :port => 4444, :browser => "*" +
166
166
  browser, :url => "http://127.0.0.1:#{config.local_application_port}/")
167
167
  else
168
- @browser = Sauce.cached_session({:os => os, :browser => browser, :browser_version => version,
169
- :job_name => "#{Rails.root.split[1].to_s} test suite"})
168
+ options = self.class.sauce_config
169
+ options.merge!({:os => os, :browser => browser, :browser_version => version,
170
+ :job_name => "#{Rails.root.split[1].to_s} test suite"})
171
+ @browser = Sauce.cached_session(options)
170
172
  end
171
173
  super(*args, &blk)
172
174
  else
@@ -176,10 +178,16 @@ module Sauce
176
178
  :browser => "*" + browser,
177
179
  :url => "http://127.0.0.1:#{config.local_application_port}/")
178
180
  else
179
- @browser = Sauce::Selenium.new({:os => os, :browser => browser, :browser_version => version,
181
+ options = self.class.sauce_config
182
+ options.merge!({:os => os, :browser => browser, :browser_version => version,
180
183
  :job_name => "#{my_name}"})
184
+ @browser = Sauce::Selenium.new(options)
185
+ end
186
+ if self.class.selenium_flags
187
+ @browser.start_new_browser_session(self.class.selenium_flags)
188
+ else
189
+ @browser.start_new_browser_session
181
190
  end
182
- @browser.start
183
191
  super(*args, &blk)
184
192
  @browser.stop
185
193
  end
@@ -189,10 +197,31 @@ module Sauce
189
197
  end
190
198
  end
191
199
 
200
+ module Sauce
201
+ module SeleniumForTestUnitClassMethods
202
+ def selenium_flags=(options)
203
+ @selenium_flags = options
204
+ end
205
+
206
+ def selenium_flags
207
+ return @selenium_flags
208
+ end
209
+
210
+ def sauce_config=(config)
211
+ @sauce_config = config
212
+ end
213
+
214
+ def sauce_config
215
+ @sauce_config || {}
216
+ end
217
+ end
218
+ end
219
+
192
220
  if defined?(ActiveSupport::TestCase)
193
221
  module Sauce
194
222
  class RailsTestCase < ::ActiveSupport::TestCase
195
223
  include SeleniumForTestUnit
224
+ extend SeleniumForTestUnitClassMethods
196
225
 
197
226
  # Placeholder so test/unit ignores test cases without any tests.
198
227
  def default_test
@@ -206,6 +235,7 @@ begin
206
235
  module Sauce
207
236
  class TestCase < Test::Unit::TestCase
208
237
  include SeleniumForTestUnit
238
+ extend SeleniumForTestUnitClassMethods
209
239
 
210
240
  # Placeholder so test/unit ignores test cases without any tests.
211
241
  def default_test
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sauce}
5
- s.version = "0.17.8"
5
+ s.version = "0.18.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Eric Allen", "Sean Grove", "Steven Hazel"]
9
- s.date = %q{2011-03-21}
9
+ s.date = %q{2011-03-22}
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}
@@ -12,7 +12,7 @@ include Sauce::Utilities
12
12
  Sauce.config do |config|
13
13
  config.browsers = [
14
14
  ["Windows 2003", "firefox", "3.6."],
15
- ["Windows 2003", "safariproxy", "5."]
15
+ ["Windows 2003", "iexplore", "8."]
16
16
  ]
17
17
  config.browser_url = "http://saucelabs.com"
18
18
 
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: 75
4
+ hash: 87
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 17
9
- - 8
10
- version: 0.17.8
8
+ - 18
9
+ - 0
10
+ version: 0.18.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Allen
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-03-21 00:00:00 -07:00
20
+ date: 2011-03-22 00:00:00 -07:00
21
21
  default_executable: sauce
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency