Sha256: 2b6fcd7510c4889ba8ee79db420b0fcf3bec45155db636a84d432c0f5bc35b4a

Contents?: true

Size: 946 Bytes

Versions: 4

Compression:

Stored size: 946 Bytes

Contents

module Selenium
  module Rake

    class RemoteControlStopTask
      attr_accessor :host, :port, :timeout_in_seconds, :wait_until_stopped

      def initialize(name = :'selenium:rc:stop')
        @host = "localhost"
        @name = name
        @port = 4444
        @timeout_in_seconds = 5
        @wait_until_stopped = true
        yield self if block_given?
        define
      end
    
      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_in_seconds)
          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

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
selenium-client-1.2.13 lib/selenium/rake/remote_control_stop_task.rb
selenium-client-1.2.11 lib/selenium/rake/remote_control_stop_task.rb
selenium-client-1.2.12 lib/selenium/rake/remote_control_stop_task.rb
selenium-client-1.2.14 lib/selenium/rake/remote_control_stop_task.rb