Class: Selenium::ServerManager
- Inherits:
-
Object
- Object
- Selenium::ServerManager
- Defined in:
- lib/selenium/server_manager.rb
Overview
end
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
The status of the server.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(server = SeleniumServer.new) ⇒ ServerManager
constructor
A new instance of ServerManager.
-
#start ⇒ Object
Starts the server, returns when the server is up and running.
-
#stop ⇒ Object
Stops the server, returns when the server is no longer running.
Constructor Details
#initialize(server = SeleniumServer.new) ⇒ ServerManager
Returns a new instance of ServerManager.
26 27 28 29 |
# File 'lib/selenium/server_manager.rb', line 26 def initialize(server = SeleniumServer.new) @server = server @status = 'stopped' end |
Instance Attribute Details
#status ⇒ Object (readonly)
The status of the server. Values are
-
stopped
-
starting
-
started
-
stopping
-
error
20 21 22 |
# File 'lib/selenium/server_manager.rb', line 20 def status @status end |
Class Method Details
.on_port(port) ⇒ Object
22 23 24 |
# File 'lib/selenium/server_manager.rb', line 22 def ServerManager::on_port(port) ServerManager.new(SeleniumServer.new(port)) end |
Instance Method Details
#start ⇒ Object
Starts the server, returns when the server is up and running
32 33 34 35 36 |
# File 'lib/selenium/server_manager.rb', line 32 def start starting_server wait_for_condition {@server.running?} @status = 'started' end |
#stop ⇒ Object
Stops the server, returns when the server is no longer running
39 40 41 42 43 |
# File 'lib/selenium/server_manager.rb', line 39 def stop stopping_server wait_for_condition {not @server.running?} @status = 'stopped' end |