Module: Capybara::Selenium::Remote

Defined in:
lib/capybara/selenium/remote.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.hostnameObject

Returns the value of attribute hostname.



5
6
7
# File 'lib/capybara/selenium/remote.rb', line 5

def hostname
  @hostname
end

.optsObject

Returns the value of attribute opts.



5
6
7
# File 'lib/capybara/selenium/remote.rb', line 5

def opts
  @opts
end

.selenium_hostObject

Returns the value of attribute selenium_host.



5
6
7
# File 'lib/capybara/selenium/remote.rb', line 5

def selenium_host
  @selenium_host
end

.server_portObject

Returns the value of attribute server_port.



5
6
7
# File 'lib/capybara/selenium/remote.rb', line 5

def server_port
  @server_port
end

Class Method Details

.use(selenium_host, opts = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/capybara/selenium/remote.rb', line 6

def use(selenium_host, opts={})
  @selenium_host = selenium_host
  @selenium_url  = "http://#{selenium_host}:4444/wd/hub"
  @server_port   = opts.delete(:server_port) || 9000
  @localhost    = opts.delete(:localhost)    || get_localhost
  @opts          = opts
  Capybara.server_port = @server_port
  Capybara.app_host    = "http://#{@localhost}:#{@server_port}"

  Capybara.register_driver :selenium do |app|
    Capybara::Selenium::Driver.new(app, {:url => @selenium_url, :browser => :remote}.merge(opts))
  end
end