Class: SeleniumGrid::Hub
- Inherits:
-
Object
- Object
- SeleniumGrid::Hub
- Includes:
- Singleton, Utils
- Defined in:
- lib/selenium-grid/hub.rb
Constant Summary collapse
- HUB_PORT =
4444
Instance Method Summary collapse
Instance Method Details
#list ⇒ Object
29 30 31 |
# File 'lib/selenium-grid/hub.rb', line 29 def list running? ? { HUB_PORT.to_s => "hub" } : {} end |
#running? ⇒ Boolean
33 34 35 |
# File 'lib/selenium-grid/hub.rb', line 33 def running? Netstat.instance.running?(HUB_PORT) end |
#start(overrides = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/selenium-grid/hub.rb', line 10 def start(overrides = {}) classpath = Java::Classpath.new(File.join(File.dirname(__FILE__), %w(.. ..))) classpath = classpath << "." << "lib/openqa/selenium-grid-hub-standalone-*.jar" requirements = { :classpath => classpath.definition, :log => ENV['LOG'] || overrides[:log] || File.join(".", "log", "hub.log") } = { :background => ENV['BACKGROUND'] || false }.merge(overrides).merge(requirements) Java::VM.new.run "com.thoughtworks.selenium.grid.hub.HubServer", end |
#stop ⇒ Object
25 26 27 |
# File 'lib/selenium-grid/hub.rb', line 25 def stop Lsof.kill(HUB_PORT) end |