Class: Selenium::Rake::RemoteControlStopTask

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/rake/remote_control_stop_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :'selenium:rc:stop') {|_self| ... } ⇒ RemoteControlStopTask

Returns a new instance of RemoteControlStopTask.

Yields:

  • (_self)

Yield Parameters:



7
8
9
10
11
12
13
14
# File 'lib/selenium/rake/remote_control_stop_task.rb', line 7

def initialize(name = :'selenium:rc:stop')
  @host = "localhost"
  @name = name
  @port = 4444
  @timeout_in_seconds = 5
  yield self if block_given?
  define
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



5
6
7
# File 'lib/selenium/rake/remote_control_stop_task.rb', line 5

def host
  @host
end

#portObject

Returns the value of attribute port.



5
6
7
# File 'lib/selenium/rake/remote_control_stop_task.rb', line 5

def port
  @port
end

#timeout_in_secondsObject

Returns the value of attribute timeout_in_seconds.



5
6
7
# File 'lib/selenium/rake/remote_control_stop_task.rb', line 5

def timeout_in_seconds
  @timeout_in_seconds
end

Instance Method Details

#defineObject



16
17
18
19
20
21
22
23
24
# File 'lib/selenium/rake/remote_control_stop_task.rb', line 16

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
    puts "Stopped Selenium Remote Control running at #{@host}:#{@port}"
  end
end