class Selenium::Rake::RemoteControlStopTask

Rake task to stop a Selenium Remote Control Server

::new do |rc|

rc.host = "localhost"
rc.port = 4444
rc.timeout_in_seconds = 3 * 60

end

Attributes

host[RW]
port[RW]
shutdown_command[RW]
timeout_in_seconds[RW]
wait_until_stopped[RW]

Public Class Methods

new(name = :'selenium:rc:stop') { |self| ... } click to toggle source
# File lib/selenium/rake/remote_control_stop_task.rb, line 16
def initialize(name = :'selenium:rc:stop')
  @host = "localhost"
  @name = name
  @port = 4444
  @timeout_in_seconds = nil
  @shutdown_command = nil
  @wait_until_stopped = true
  yield self if block_given?
  define
end

Public Instance Methods

define() click to toggle source
# File lib/selenium/rake/remote_control_stop_task.rb, line 27
def define
  desc "Stop Selenium Remote Control running"
  task @name do
    puts "Stopping Selenium Remote Control running at #{host}:#{port}..."
    remote_control = Selenium::RemoteControl::RemoteControl.new(
        host, port, :timeout => timeout_in_seconds,
        :shutdown_command => shutdown_command)
    remote_control.stop
    if @wait_until_stopped
      TCPSocket.wait_for_service_termination :host => host, :port => port
    end
    puts "Stopped Selenium Remote Control running at #{host}:#{port}"
  end
end