| 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] | |
| timeout_in_seconds | [RW] | |
| wait_until_stopped | [RW] |
# File lib/selenium/rake/remote_control_stop_task.rb, line 15
15: def initialize(name = 'selenium:rc:stop''selenium:rc:stop')
16: @host = "localhost"
17: @name = name
18: @port = 4444
19: @timeout_in_seconds = 5
20: @wait_until_stopped = true
21: yield self if block_given?
22: define
23: end
# File lib/selenium/rake/remote_control_stop_task.rb, line 25
25: def define
26: desc "Stop Selenium Remote Control running"
27: task @name do
28: puts "Stopping Selenium Remote Control running at #{@host}:#{@port}..."
29: remote_control = Selenium::RemoteControl::RemoteControl.new(@host, @port, @timeout_in_seconds)
30: remote_control.stop
31: if @wait_until_stopped
32: TCPSocket.wait_for_service_termination :host => @host, :port => @port
33: end
34: puts "Stopped Selenium Remote Control running at #{@host}:#{@port}"
35: end
36: end