sauce 2.3.6 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,6 +92,23 @@ begin
92
92
  ::RSpec.configuration.include(self, :example_group => {
93
93
  :file_path => Regexp.compile('spec[\\\/]selenium')
94
94
  })
95
+ ::RSpec.configuration.include(self, :sauce => true)
96
+
97
+ ::RSpec.configuration.before(:suite, sauce: true) do
98
+
99
+ config = Sauce::Config.new
100
+ if config[:application_host]
101
+ @@tunnel ||= Sauce::Connect.new(:host => config.application_host, :port => config.application_port || 80)
102
+ @@tunnel.connect
103
+ @@tunnel.wait_until_ready
104
+ end
105
+
106
+ if Sauce::Utilities::RailsServer.is_rails_app?
107
+ @@server = Sauce::Utilities::RailsServer.new
108
+ @@server.start
109
+ end
110
+ end
111
+
95
112
  ::RSpec.configuration.before :suite do
96
113
  need_tunnel = false
97
114
  config = Sauce::Config.new
@@ -101,7 +118,7 @@ begin
101
118
  need_tunnel = files_to_run.any? {|file| file =~ /spec\/selenium\//}
102
119
  end
103
120
  if need_tunnel
104
- @@tunnel = Sauce::Connect.new(:host => config.application_host, :port => config.application_port || 80)
121
+ @@tunnel ||= Sauce::Connect.new(:host => config.application_host, :port => config.application_port || 80)
105
122
  @@tunnel.connect
106
123
  @@tunnel.wait_until_ready
107
124
  end
@@ -5,6 +5,22 @@ require "selenium/webdriver"
5
5
 
6
6
  require 'selenium/webdriver/remote/http/persistent'
7
7
 
8
+ module Selenium
9
+ module WebDriver
10
+ class Proxy
11
+ class << self
12
+ alias :existing_json_create :json_create
13
+
14
+ def json_create(data)
15
+ dup = data.dup.delete_if {|k,v| v.nil?}
16
+ dup.delete_if {|k,v| k == "autodetect" && v == false}
17
+ existing_json_create(dup)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
8
24
 
9
25
  module Sauce
10
26
  class Selenium2
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Sauce
3
- MAJOR_VERSION = '2.3'
3
+ MAJOR_VERSION = '2.4'
4
4
  end
@@ -1,11 +1,14 @@
1
1
  require "spec_helper"
2
2
  require "sauce"
3
+ require "sauce/connect"
3
4
 
4
5
  Sauce.config do |c|
5
6
  c.browsers = [
6
7
  ["Windows 2008", "iexplore", "9"],
7
8
  ["Linux", "opera", 12]
8
9
  ]
10
+
11
+ c[:application_host] = "localhost"
9
12
  end
10
13
 
11
14
  describe "Specs in the Selenium Directory" do
@@ -21,4 +24,23 @@ describe "Specs in the Selenium Directory" do
21
24
  it "should get run on every defined browser" do
22
25
  $EXECUTIONS += 1
23
26
  end
27
+
28
+ it "should be using Sauce Connect" do
29
+ Sauce::RSpec::SeleniumExampleGroup.class_variable_defined?(:@@tunnel).should be_true
30
+ end
31
+ end
32
+
33
+ describe "Specs in the Selenium Directory with the sauce tag", :sauce => true do
34
+
35
+ before :all do
36
+ $EXECUTIONS = 0
37
+ end
38
+
39
+ after :all do
40
+ $EXECUTIONS.should be 2
41
+ end
42
+
43
+ it "should get run on every defined browser" do
44
+ $EXECUTIONS += 1
45
+ end
24
46
  end
@@ -0,0 +1,44 @@
1
+ require "spec_helper"
2
+ require "sauce"
3
+ require "sauce/connect"
4
+
5
+ Sauce.config do |c|
6
+ c.browsers = [
7
+ ["Windows 2008", "iexplore", "9"],
8
+ ["Linux", "opera", 12]
9
+ ]
10
+ c[:application_host] = "localhost"
11
+ end
12
+
13
+ describe "Specs with the @sauce tag", :sauce => true do
14
+
15
+ before :all do
16
+ $TAGGED_EXECUTIONS = 0
17
+ end
18
+
19
+ after :all do
20
+ $TAGGED_EXECUTIONS.should eq 2
21
+ end
22
+
23
+ it "should get run on every defined browser" do
24
+ $TAGGED_EXECUTIONS += 1
25
+ end
26
+
27
+ it "should be using Sauce Connect" do
28
+ Sauce::RSpec::SeleniumExampleGroup.class_variable_defined?(:@@tunnel).should be_true
29
+ end
30
+ end
31
+
32
+ describe "Specs without the @sauce tag" do
33
+ before :all do
34
+ $UNTAGGED_EXECUTIONS = 0
35
+ end
36
+
37
+ after :all do
38
+ $UNTAGGED_EXECUTIONS.should eq 1
39
+ end
40
+
41
+ it "should only run once" do
42
+ $UNTAGGED_EXECUTIONS += 1
43
+ end
44
+ 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: 2.3.6
4
+ version: 2.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2013-04-03 00:00:00.000000000 Z
17
+ date: 2013-04-11 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: net-http-persistent
@@ -187,6 +187,7 @@ files:
187
187
  - spec/integration/rspec/spec/selenium/selenium_directory_spec.rb
188
188
  - spec/integration/rspec/spec/selenium/selenium_with_capybara_spec.rb
189
189
  - spec/integration/rspec/spec/spec_helper.rb
190
+ - spec/integration/rspec/spec/tagging/selenium_tagging_spec.rb
190
191
  - spec/sauce/capybara_spec.rb
191
192
  - spec/sauce/config_spec.rb
192
193
  - spec/sauce/cucumber_spec.rb
@@ -209,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
210
  version: '0'
210
211
  segments:
211
212
  - 0
212
- hash: -4220587224725148090
213
+ hash: -3397943602481883136
213
214
  required_rubygems_version: !ruby/object:Gem::Requirement
214
215
  none: false
215
216
  requirements:
@@ -218,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
219
  version: '0'
219
220
  segments:
220
221
  - 0
221
- hash: -4220587224725148090
222
+ hash: -3397943602481883136
222
223
  requirements: []
223
224
  rubyforge_project:
224
225
  rubygems_version: 1.8.25
@@ -231,6 +232,7 @@ test_files:
231
232
  - spec/integration/rspec/spec/selenium/selenium_directory_spec.rb
232
233
  - spec/integration/rspec/spec/selenium/selenium_with_capybara_spec.rb
233
234
  - spec/integration/rspec/spec/spec_helper.rb
235
+ - spec/integration/rspec/spec/tagging/selenium_tagging_spec.rb
234
236
  - spec/sauce/capybara_spec.rb
235
237
  - spec/sauce/config_spec.rb
236
238
  - spec/sauce/cucumber_spec.rb