| Class | Selenium::Rake::RemoteControlStopTask |
| In: |
lib/selenium/rake/remote_control_stop_task.rb
|
| Parent: | Object |
Rake task to stop a Selenium Remote Control Server
Selenium::Rake::RemoteControlStopTask.new do |rc|
rc.host = "localhost" rc.port = 4444 rc.timeout_in_seconds = 3 * 60
end
| host | [RW] | |
| port | [RW] | |
| shutdown_command | [RW] | |
| timeout_in_seconds | [RW] | |
| wait_until_stopped | [RW] |
# File lib/selenium/rake/remote_control_stop_task.rb, line 16
16: def initialize(name = 'selenium:rc:stop''selenium:rc:stop')
17: @host = "localhost"
18: @name = name
19: @port = 4444
20: @timeout_in_seconds = nil
21: @shutdown_command = nil
22: @wait_until_stopped = true
23: yield self if block_given?
24: define
25: end
# File lib/selenium/rake/remote_control_stop_task.rb, line 27
27: def define
28: desc "Stop Selenium Remote Control running"
29: task @name do
30: puts "Stopping Selenium Remote Control running at #{host}:#{port}..."
31: remote_control = Selenium::RemoteControl::RemoteControl.new(
32: host, port, :timeout => timeout_in_seconds,
33: :shutdown_command => shutdown_command)
34: remote_control.stop
35: if @wait_until_stopped
36: TCPSocket.wait_for_service_termination :host => host, :port => port
37: end
38: puts "Stopped Selenium Remote Control running at #{host}:#{port}"
39: end
40: end