Class: Selenium::Rake::ServerTask
- Inherits:
-
Object
- Object
- Selenium::Rake::ServerTask
- Defined in:
- lib/selenium/rake/server_task.rb
Overview
Defines rake tasks for starting, stopping and restarting the Selenium server.
Usage:
Selenium::Rake::ServerTask.new do |t|
t.jar = "/path/to/selenium-server-standalone.jar"
t.port = 4444
t.opts = %w[-some options]
end
Tasks defined:
rake selenium:server:start rake selenium:server:stop rake selenium:server:restart
Instance Attribute Summary collapse
-
#background ⇒ Object
(also: #background?)
Whether we should detach from the server process.
-
#jar ⇒ Object
Path to the selenium server jar.
-
#log ⇒ Object
Configure logging.
-
#opts ⇒ Object
Add additional options passed to the server jar.
-
#port ⇒ Object
Port to use for the server.
-
#timeout ⇒ Object
Timeout in seconds for the server to start/stop.
Instance Method Summary collapse
-
#initialize(prefix = "selenium:server") {|_self| ... } ⇒ ServerTask
constructor
A new instance of ServerTask.
Constructor Details
#initialize(prefix = "selenium:server") {|_self| ... } ⇒ ServerTask
Returns a new instance of ServerTask.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/selenium/rake/server_task.rb', line 79 def initialize(prefix = "selenium:server") @jar = nil @prefix = prefix @port = 4444 @timeout = 30 @background = true @log = true @opts = [] yield self if block_given? unless @jar raise MissingJarFileError, "must provide path to the selenium server jar" end @server = Selenium::Server.new(@jar, :port => @port, :timeout => @timeout, :background => @background, :log => @log ) @server << @opts define_start_task define_stop_task define_restart_task end |
Instance Attribute Details
#background ⇒ Object Also known as: background?
Whether we should detach from the server process. Default: true
58 59 60 |
# File 'lib/selenium/rake/server_task.rb', line 58 def background @background end |
#jar ⇒ Object
Path to the selenium server jar
36 37 38 |
# File 'lib/selenium/rake/server_task.rb', line 36 def jar @jar end |
#log ⇒ Object
Configure logging. Pass a log file path or a boolean. Default: true
true - log to stdout/stderr false - no logging String - log to the specified file
70 71 72 |
# File 'lib/selenium/rake/server_task.rb', line 70 def log @log end |
#opts ⇒ Object
Add additional options passed to the server jar.
76 77 78 |
# File 'lib/selenium/rake/server_task.rb', line 76 def opts @opts end |
#port ⇒ Object
Port to use for the server. Default: 4444
44 45 46 |
# File 'lib/selenium/rake/server_task.rb', line 44 def port @port end |
#timeout ⇒ Object
Timeout in seconds for the server to start/stop. Default: 30
51 52 53 |
# File 'lib/selenium/rake/server_task.rb', line 51 def timeout @timeout end |