Class: Selenium::Rake::RemoteControlStartTask
- Inherits:
-
Object
- Object
- Selenium::Rake::RemoteControlStartTask
- Defined in:
- lib/selenium/rake/remote_control_start_task.rb
Instance Attribute Summary collapse
-
#additional_args ⇒ Object
Returns the value of attribute additional_args.
-
#background ⇒ Object
Returns the value of attribute background.
-
#jar_file ⇒ Object
Returns the value of attribute jar_file.
-
#port ⇒ Object
Returns the value of attribute port.
-
#timeout_in_seconds ⇒ Object
Returns the value of attribute timeout_in_seconds.
-
#wait_until_up_and_running ⇒ Object
Returns the value of attribute wait_until_up_and_running.
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize(name = :'selenium:rc:start') {|_self| ... } ⇒ RemoteControlStartTask
constructor
A new instance of RemoteControlStartTask.
Constructor Details
#initialize(name = :'selenium:rc:start') {|_self| ... } ⇒ RemoteControlStartTask
Returns a new instance of RemoteControlStartTask.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/selenium/rake/remote_control_start_task.rb', line 9 def initialize(name = :'selenium:rc:start') @name = name @port = 4444 @timeout_in_seconds = 5 @jar_file = "vendor/selenium/selenium-server-1.0-standalone.jar" @additional_args = [] @background = false @wait_until_up_and_running = false yield self if block_given? define end |
Instance Attribute Details
#additional_args ⇒ Object
Returns the value of attribute additional_args.
5 6 7 |
# File 'lib/selenium/rake/remote_control_start_task.rb', line 5 def additional_args @additional_args end |
#background ⇒ Object
Returns the value of attribute background.
5 6 7 |
# File 'lib/selenium/rake/remote_control_start_task.rb', line 5 def background @background end |
#jar_file ⇒ Object
Returns the value of attribute jar_file.
7 8 9 |
# File 'lib/selenium/rake/remote_control_start_task.rb', line 7 def jar_file @jar_file end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/selenium/rake/remote_control_start_task.rb', line 5 def port @port end |
#timeout_in_seconds ⇒ Object
Returns the value of attribute timeout_in_seconds.
5 6 7 |
# File 'lib/selenium/rake/remote_control_start_task.rb', line 5 def timeout_in_seconds @timeout_in_seconds end |
#wait_until_up_and_running ⇒ Object
Returns the value of attribute wait_until_up_and_running.
5 6 7 |
# File 'lib/selenium/rake/remote_control_start_task.rb', line 5 def wait_until_up_and_running @wait_until_up_and_running end |
Instance Method Details
#define ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/selenium/rake/remote_control_start_task.rb', line 25 def define desc "Launch Selenium Remote Control" task @name do puts "Starting Selenium Remote Control at 0.0.0.0:#{@port}..." remote_control = Selenium::RemoteControl::RemoteControl.new("0.0.0.0", @port, @timeout_in_seconds) remote_control.jar_file = @jar_file remote_control.additional_args = @additional_args remote_control.start :background => @background if @background && @wait_until_up_and_running puts "Waiting for Remote Control to be up and running..." TCPSocket.wait_for_service :host => @host, :port => @port end puts "Selenium Remote Control at 0.0.0.0:#{@port} ready" end end |