sauce 3.3.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWYwMzk0OTAwOWExN2U1ZTVlYjY1ODA3ZmU5ZTZiNTQ5N2Q2ZDdkZQ==
4
+ NTZiMDJiMzI4ZGY5ZTU0MTA0Njc2YzI4MGI1NDRiM2Q1NGIyZTVjZg==
5
5
  data.tar.gz: !binary |-
6
- NmNiOTFiNmRlNDhlOTg5ZmVjM2ZkN2Q1YzZkZWIyZWQwZjFjZjkyZg==
7
- !binary "U0hBNTEy":
6
+ ZmU3MGI1YmU3OTU0MGY4YWY2MDY3OGYzYWVkOTMxYjVhMzAxOGFiNA==
7
+ SHA512:
8
8
  metadata.gz: !binary |-
9
- YzY5ODc2OTg0ZGZmYTYzZDI4Y2EwMDlmYTQzMjUxMmM2MTY2ODQ5MDU0MTk4
10
- ZjliNDZlNGQ1YWFjZTIzZGU3YTU4NTNlN2E1Y2ZjMDBiYWE5MWU5MGYzMjQ3
11
- YjNhZGE2Yzk5NDExYjkzMmNlY2I1ZWM0NWRhM2Q2ZjU4NWJmMTg=
9
+ MzYzNTAwN2YxNGMwMjAyNGQ5NzU0Njc3YzUwZmZjOGQ4Y2FjZWExZjJhODA3
10
+ MDM4NTlkMWE5ZmJhOTIwNjhhZTA4NWU2MTM4ZDkyZTE5OTA5NzJhOTFhOGFh
11
+ Y2IxMmYyYjI4NGJkZDVmMzYwMDdlODJlYzRiZDVjNWMxZTMyMDg=
12
12
  data.tar.gz: !binary |-
13
- ODVkZjc0NzQ2ZDk0NzViNWZhODQ5ZmYwM2E3MjMxMjQ1MGI2YmVlNmJlMDlh
14
- OGIzZjM3MWVlNjAxZWM2YWQ4OTdjOGFjMjhlMzJkZWQzODA0MWJjOTdkOTg1
15
- OWE0NjU2MzgwOTYyMjFmYTMwMmE0NGNlODllZWNjMDYzZGU5YTQ=
13
+ MWFmMjZjNWM1MGYxNTQxMzU2YjQyMzg0MjVhOTdhOTdjM2Y4YWUzYjBkODM1
14
+ NDI2OGJiMzdkZmZiMjcyMDcyNjA3OTFjYzEwMDdkMTI5NjFlMzFlOGVkZWIz
15
+ YzMxNDAwYTNmNTNmOTIxYzg0NjQ3NDAzMmVkMDU5MjZlYmJhNjI=
@@ -113,23 +113,6 @@ module Sauce
113
113
  def render(path)
114
114
  browser.save_screenshot path
115
115
  end
116
-
117
- # Overridden to deal with Capybara calling empty html file.
118
- # Stolen from (And can be removed when superceeded by the merge of)
119
- # https://github.com/jnicklas/capybara/pull/1215
120
- def reset!
121
- empty_html = "data:text/html,<html></html>"
122
- # Use instance variable directly so we avoid starting the browser just to reset the session
123
- if @browser
124
- begin @browser.manage.delete_all_cookies
125
- rescue Selenium::WebDriver::Error::UnhandledError
126
- # delete_all_cookies fails when we've previously gone
127
- # to about:blank, so we rescue this error and do nothing
128
- # instead.
129
- end
130
- @browser.navigate.to(empty_html)
131
- end
132
- end
133
116
  end
134
117
  end
135
118
  end
@@ -164,4 +147,4 @@ begin
164
147
  end
165
148
  rescue LoadError => e
166
149
  # User is not using RSpec
167
- end
150
+ end
data/lib/sauce/config.rb CHANGED
@@ -60,7 +60,8 @@ module Sauce
60
60
  }
61
61
 
