saucelabs-adapter 0.8.17 → 0.8.18
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/saucelabs_adapter/rspec_adapter.rb +14 -11
- data/lib/saucelabs_adapter/selenium_config.rb +1 -1
- metadata +33 -16
- data/lib/saucerest-ruby/gateway.rb +0 -35
- data/lib/saucerest-ruby/saucerest.rb +0 -56
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.18
|
@@ -7,19 +7,22 @@ if defined?(Spec::Runner)
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
config.saucelabs_tunnel.
|
10
|
+
|
11
|
+
selenium_config = SaucelabsAdapter::SeleniumConfig.new(ENV['SELENIUM_ENV'])
|
12
|
+
if selenium_config.test_framework == :webrat
|
13
|
+
Spec::Runner.configure do |config|
|
14
|
+
config.before :all do
|
15
|
+
if selenium_config.start_tunnel? and config.saucelabs_tunnel.nil?
|
16
|
+
config.saucelabs_tunnel = SaucelabsAdapter::Tunnel.factory(selenium_config)
|
17
|
+
config.saucelabs_tunnel.start_tunnel
|
18
|
+
end
|
19
|
+
webrat_config = Webrat.configuration
|
20
|
+
selenium_config.configure_webrat(webrat_config)
|
16
21
|
end
|
17
|
-
webrat_config = Webrat.configuration
|
18
|
-
selenium_config.configure_webrat(webrat_config)
|
19
|
-
end
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
+
at_exit do
|
24
|
+
config.saucelabs_tunnel.shutdown if config.saucelabs_tunnel
|
25
|
+
end
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
@@ -6,7 +6,7 @@ module SaucelabsAdapter
|
|
6
6
|
attr_reader :configuration
|
7
7
|
|
8
8
|
def initialize(configuration_name = nil, selenium_yml_path = nil)
|
9
|
-
selenium_yml_path = selenium_yml_path || File.join(RAILS_ROOT, 'config', 'selenium.yml')
|
9
|
+
selenium_yml_path = selenium_yml_path || File.join(ENV['RAILS_ROOT'] || RAILS_ROOT, 'config', 'selenium.yml')
|
10
10
|
SeleniumConfig.parse_yaml(selenium_yml_path)
|
11
11
|
build_configuration(configuration_name)
|
12
12
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saucelabs-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
9
|
+
- 18
|
10
|
+
version: 0.8.18
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Kelly Felkins, Chad Woolley, Sam Pierson, Nate Clark
|
@@ -14,78 +15,88 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-16 00:00:00 -07:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
+
prerelease: false
|
22
23
|
type: :runtime
|
24
|
+
name: rest-client
|
23
25
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
24
27
|
requirements:
|
25
28
|
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
27
31
|
segments:
|
28
32
|
- 1
|
29
33
|
- 5
|
30
34
|
- 0
|
31
35
|
version: 1.5.0
|
32
|
-
prerelease: false
|
33
36
|
requirement: *id001
|
34
37
|
- !ruby/object:Gem::Dependency
|
35
|
-
|
38
|
+
prerelease: false
|
36
39
|
type: :runtime
|
40
|
+
name: net-ssh
|
37
41
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
38
43
|
requirements:
|
39
44
|
- - ">="
|
40
45
|
- !ruby/object:Gem::Version
|
46
|
+
hash: 23
|
41
47
|
segments:
|
42
48
|
- 2
|
43
49
|
- 0
|
44
50
|
- 12
|
45
51
|
version: 2.0.12
|
46
|
-
prerelease: false
|
47
52
|
requirement: *id002
|
48
53
|
- !ruby/object:Gem::Dependency
|
49
|
-
|
54
|
+
prerelease: false
|
50
55
|
type: :runtime
|
56
|
+
name: net-ssh-gateway
|
51
57
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
52
59
|
requirements:
|
53
60
|
- - ">="
|
54
61
|
- !ruby/object:Gem::Version
|
62
|
+
hash: 21
|
55
63
|
segments:
|
56
64
|
- 1
|
57
65
|
- 0
|
58
66
|
- 1
|
59
67
|
version: 1.0.1
|
60
|
-
prerelease: false
|
61
68
|
requirement: *id003
|
62
69
|
- !ruby/object:Gem::Dependency
|
63
|
-
|
70
|
+
prerelease: false
|
64
71
|
type: :runtime
|
72
|
+
name: selenium-client
|
65
73
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
66
75
|
requirements:
|
67
76
|
- - ">="
|
68
77
|
- !ruby/object:Gem::Version
|
78
|
+
hash: 61
|
69
79
|
segments:
|
70
80
|
- 1
|
71
81
|
- 2
|
72
82
|
- 17
|
73
83
|
version: 1.2.17
|
74
|
-
prerelease: false
|
75
84
|
requirement: *id004
|
76
85
|
- !ruby/object:Gem::Dependency
|
77
|
-
|
86
|
+
prerelease: false
|
78
87
|
type: :runtime
|
88
|
+
name: lsof
|
79
89
|
version_requirements: &id005 !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
80
91
|
requirements:
|
81
92
|
- - ">="
|
82
93
|
- !ruby/object:Gem::Version
|
94
|
+
hash: 19
|
83
95
|
segments:
|
84
96
|
- 0
|
85
97
|
- 3
|
86
98
|
- 0
|
87
99
|
version: 0.3.0
|
88
|
-
prerelease: false
|
89
100
|
requirement: *id005
|
90
101
|
description: "This gem augments Test::Unit and Polonium/Webrat to run Selenium tests in the cloud. "
|
91
102
|
email: pair+kelly+sam@pivotallabs.com
|
@@ -119,9 +130,11 @@ files:
|
|
119
130
|
- lib/saucelabs_adapter/tunnels/sauce_tunnel.rb
|
120
131
|
- lib/saucelabs_adapter/tunnels/ssh_tunnel.rb
|
121
132
|
- lib/saucelabs_adapter/utilities.rb
|
122
|
-
- lib/saucerest-ruby/gateway.rb
|
123
|
-
- lib/saucerest-ruby/saucerest.rb
|
124
133
|
- README.markdown
|
134
|
+
- spec/selenium_config_spec.rb
|
135
|
+
- spec/spec_helper.rb
|
136
|
+
- test/helper.rb
|
137
|
+
- test/test_saucelabs-adapter.rb
|
125
138
|
has_rdoc: true
|
126
139
|
homepage: http://github.com/pivotal/saucelabs-adapter
|
127
140
|
licenses: []
|
@@ -132,23 +145,27 @@ rdoc_options:
|
|
132
145
|
require_paths:
|
133
146
|
- lib
|
134
147
|
required_ruby_version: !ruby/object:Gem::Requirement
|
148
|
+
none: false
|
135
149
|
requirements:
|
136
150
|
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
152
|
+
hash: 3
|
138
153
|
segments:
|
139
154
|
- 0
|
140
155
|
version: "0"
|
141
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
142
158
|
requirements:
|
143
159
|
- - ">="
|
144
160
|
- !ruby/object:Gem::Version
|
161
|
+
hash: 3
|
145
162
|
segments:
|
146
163
|
- 0
|
147
164
|
version: "0"
|
148
165
|
requirements: []
|
149
166
|
|
150
167
|
rubyforge_project:
|
151
|
-
rubygems_version: 1.3.
|
168
|
+
rubygems_version: 1.3.7
|
152
169
|
signing_key:
|
153
170
|
specification_version: 3
|
154
171
|
summary: Adapter for running Selenium tests using SauceLabs.com
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# http://groups.google.com/group/capistrano/browse_thread/thread/455c0c8a6faa9cc8?pli=1
|
2
|
-
class Net::SSH::Gateway
|
3
|
-
# Opens a SSH tunnel from a port on a remote host to a given host and port
|
4
|
-
# on the local side
|
5
|
-
# (equivalent to openssh -R parameter)
|
6
|
-
def open_remote(port, host, remote_port, remote_host = "127.0.0.1")
|
7
|
-
ensure_open!
|
8
|
-
|
9
|
-
@session_mutex.synchronize do
|
10
|
-
@session.forward.remote(port, host, remote_port, remote_host)
|
11
|
-
end
|
12
|
-
|
13
|
-
if block_given?
|
14
|
-
begin
|
15
|
-
yield [remote_port, remote_host]
|
16
|
-
ensure
|
17
|
-
close_remote(remote_port, remote_host)
|
18
|
-
end
|
19
|
-
else
|
20
|
-
return [remote_port, remote_host]
|
21
|
-
end
|
22
|
-
rescue Errno::EADDRINUSE
|
23
|
-
retry
|
24
|
-
end
|
25
|
-
|
26
|
-
# Cancels port-forwarding over an open port that was previously opened via
|
27
|
-
# #open_remote.
|
28
|
-
def close_remote(port, host = "127.0.0.1")
|
29
|
-
ensure_open!
|
30
|
-
|
31
|
-
@session_mutex.synchronize do
|
32
|
-
@session.forward.cancel_remote(port, host)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rest_client'
|
3
|
-
require 'json'
|
4
|
-
|
5
|
-
module SauceREST
|
6
|
-
|
7
|
-
# A simple class for using the Sauce Labs REST API
|
8
|
-
class Client
|
9
|
-
@@roots = {
|
10
|
-
:script => 'scripts',
|
11
|
-
:job => 'jobs',
|
12
|
-
:result => 'results',
|
13
|
-
:tunnel => 'tunnels'
|
14
|
-
}
|
15
|
-
|
16
|
-
def initialize base_url
|
17
|
-
@base_url = base_url
|
18
|
-
@resource = RestClient::Resource.new @base_url
|
19
|
-
end
|
20
|
-
|
21
|
-
def create type, *args
|
22
|
-
doc = args[-1]
|
23
|
-
doc_json = doc.to_json
|
24
|
-
resp_json = @resource[@@roots[type]].post(doc_json,
|
25
|
-
:content_type =>
|
26
|
-
'application/octet-stream')
|
27
|
-
resp = JSON.parse resp_json
|
28
|
-
return resp
|
29
|
-
end
|
30
|
-
|
31
|
-
def get type, docid
|
32
|
-
resp_json = @resource[@@roots[type] + '/' + docid].get
|
33
|
-
resp = JSON.parse resp_json
|
34
|
-
return resp
|
35
|
-
end
|
36
|
-
|
37
|
-
def attach docid, name, data
|
38
|
-
resp_json = @resource[@@roots[:script] + '/' + docid + '/' + name].put data
|
39
|
-
resp = JSON.parse resp_json
|
40
|
-
return resp
|
41
|
-
end
|
42
|
-
|
43
|
-
def delete type, docid
|
44
|
-
resp_json = @resource[@@roots[type] + '/' + docid].delete
|
45
|
-
resp = JSON.parse resp_json
|
46
|
-
return resp
|
47
|
-
end
|
48
|
-
|
49
|
-
def list type
|
50
|
-
resp_json = @resource[@@roots[type] + '/'].get
|
51
|
-
resp = JSON.parse resp_json
|
52
|
-
return resp
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|