selenium-rc-latest 2.39.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a67512ead82dde4b59d1af9bf847fc867e6cdd4b
4
+ data.tar.gz: 1acaf5b4fbcd3c10996ed6b82c8e9ae128bed33a
5
+ SHA512:
6
+ metadata.gz: cf09180aeff27e78bd7ff61427fe3fa988631880dcd434dc5a93d1150ebb5896378c63bc33781ef794d8572f2b1be51e3744bdeb4c8d2a6d6433426f5890297c
7
+ data.tar.gz: a562c5651958b88c6fa1ab18959101b0015ed5db1f15471cee13272ee42f7f3c88b75097a34b99d3c2ea3c542f9453081bcf425a239bb7cce9b58c9fb14d9f55
@@ -0,0 +1,7 @@
1
+ .idea
2
+ .rvmrc
3
+ /pkg
4
+ /tmp
5
+ /vendor/selenium-server.jar
6
+ .bundle
7
+ selenium-rc-*.gem
data/CHANGES ADDED
@@ -0,0 +1,26 @@
1
+ 2.3.2
2
+ Updating Selenium jar to v2.0 [b2]
3
+
4
+ 2.3.1
5
+ Adds a 0.1 second sleep between attempts to check if Selenium is ready for connections
6
+
7
+ 2.3.0
8
+ Updating Selenium jar to v2.0 [b1]
9
+ fixes bug on some Linux machines where server would not actually be ready for connections even though it was reported as ready
10
+ renaming library to the same name as the gem ('selenium-rc')
11
+ exposes the selenium-server.jar path as a class method (SeleniumRC::Server.jar_path)
12
+ adding Gemfile and development/test dependencies
13
+ adding more detailed documentation
14
+
15
+ 2.2.4
16
+ Updating Selenium jar to v2.0 [a4]
17
+
18
+ 1.8.20090512
19
+ Fixed bug where bin/selenium-rc did not stay open
20
+
21
+ 1.7.20090512
22
+ Properly handling Errno::EADDRNOTAVAIL when starting on windows.
23
+
24
+ 1.6.20090512
25
+ Properly terminate server when the process exits.
26
+ Fixed server blocking the process issue.
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ gem "rake"
@@ -0,0 +1,38 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ selenium-rc (2.39.0)
5
+ selenium-client (>= 1.2.18)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.1.2)
11
+ gem-release (0.0.16)
12
+ lsof (0.3.0)
13
+ rake (0.9.2.2)
14
+ rr (1.0.2)
15
+ rspec (2.5.0)
16
+ rspec-core (~> 2.5.0)
17
+ rspec-expectations (~> 2.5.0)
18
+ rspec-mocks (~> 2.5.0)
19
+ rspec-core (2.5.1)
20
+ rspec-expectations (2.5.0)
21
+ diff-lcs (~> 1.1.2)
22
+ rspec-mocks (2.5.0)
23
+ rubyzip (0.9.4)
24
+ selenium-client (1.2.18)
25
+ thor (0.14.6)
26
+
27
+ PLATFORMS
28
+ ruby
29
+
30
+ DEPENDENCIES
31
+ gem-release
32
+ lsof
33
+ rake
34
+ rr
35
+ rspec (>= 2.5.0)
36
+ rubyzip
37
+ selenium-rc!
38
+ thor
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Pivotal Labs
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,49 @@
1
+ # selenium-rc #
2
+
3
+ _selenium-rc_ is a convenient ruby wrapper for the Selenium Standalone Server jar (formerly Selenium RC Server) packaged as a gem. This gem bundles the latest selenium-server-standalone-{version}.jar file and provides a binary and Ruby library to manage it.
4
+
5
+ ### Version ###
6
+
7
+ The current version of this gem (2.39.0) packages Selenium Standalone Server 2.39.0 - [http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar](http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar)
8
+
9
+ ### Basic Ruby Usage ###
10
+
11
+ server = SeleniumRC::Server.boot('localhost')
12
+ #=> Starts a Selenium Server accessible via http://localhost:4444 (the default port)
13
+
14
+ server = SeleniumRC::Server.boot('localhost', 8888)
15
+ #=> Starts a Selenium Server accessible via http://localhost:8888
16
+
17
+ server = SeleniumRC::Server.boot('localhost', 8888, :args => ["-browserSideLog", "-suppressStupidness"])
18
+ #=> Starts a Selenium Server accessible via http://localhost:8888 and passes arbitrary options to Selenium
19
+
20
+ server = SeleniumRC::Server.boot('localhost', 8888, :timeout => 120)
21
+ #=> Starts a Selenium Server accessible via http://localhost:8888 and waits 120 seconds before timing out
22
+
23
+ server.stop
24
+ #=> Stops the running Selenium Server
25
+
26
+ ### Basic Command Line Usage ###
27
+
28
+ $ selenium-rc
29
+ #=> Starts a Selenium Server on localhost and the default port (4444)
30
+
31
+ $ export SELENIUM_SERVER_PORT=8888
32
+ $ selenium-rc
33
+ #=> Starts a Selenium Server on localhost on port 8888
34
+
35
+ ### License ###
36
+ This software redistributes the Selenium Standalone Server (selenium-server.jar) in an *unmodified* form.
37
+ The Selenium Server is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
38
+
39
+ All other software contained within is licensed under the MIT License. See the MIT.LICENSE file in this project for details
40
+
41
+ ### Links & More Info ###
42
+
43
+ [SeleniumHQ](http://seleniumhq.org/)
44
+
45
+ [Selenium Project on Google Code](http://code.google.com/p/selenium/)
46
+
47
+ [Pivotal Labs](http://pivotallabs.com)
48
+
49
+ Copyright (c) 2010-2011 Pivotal Labs. This software is licensed under the MIT License.
@@ -0,0 +1,14 @@
1
+ this is the list of things to do:
2
+
3
+ $ gem install bundler
4
+ $ bundle install #=> Get yer dependencies
5
+ * edit Thorfile with the path to the latest Selenium Jar
6
+ $ bundle exec thor joe:download #=> downloads the latest Selenium Jar file
7
+ $ bundle exec rake #=> make sure they're green
8
+ $ manually edit lib/selenium-rc/version.rb with the desired version because gem-release is too dumb to do it right
9
+ $ manually edit selenium-rc.gemspec to contain the version # can't gem-release do this for us???
10
+ $ manually edit the README.markdown to update the version of the gem
11
+ $ manually edit the README.markdown to update the version of the new selenium-rc jar (which you pasted in Thorfile)
12
+ $ git commit everything thus far
13
+ $ git push
14
+ $ gem release --tag
@@ -0,0 +1,5 @@
1
+ require "rspec"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task :default => :spec
@@ -0,0 +1,15 @@
1
+ require "zip/zip"
2
+
3
+ class Joe < Thor
4
+ desc "download", "download the Selenium jar file from Google Code repository"
5
+ def download
6
+ url = "http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar"
7
+ file = File.join("tmp", File.basename(url))
8
+
9
+ FileUtils.mkdir_p("tmp")
10
+
11
+ system "wget #{url} -O #{file}" unless File.exist?(file)
12
+
13
+ FileUtils.mv("#{file}", "vendor/selenium-server.jar")
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "selenium-rc"))
4
+
5
+ SeleniumRC::Server.boot(
6
+ ENV["SELENIUM_SERVER_HOST"] || "0.0.0.0",
7
+ ENV["SELENIUM_SERVER_PORT"],
8
+ :args => ARGV
9
+ )
10
+
11
+ sleep
@@ -0,0 +1,2 @@
1
+ require 'selenium_rc/server'
2
+ require 'net/http'
@@ -0,0 +1,2 @@
1
+ warn '[DEPRECATION] the library for selenium-rc has been changed to \'selenium-rc.rb\' instead of \'selenium_rc.rb\'. Please update your `require` statements, or use Bundler to automatically require the correct library.'
2
+ require 'selenium-rc'
@@ -0,0 +1,95 @@
1
+ module SeleniumRC
2
+
3
+ class Server
4
+ attr_accessor :host
5
+ attr_accessor :port
6
+ attr_accessor :args
7
+ attr_accessor :timeout
8
+
9
+ class << self
10
+ def boot(*args)
11
+ new(*args).boot
12
+ end
13
+
14
+ def jar_path
15
+ File.expand_path("#{File.dirname(__FILE__)}/../../vendor/selenium-server.jar")
16
+ end
17
+ end
18
+
19
+ def initialize(host, port = nil, options = {})
20
+ @host = host
21
+ @port = port || 4444
22
+ @args = options[:args] || []
23
+ @timeout = options[:timeout] || 60
24
+ end
25
+
26
+ def boot
27
+ start
28
+ wait
29
+ at_exit { stop }
30
+ self
31
+ end
32
+
33
+ def start
34
+ command = "java -jar \"#{self.class.jar_path}\""
35
+ command << " -port #{port}"
36
+ command << " #{args.join(' ')}" unless args.empty?
37
+ begin
38
+ fork do
39
+ system(command)
40
+ at_exit { exit!(0) }
41
+ end
42
+ rescue NotImplementedError
43
+ Thread.start do
44
+ system(command)
45
+ end
46
+ end
47
+ end
48
+
49
+ def wait
50
+ $stderr.print "==> Waiting for Selenium Server on port #{port}... "
51
+ wait_for_service_with_timeout
52
+ $stderr.print "Ready!\n"
53
+ rescue ServerNotStarted
54
+ fail
55
+ end
56
+
57
+ def fail
58
+ $stderr.puts
59
+ $stderr.puts
60
+ $stderr.puts "==> Failed to boot the Selenium Server... exiting!"
61
+ exit
62
+ end
63
+
64
+ def stop
65
+ selenium_command('shutDownSeleniumServer')
66
+ end
67
+
68
+ def ready?
69
+ begin
70
+ selenium_command('testComplete') == 'OK'
71
+ rescue Errno::ECONNRESET, Errno::ECONNREFUSED, Errno::EPIPE, Net::HTTPBadResponse
72
+ false
73
+ end
74
+ end
75
+
76
+ protected
77
+
78
+ def selenium_command(command)
79
+ Net::HTTP.get(host, "/selenium-server/driver/?cmd=#{command}", port)
80
+ end
81
+
82
+ def wait_for_service_with_timeout
83
+ start_time = Time.now
84
+ until ready?
85
+ sleep 0.1
86
+ if @timeout && (Time.now > (start_time + @timeout))
87
+ raise ServerNotStarted.new("Selenium Server was not ready for connections after #{@timeout} seconds")
88
+ end
89
+ end
90
+ end
91
+ end
92
+
93
+ class ServerNotStarted < Exception
94
+ end
95
+ end
@@ -0,0 +1,3 @@
1
+ module SeleniumRC
2
+ VERSION = '2.39.0'
3
+ end
@@ -0,0 +1,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{selenium-rc-latest}
5
+ s.version = "2.39.0"
6
+ s.platform = Gem::Platform::RUBY
7
+
8
+ s.description = %q{The Selenium Server packaged as a gem}
9
+ s.summary = %q{The Selenium Server packaged as a gem}
10
+ s.authors = ["Pivotal Labs, Inc.", "Nate Clark", "Brian Takita", "Chad Woolley", "Matthew Kocher"]
11
+ s.email = %q{pivotallabsopensource@googlegroups.com}
12
+ s.homepage = %q{http://github.com/pivotal/selenium-rc}
13
+
14
+ s.rdoc_options = ["--charset=UTF-8"]
15
+ s.extra_rdoc_files = ["README.markdown"]
16
+
17
+ s.files = `git ls-files`.split("\n").unshift('vendor/selenium-server.jar')
18
+ s.executables = %w{selenium-rc}
19
+ s.default_executable = %q{selenium-rc}
20
+ s.test_files = `git ls-files -- spec/*`.split("\n")
21
+ s.require_paths = %w{lib}
22
+
23
+ s.add_dependency "selenium-client", ">= 1.2.18"
24
+ s.add_development_dependency 'rspec', '>= 2.5.0'
25
+ s.add_development_dependency 'rr'
26
+ s.add_development_dependency 'thor'
27
+ s.add_development_dependency 'lsof'
28
+ s.add_development_dependency 'rubyzip'
29
+ s.add_development_dependency 'gem-release'
30
+ end
@@ -0,0 +1,36 @@
1
+ require 'spec_helper'
2
+
3
+ describe "bin/selenium-rc" do
4
+ let(:root_dir) { File.expand_path("#{File.dirname(__FILE__)}/..") }
5
+ before do
6
+ unless File.exists?("#{root_dir}/vendor/selenium-server.jar")
7
+ raise "vendor/selenium-server.jar does not exist. Try running `thor joe:download` to install the jar file."
8
+ end
9
+ end
10
+
11
+ it "starts the SeleniumRC server from the downloaded jar file and terminates it when finished" do
12
+ thread = nil
13
+ Dir.chdir(root_dir) do
14
+ thread = Thread.start do
15
+ system("bin/selenium-rc") || raise("bin/selenium-server failed")
16
+ end
17
+ end
18
+
19
+ server = SeleniumRC::Server.new("0.0.0.0")
20
+
21
+ timeout { server.ready? }
22
+ thread.kill
23
+ Lsof.kill(4444)
24
+ timeout { !server.ready? }
25
+ end
26
+
27
+ def timeout
28
+ start_time = Time.now
29
+ timeout = 15
30
+ until yield
31
+ if Time.now > (start_time + timeout)
32
+ raise SeleniumRC::ServerNotStarted.new("Selenium Server was not ready for connections after #{timeout} seconds")
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,53 @@
1
+ require 'spec_helper'
2
+
3
+ describe SeleniumRC::Server do
4
+
5
+ def new_server(*args)
6
+ server = SeleniumRC::Server.new(*args)
7
+ stub(server).log
8
+ stub(server).fork.yields
9
+ server
10
+ end
11
+
12
+ describe ".boot" do
13
+ let(:server) { new_server('localhost', 5555, {:timeout => 1}) }
14
+
15
+ before do
16
+ mock(server).start { true }
17
+ end
18
+
19
+ context "when the selenium server starts successfully" do
20
+ it "returns an instance of the server" do
21
+ mock(server).ready? { true }
22
+ server.boot.should == server
23
+ end
24
+ end
25
+
26
+ context "when the selenium server fails to start" do
27
+ it "raises an exception after 60 seconds" do
28
+ mock(server).ready?.any_number_of_times { false }
29
+ expect { server.boot.should }.to raise_error(SystemExit)
30
+ end
31
+ end
32
+ end
33
+
34
+ describe "#start" do
35
+ it "launches java with the jar file and port" do
36
+ server = new_server("0.0.0.0", 5555)
37
+ expected_command = %Q{java -jar "/path/to/the.jar" -port 5555}
38
+ mock(server).system(expected_command)
39
+ mock(SeleniumRC::Server).jar_path {"/path/to/the.jar"}
40
+ server.start
41
+ end
42
+
43
+ context "when passed additional arguments" do
44
+ it "adds the additional arguments to the selenium start command" do
45
+ server = new_server("0.0.0.0", 4444, :args => ["-browserSideLog", "-suppressStupidness"])
46
+ expected_command = %Q{java -jar "/path/to/the.jar" -port 4444 -browserSideLog -suppressStupidness}
47
+ mock(server).system(expected_command)
48
+ mock(SeleniumRC::Server).jar_path {"/path/to/the.jar"}
49
+ server.start
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,6 @@
1
+ require 'bundler'
2
+ Bundler.require(:default, :development, :test)
3
+
4
+ RSpec.configure do |config|
5
+ config.mock_with :rr
6
+ end
File without changes
metadata ADDED
@@ -0,0 +1,170 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: selenium-rc-latest
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.39.0
5
+ platform: ruby
6
+ authors:
7
+ - Pivotal Labs, Inc.
8
+ - Nate Clark
9
+ - Brian Takita
10
+ - Chad Woolley
11
+ - Matthew Kocher
12
+ autorequire:
13
+ bindir: bin
14
+ cert_chain: []
15
+ date: 2014-01-14 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: selenium-client
19
+ requirement: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - '>='
22
+ - !ruby/object:Gem::Version
23
+ version: 1.2.18
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - '>='
29
+ - !ruby/object:Gem::Version
30
+ version: 1.2.18
31
+ - !ruby/object:Gem::Dependency
32
+ name: rspec
33
+ requirement: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 2.5.0
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - '>='
43
+ - !ruby/object:Gem::Version
44
+ version: 2.5.0
45
+ - !ruby/object:Gem::Dependency
46
+ name: rr
47
+ requirement: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ type: :development
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ - !ruby/object:Gem::Dependency
60
+ name: thor
61
+ requirement: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ - !ruby/object:Gem::Dependency
74
+ name: lsof
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ - !ruby/object:Gem::Dependency
88
+ name: rubyzip
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ - !ruby/object:Gem::Dependency
102
+ name: gem-release
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ type: :development
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ description: The Selenium Server packaged as a gem
116
+ email: pivotallabsopensource@googlegroups.com
117
+ executables:
118
+ - selenium-rc
119
+ extensions: []
120
+ extra_rdoc_files:
121
+ - README.markdown
122
+ files:
123
+ - vendor/selenium-server.jar
124
+ - .gitignore
125
+ - CHANGES
126
+ - Gemfile
127
+ - Gemfile.lock
128
+ - MIT.LICENSE
129
+ - README.markdown
130
+ - RELEASING
131
+ - Rakefile
132
+ - Thorfile
133
+ - bin/selenium-rc
134
+ - lib/selenium-rc.rb
135
+ - lib/selenium_rc.rb
136
+ - lib/selenium_rc/server.rb
137
+ - lib/selenium_rc/version.rb
138
+ - selenium-rc.gemspec
139
+ - spec/bin_selenium_rc_spec.rb
140
+ - spec/selenium_rc/server_spec.rb
141
+ - spec/spec_helper.rb
142
+ - vendor/empty.txt
143
+ homepage: http://github.com/pivotal/selenium-rc
144
+ licenses: []
145
+ metadata: {}
146
+ post_install_message:
147
+ rdoc_options:
148
+ - --charset=UTF-8
149
+ require_paths:
150
+ - lib
151
+ required_ruby_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - '>='
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - '>='
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ requirements: []
162
+ rubyforge_project:
163
+ rubygems_version: 2.0.3
164
+ signing_key:
165
+ specification_version: 4
166
+ summary: The Selenium Server packaged as a gem
167
+ test_files:
168
+ - spec/bin_selenium_rc_spec.rb
169
+ - spec/selenium_rc/server_spec.rb
170
+ - spec/spec_helper.rb