62
62
  BROWSERS = {
63
- "iexplore" => "internet explorer"
63
+ "iexplore" => "internet explorer",
64
+ "ie" => "internet explorer"
64
65
  }
65
66
 
66
67
  SAUCE_OPTIONS = %w{record-video record-screenshots capture-html tags
@@ -104,6 +105,9 @@ module Sauce
104
105
  end
105
106
 
106
107
  def []=(key, value)
108
+ if(key == :browsers)
109
+ value = [value] unless value.first.instance_of?(Array)
110
+ end
107
111
  @undefaulted_opts.merge!({key => value})
108
112
  @opts[key] = value
109
113
  end
@@ -121,12 +125,12 @@ module Sauce
121
125
  warn "[DEPRECATED] This method (#{meth}) is deprecated, please use the [] and []= accessors instead"
122
126
  end
123
127
  if meth.to_s =~ /(.*)=$/
124
- @opts[$1.to_sym] = args[0]
128
+ self[$1.to_sym] = args[0]
125
129
  return args[0]
126
130
  elsif meth.to_s =~ /(.*)\?$/
127
- return @opts[$1.to_sym]
131
+ return self[$1.to_sym]
128
132
  else
129
- return @opts[meth]
133
+ return self[meth]
130
134
  end
131
135
  end
132
136
 
data/lib/sauce/rspec.rb CHANGED
@@ -84,6 +84,7 @@ begin
84
84
  :browser_version => version,
85
85
  :job_name => description})
86
86
  Sauce.driver_pool[Thread.current.object_id] = @selenium
87
+ example.metadata[:sauce_public_link] = SauceWhisk.public_link(@selenium.session_id)
87
88
 
88
89
  begin
89
90
  the_test.run
@@ -131,7 +132,7 @@ begin
131
132
  ::RSpec.configuration.after :suite do
132
133
  Sauce::Utilities::Connect.close
133
134
  if (defined? @@server) && @@server
134
- @@server.stop
135
+ @@server.stop
135
136
  end
136
137
  Sauce::Utilities.warn_if_suspect_misconfiguration
137
138
  end
@@ -142,4 +143,23 @@ rescue LoadError, TypeError
142
143
  # User doesn't have RSpec 2.x installed
143
144
  rescue => e
144
145
  STDERR.puts "Exception caught: #{e.to_s}"
145
- end
146
+ end
147
+
148
+ begin
149
+ require 'rspec/core/formatters/base_text_formatter'
150
+ module RSpec
151
+ module Core
152
+ module Formatters
153
+ class BaseTextFormatter
154
+ def dump_failure(example, index)
155
+ output.puts "#{short_padding}#{index.next}) #{example.full_description}"
156
+ puts "#{short_padding}Sauce public job link: #{example.metadata[:sauce_public_link]}"
157
+ dump_failure_info(example)
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end
163
+ rescue LoadError
164
+ # User isn't using RSpec
165
+ end
@@ -36,6 +36,10 @@ module Sauce
36
36
  end
37
37
  end
38
38
  end
39
+
40
+ class << self
41
+ attr_reader :tunnel
42
+ end
39
43
  end
40
44
  end
41
45
  end
data/lib/sauce/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Sauce
2
2
  MAJOR_VERSION = '3.3'
3
- PATCH_VERSION = '0'
3
+ PATCH_VERSION = '1'
4
4
 
5
5
  def version
6
6
  "#{MAJOR_VERSION}.#{PATCH_VERSION}"
@@ -5,15 +5,14 @@ require "parallel_tests/cli_patch"
5
5
 
6
6
 
7
7
  namespace :sauce do
8
- task :spec, :spec_files, :concurrency, :test_options, :parallel_options do |t, args|
8
+ task :spec, :files, :concurrency, :test_options, :parallel_options do |t, args|
9
9
  ::RSpec::Core::Runner.disable_autorun!
10
- parallel_arguments = parse_task_args(:rspec, args)
11
- ParallelTests::CLI.new.run(parallel_arguments)
10
+
11
+ run_parallel_tests(t, args, :rspec)
12
12
  end
13
13
 
