selenium-server 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -15
- data/lib/selenium-server.rb +16 -5
- data/selenium-server.gemspec +18 -6
- metadata +29 -46
- data/.gitignore +0 -21
- data/README.md +0 -39
- data/example.rb +0 -14
- data/lib/selenium-server/configuration.rb +0 -5
- data/lib/selenium-server/rake.task +0 -9
- data/lib/selenium-server/runner.rb +0 -39
- data/lib/selenium-server/selenium-server.rb +0 -36
- data/lib/selenium-server/server.rb +0 -47
data/Gemfile.lock
CHANGED
@@ -1,25 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
selenium-server (1.1
|
5
|
-
rake
|
6
|
-
selenium-webdriver
|
4
|
+
selenium-server (1.2.1)
|
7
5
|
|
8
6
|
GEM
|
9
7
|
remote: https://rubygems.org/
|
10
8
|
specs:
|
11
|
-
childprocess (0.3.9)
|
12
|
-
ffi (~> 1.0, >= 1.0.11)
|
13
|
-
ffi (1.6.0)
|
14
|
-
multi_json (1.7.2)
|
15
|
-
rake (10.0.4)
|
16
|
-
rubyzip (0.9.9)
|
17
|
-
selenium-webdriver (2.31.0)
|
18
|
-
childprocess (>= 0.2.5)
|
19
|
-
multi_json (~> 1.0)
|
20
|
-
rubyzip
|
21
|
-
websocket (~> 1.0.4)
|
22
|
-
websocket (1.0.7)
|
23
9
|
|
24
10
|
PLATFORMS
|
25
11
|
ruby
|
data/lib/selenium-server.rb
CHANGED
@@ -1,5 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
warn "
|
2
|
+
ATTENTION -- IMMEDIATE ACTION REQUIRED!
|
3
|
+
|
4
|
+
---> selenium-server is no longer maintained <---
|
5
|
+
|
6
|
+
---> It lives on in selenium-connect <---
|
7
|
+
|
8
|
+
---> Please use selenium-connect instead <---
|
9
|
+
|
10
|
+
Apologies for any inconvenience this may cause.
|
11
|
+
|
12
|
+
|
13
|
+
Cheers,
|
14
|
+
Dave Haeffner
|
15
|
+
@TourDeDave
|
16
|
+
"
|
data/selenium-server.gemspec
CHANGED
@@ -1,18 +1,30 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'selenium-server'
|
3
|
-
s.version = '1.2.
|
3
|
+
s.version = '1.2.1'
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.authors = ['Dave Haeffner']
|
6
6
|
s.email = ['dave@arrgyle.com']
|
7
|
-
s.homepage = 'https://github.com/arrgyle/selenium-
|
8
|
-
s.summary = 'A
|
7
|
+
s.homepage = 'https://github.com/arrgyle/selenium-connect'
|
8
|
+
s.summary = 'A stupid simple way to run your Selenium tests on localhost, against a Selenium Grid, or in the cloud (e.g. SauceLabs).'
|
9
|
+
s.description = '
|
10
|
+
ATTENTION
|
11
|
+
|
12
|
+
---> selenium-server is no longer maintained <---
|
13
|
+
|
14
|
+
---> It lives on in selenium-connect <---
|
15
|
+
|
16
|
+
---> Please use selenium-connect instead <---
|
17
|
+
|
18
|
+
Apologies for any inconvenience this may cause.
|
19
|
+
|
20
|
+
|
21
|
+
Cheers,
|
22
|
+
Dave Haeffner
|
23
|
+
@TourDeDave'
|
9
24
|
s.license = 'MIT'
|
10
25
|
|
11
26
|
s.files = `git ls-files`.split($/)
|
12
27
|
s.require_paths = ['lib']
|
13
28
|
|
14
29
|
s.required_ruby_version = '>=1.9'
|
15
|
-
|
16
|
-
s.add_dependency 'selenium-webdriver'
|
17
|
-
s.add_dependency 'rake'
|
18
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,61 +9,43 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04
|
13
|
-
dependencies:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
version: '0'
|
38
|
-
type: :runtime
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
description:
|
12
|
+
date: 2013-06-04 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: ! '
|
15
|
+
|
16
|
+
ATTENTION
|
17
|
+
|
18
|
+
|
19
|
+
---> selenium-server is no longer maintained <---
|
20
|
+
|
21
|
+
|
22
|
+
---> It lives on in selenium-connect <---
|
23
|
+
|
24
|
+
|
25
|
+
---> Please use selenium-connect instead <---
|
26
|
+
|
27
|
+
|
28
|
+
Apologies for any inconvenience this may cause.
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
Cheers,
|
33
|
+
|
34
|
+
Dave Haeffner
|
35
|
+
|
36
|
+
@TourDeDave'
|
47
37
|
email:
|
48
38
|
- dave@arrgyle.com
|
49
39
|
executables: []
|
50
40
|
extensions: []
|
51
41
|
extra_rdoc_files: []
|
52
42
|
files:
|
53
|
-
- .gitignore
|
54
43
|
- .rvmrc
|
55
44
|
- Gemfile
|
56
45
|
- Gemfile.lock
|
57
|
-
- README.md
|
58
|
-
- example.rb
|
59
46
|
- lib/selenium-server.rb
|
60
|
-
- lib/selenium-server/configuration.rb
|
61
|
-
- lib/selenium-server/rake.task
|
62
|
-
- lib/selenium-server/runner.rb
|
63
|
-
- lib/selenium-server/selenium-server.rb
|
64
|
-
- lib/selenium-server/server.rb
|
65
47
|
- selenium-server.gemspec
|
66
|
-
homepage: https://github.com/arrgyle/selenium-
|
48
|
+
homepage: https://github.com/arrgyle/selenium-connect
|
67
49
|
licenses:
|
68
50
|
- MIT
|
69
51
|
post_install_message:
|
@@ -87,5 +69,6 @@ rubyforge_project:
|
|
87
69
|
rubygems_version: 1.8.24
|
88
70
|
signing_key:
|
89
71
|
specification_version: 3
|
90
|
-
summary: A
|
72
|
+
summary: A stupid simple way to run your Selenium tests on localhost, against a Selenium
|
73
|
+
Grid, or in the cloud (e.g. SauceLabs).
|
91
74
|
test_files: []
|
data/.gitignore
DELETED
data/README.md
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
#selenium-server
|
2
|
-
===============
|
3
|
-
|
4
|
-
This library aims to make configuring and running your Selenium tests against a Selenium Server simple for both local and remote execution.
|
5
|
-
|
6
|
-
## Getting Started
|
7
|
-
```ruby
|
8
|
-
require 'selenium-server'
|
9
|
-
|
10
|
-
SeleniumServer.configure do |c|
|
11
|
-
c.host = "localhost"
|
12
|
-
c.port = "4444"
|
13
|
-
c.browser = "firefox"
|
14
|
-
c.profile_path = "#{Dir.pwd}/profiles/your_custom_firefox_profile"
|
15
|
-
end
|
16
|
-
|
17
|
-
@driver = SeleniumServer.start
|
18
|
-
|
19
|
-
@driver.get "http://www.google.com"
|
20
|
-
|
21
|
-
SeleniumServer.finish
|
22
|
-
```
|
23
|
-
|
24
|
-
## Helpful bits
|
25
|
-
|
26
|
-
### Selenium Actions
|
27
|
-
This library uses the Selenium WebDriver Remote Bridge actions. You can find them [here](http://www.ruby-doc.org/gems/docs/b/bbc-selenium-webdriver-1.17.0/Selenium/WebDriver/Remote/Bridge.html).
|
28
|
-
|
29
|
-
### Start
|
30
|
-
If host is set to "localhost", it will download the latest selenium-standalone-server.jar (unless it already has) and run it. Or, you can specify your own jar (if you have one you prefer to use). If no additional parameters are set, it will be exected in the background, with logging disabled. This functionality is driven using the [Selenium Rake Server Task](http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/Rake/ServerTask.html).
|
31
|
-
|
32
|
-
### Finish
|
33
|
-
Issues a quit command to the driver (and stops the local server if your host is set to "localhost").
|
34
|
-
|
35
|
-
### Support
|
36
|
-
Currently, Firefox with a custom profile is all that is supported. More coming soon!
|
37
|
-
|
38
|
-
### Versioning
|
39
|
-
This project loosely follows [Semantic Versioning](http://semver.org/).
|
data/example.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'selenium-server'
|
2
|
-
|
3
|
-
SeleniumServer.configure do |c|
|
4
|
-
c.host = "localhost"
|
5
|
-
c.port = "4444"
|
6
|
-
c.profile_path = "#{Dir.pwd}/profiles/alfresco"
|
7
|
-
c.jar = "/Users/more/Dropbox/_dev/ManTech/RAFT/vendor/selenium-server-standalone-2.32.0.jar"
|
8
|
-
end
|
9
|
-
|
10
|
-
@driver = SeleniumServer.start
|
11
|
-
|
12
|
-
@driver.get "http://www.google.com"
|
13
|
-
|
14
|
-
SeleniumServer.finish
|
@@ -1,39 +0,0 @@
|
|
1
|
-
#browser type determines server type
|
2
|
-
#browser type determines config params
|
3
|
-
#initializer *should* be the same
|
4
|
-
|
5
|
-
module SeleniumServer
|
6
|
-
class Runner
|
7
|
-
attr_reader :driver, :configuration
|
8
|
-
|
9
|
-
def initialize(configuration)
|
10
|
-
@configuration = configuration
|
11
|
-
set_sensible_defaults
|
12
|
-
@driver = initialize_selenium
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def set_sensible_defaults
|
18
|
-
configuration.host = "localhost" unless configuration.host
|
19
|
-
configuration.port = "4444" unless configuration.port
|
20
|
-
configuration.browser = "firefox" unless configuration.browser
|
21
|
-
end
|
22
|
-
|
23
|
-
def set_profile
|
24
|
-
profile = Selenium::WebDriver::Firefox::Profile.new(configuration.profile_path)
|
25
|
-
profile.assume_untrusted_certificate_issuer = false
|
26
|
-
Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile)
|
27
|
-
end
|
28
|
-
|
29
|
-
def set_server_url
|
30
|
-
"http://#{configuration.host}:#{configuration.port}/wd/hub"
|
31
|
-
end
|
32
|
-
|
33
|
-
def initialize_selenium
|
34
|
-
Selenium::WebDriver::Remote::Bridge.new(
|
35
|
-
:url => set_server_url,
|
36
|
-
:desired_capabilities => set_profile)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module SeleniumServer
|
2
|
-
extend self
|
3
|
-
|
4
|
-
def configure
|
5
|
-
yield configuration
|
6
|
-
end
|
7
|
-
|
8
|
-
def configuration
|
9
|
-
@configuration = Configuration.new
|
10
|
-
end
|
11
|
-
|
12
|
-
attr_reader :server, :driver
|
13
|
-
|
14
|
-
def localhost?
|
15
|
-
case @configuration.host
|
16
|
-
when "localhost" then true
|
17
|
-
else false
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def run
|
22
|
-
if localhost?
|
23
|
-
@server = Server.new(@configuration)
|
24
|
-
server.start
|
25
|
-
end
|
26
|
-
@driver = Runner.new(@configuration).driver
|
27
|
-
end
|
28
|
-
|
29
|
-
def finish
|
30
|
-
driver.quit
|
31
|
-
if localhost? then server.stop end
|
32
|
-
end
|
33
|
-
|
34
|
-
alias :start :run
|
35
|
-
alias :stop :finish
|
36
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module SeleniumServer
|
2
|
-
class Server
|
3
|
-
attr_reader :configuration
|
4
|
-
|
5
|
-
def initialize(configuration)
|
6
|
-
@configuration = configuration
|
7
|
-
end
|
8
|
-
|
9
|
-
def start
|
10
|
-
rake "start"
|
11
|
-
end
|
12
|
-
|
13
|
-
def stop
|
14
|
-
rake "stop"
|
15
|
-
end
|
16
|
-
|
17
|
-
def restart
|
18
|
-
rake "restart"
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
def generate_rake_task
|
24
|
-
"require 'selenium/rake/server_task'
|
25
|
-
|
26
|
-
Selenium::Rake::ServerTask.new(:server) do |t|
|
27
|
-
#{"t.version = :latest" unless configuration.jar}
|
28
|
-
#{if configuration.jar then "t.jar = '#{configuration.jar}'" end}
|
29
|
-
t.background
|
30
|
-
t.log = #{configuration.log ? configuration.log : "false"}
|
31
|
-
t.port = #{configuration.port ? configuration.port : "4444"}
|
32
|
-
end"
|
33
|
-
end
|
34
|
-
|
35
|
-
def get_rake_file
|
36
|
-
rake_file = File.join(File.dirname(File.expand_path(__FILE__)))
|
37
|
-
file = File.open(rake_file<<"/rake.task", "w")
|
38
|
-
file << generate_rake_task
|
39
|
-
file.close
|
40
|
-
return rake_file
|
41
|
-
end
|
42
|
-
|
43
|
-
def rake(task)
|
44
|
-
system "rake -f #{get_rake_file} server:#{task}"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|