14
14
  task :features, :files, :concurrency, :test_options, :parallel_options do |t, args|
15
- parallel_arguments = parse_task_args(:cucumber, args)
16
- ParallelTests::CLI.new.run(parallel_arguments)
15
+ run_parallel_tests(t, args, :cucumber)
17
16
  end
18
17
 
19
18
  namespace :install do
@@ -66,6 +65,21 @@ namespace :sauce do
66
65
  end
67
66
  end
68
67
 
68
+ def run_parallel_tests(t, args, command)
69
+ username = ENV["SAUCE_USERNAME"].to_s
70
+ access_key = ENV["SAUCE_ACCESS_KEY"].to_s
71
+ if(!username.empty? && !access_key.empty?)
72
+ parallel_arguments = parse_task_args(command, args)
73
+ ParallelTests::CLI.new.run(parallel_arguments)
74
+ else
75
+ puts <<-ENDLINE
76
+ Your Sauce username and/or access key are unavailable. Please:
77
+ 1. Set the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables.
78
+ 2. Rerun your tests.
79
+ ENDLINE
80
+ end
81
+ end
82
+
69
83
  def parse_task_args(test_tool=:rspec, args)
70
84
  default = {
71
85
  :concurrency => [Sauce::TestBroker.concurrency, 20].min
@@ -90,7 +104,7 @@ def parse_task_args(test_tool=:rspec, args)
90
104
 
91
105
  concurrency = args[:concurrency] || env_args[:concurrency] || default[:concurrency]
92
106
  test_options = args[:test_options] || env_args[:test_options] || default[:test_options]
93
- parallel_options = args[:parallel_options] || env_args[:parallel_options]
107
+ parallel_options = args[:parallel_options] || env_args[:parallel_options]
94
108
  files = args[:files] || env_args[:files] || default[:files]
95
109
 
96
110
  return_args = [
@@ -98,9 +112,9 @@ def parse_task_args(test_tool=:rspec, args)
98
112
  '--type'
99
113
  ]
100
114
 
101
- return_args.push 'saucerspec' if test_tool == :rspec
115
+ return_args.push 'saucerspec' if test_tool == :rspec
102
116
  return_args.push 'saucecucumber' if test_tool == :cucumber
103
-
117
+
104
118
  if test_options
105
119
  return_args.push '-o'
106
120
  return_args.push test_options
@@ -110,4 +124,4 @@ def parse_task_args(test_tool=:rspec, args)
110
124
  return_args.push files
111
125
 
112
126
  return return_args
113
- end
127
+ end
@@ -2,6 +2,8 @@ require "spec_helper"
2
2
 
3
3
  describe "Sauce::Config" do
4
4
  it "should start Connect when start_tunnel is set" do
5
- Sauce::RSpec::SeleniumExampleGroup.class_variable_defined?(:@@tunnel).should be_true
5
+ tunnel = Sauce::Utilities::Connect.tunnel
6
+ tunnel.should_not be_nil
7
+ tunnel.status.should eq "running"
6
8
  end
7
9
  end
@@ -61,6 +61,7 @@ module Sauce::Capybara
61
61
  let(:session_id) { 'deadbeef' }
62
62
  let(:driver) do
63
63
  driver = double('Sauce::Selenium2 Driver')
64
+ driver.stub(:finish!)
64
65
  driver.stub_chain(:browser, :quit)
65
66
  driver.stub_chain(:browser, :session_id).and_return(session_id)
66
67
  driver
@@ -71,6 +72,12 @@ module Sauce::Capybara
71
72
  Capybara.stub_chain(:current_session, :driver).and_return(driver)
72
73
  SauceWhisk::Job.stub(:new).and_return(nil)
73
74
  Sauce::Selenium2.stub(:new).with(anything).and_return Object.new
75
+ Sauce.config do |c|
76
+ c[:browsers] = [
77
+ ["OS X 10.8", "Safari", "6"],
78
+ ["Linux", "Chrome", nil]
79
+ ]
80
+ end
74
81
  end
75
82
 
76
83
  context 'with a scenario outline' do
@@ -92,7 +99,7 @@ module Sauce::Capybara
92
99
  """
93
100
  end
94
101
 
95
- it 'should have executed the scenario outline twice' do
102
+ it 'should have executed the scenario twice for each browser' do
96
103
  define_steps do
97
104
  Given /^a (\d+)$/ do |number|
98
105
  $ran_scenario = $ran_scenario + 1
@@ -109,7 +116,7 @@ module Sauce::Capybara
109
116
  end
110
117
 
111
118
  run_defined_feature feature
112
- $ran_scenario.should == 2
119
+ $ran_scenario.should eq 4 # 2 browsers, two examples
113
120
  end
114
121
 
115
122
  end
@@ -174,15 +181,15 @@ module Sauce::Capybara
174
181
  # Using this gnarly global just because it's easier to just use a
175
182
  # global than try to fish the scenario results back out of the
176
183
  # Cucumber bits
177
- $ran_scenario = nil
184
+ $ran_scenario = 0
178
185
  end
179
186
 
180
- it 'should have executed the feature once' do
187
+ it 'should have executed the feature once for each browser' do
181
188
  define_steps do
182
189
  Given /^a scenario$/ do
183
190
  end
184
191
  When /^I raise no exceptions$/ do
185
- $ran_scenario = true
192
+ $ran_scenario += 1
186
193
  end
187
194
  # Set up and invoke our defined Around hook
188
195
  Around('@selenium') do |scenario, block|
@@ -196,7 +203,7 @@ module Sauce::Capybara
196
203
  # Make sure we actually configure ourselves
197
204
  Sauce.should_receive(:config)
198
205
  run_defined_feature feature
199
- $ran_scenario.should be true
206
+ $ran_scenario.should eq 2 # Two browsers
200
207
  end
201
208
  end
202
209
  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.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Lacey
@@ -10,53 +10,54 @@ authors:
10
10
  - Santiago Suarez Ordoñez
11
11
  - Eric Allen
12
12
  - Sean Grove
13
+ - Isaac Murchie
13
14
  autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
- date: 2014-01-02 00:00:00.000000000 Z
17
+ date: 2014-02-05 00:00:00.000000000 Z
17
18
  dependencies:
18
19
  - !ruby/object:Gem::Dependency
19
- name: capybara
20
+ name: rspec
20
21
  requirement: !ruby/object:Gem::Requirement
21
22
  requirements:
22
23
  - - ~>
23
24
  - !ruby/object:Gem::Version
24
- version: 2.1.0
25
+ version: 2.14.0
25
26
  type: :development
26
27
  prerelease: false
27
28
  version_requirements: !ruby/object:Gem::Requirement
28
29
  requirements:
29
30
  - - ~>
30
31
  - !ruby/object:Gem::Version
31
- version: 2.1.0
32
+ version: 2.14.0
32
33
  - !ruby/object:Gem::Dependency
33
- name: rspec
34
+ name: simplecov
34
35
  requirement: !ruby/object:Gem::Requirement
35
36
  requirements:
36
- - - ~>
37
+ - - ! '>='
37
38
  - !ruby/object:Gem::Version
38
- version: 2.14.0
39
+ version: '0'
39
40
  type: :development
40
41
  prerelease: false
41
42
  version_requirements: !ruby/object:Gem::Requirement
42
43
  requirements:
43
- - - ~>
44
+ - - ! '>='
44
45
  - !ruby/object:Gem::Version
45
- version: 2.14.0
46
+ version: '0'
46
47
  - !ruby/object:Gem::Dependency
47
- name: simplecov
48
+ name: capybara
48
49
  requirement: !ruby/object:Gem::Requirement
49
50
  requirements:
50
51
  - - ! '>='
51
52
  - !ruby/object:Gem::Version
52
- version: '0'
53
+ version: 2.2.1
53
54
  type: :development
54
55
  prerelease: false
55
56
  version_requirements: !ruby/object:Gem::Requirement
56
57
  requirements:
57
58
  - - ! '>='
58
59
  - !ruby/object:Gem::Version
59
- version: '0'
60
+ version: 2.2.1
60
61
  - !ruby/object:Gem::Dependency
61
62
  name: net-http-persistent
62
63
  requirement: !ruby/object:Gem::Requirement
@@ -189,28 +190,28 @@ dependencies:
189
190
  requirements:
190
191
  - - '='
191
192
  - !ruby/object:Gem::Version
192
- version: 0.16.5
193
+ version: 0.16.6
193
194
  type: :runtime
194
195
  prerelease: false
195
196
  version_requirements: !ruby/object:Gem::Requirement
196
197
  requirements:
197
198
  - - '='
198
199
  - !ruby/object:Gem::Version
199
- version: 0.16.5
200
+ version: 0.16.6
200
201
  - !ruby/object:Gem::Dependency
201
202
  name: sauce_whisk
202
203
  requirement: !ruby/object:Gem::Requirement
203
204
  requirements:
204
205
  - - ~>
205
206
  - !ruby/object:Gem::Version
206
- version: 0.0.8
207
+ version: 0.0.11
207
208
  type: :runtime
208
209
  prerelease: false
209
210
  version_requirements: !ruby/object:Gem::Requirement
210
211
  requirements:
211
212
  - - ~>
212
213
  - !ruby/object:Gem::Version
213
- version: 0.0.8
214
+ version: 0.0.11
214
215
  description: A Ruby helper for running tests in Sauce Labs' browser testing cloud
215
216
  service
216
217
  email: help@saucelabs.com
@@ -219,30 +220,31 @@ executables:
219
220
  extensions: []
220
221
  extra_rdoc_files: []
221
222
  files:
223
+ - bin/sauce
222
224
  - lib/childprocess/process.rb
223
225
  - lib/generators/sauce/install/install_generator.rb
224
226
  - lib/parallel_tests/cli_patch.rb
225
227
  - lib/parallel_tests/saucecucumber/runner.rb
226
228
  - lib/parallel_tests/saucerspec/runner.rb
229
+ - lib/sauce.rb
227
230
  - lib/sauce/capybara.rb
228
231
  - lib/sauce/client.rb
229
232
  - lib/sauce/config.rb
230
233
  - lib/sauce/driver_pool.rb
231
234
  - lib/sauce/heroku.rb
232
235
  - lib/sauce/job.rb
236
+ - lib/sauce/parallel.rb
233
237
  - lib/sauce/parallel/test_broker.rb
234
238
  - lib/sauce/parallel/test_group.rb
235
- - lib/sauce/parallel.rb
236
239
  - lib/sauce/raketasks.rb
237
240
  - lib/sauce/rspec.rb
238
241
  - lib/sauce/selenium.rb
239
242
  - lib/sauce/test_unit.rb
243
+ - lib/sauce/utilities.rb
240
244
  - lib/sauce/utilities/connect.rb
241
245
  - lib/sauce/utilities/rails_server.rb
242
246
  - lib/sauce/utilities/rake.rb
243
- - lib/sauce/utilities.rb
244
247
  - lib/sauce/version.rb
245
- - lib/sauce.rb
246
248
  - lib/tasks/parallel_testing.rb
247
249
  - spec/cucumber_helper.rb
248
250
  - spec/integration/connect/spec/spec_helper.rb
@@ -275,9 +277,9 @@ files:
275
277
  - spec/sauce/utilities/utilities_spec.rb
276
278
  - spec/sauce_helper.rb
277
279
  - spec/spec_helper.rb
278
- - bin/sauce
279
280
  homepage: http://github.com/sauce-labs/sauce_ruby
280
- licenses: []
281
+ licenses:
282
+ - Apache 2.0
281
283
  metadata: {}
282
284
  post_install_message:
283
285
  rdoc_options: []
@@ -295,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
297
  version: '0'
296
298
  requirements: []
297
299
  rubyforge_project:
298
- rubygems_version: 2.0.3
300
+ rubygems_version: 2.2.1
299
301
  signing_key:
300
302
  specification_version: 4
301
303
  summary: A Ruby helper for running tests in Sauce Labs