Method: Selenium::WebDriver::Safari::Bridge#initialize

Defined in:
lib/selenium/webdriver/safari/bridge.rb

#initialize(opts = {}) ⇒ Bridge

Returns a new instance of Bridge.


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/selenium/webdriver/safari/bridge.rb', line 27

def initialize(opts = {})
  command_timeout = Integer(opts[:timeout] || COMMAND_TIMEOUT)
  safari_options  = opts.delete(:options) || Safari::Options.new(opts)
  capabilities    = merge_capabilities(opts, safari_options)

  @command_id ||= 0

  # TODO: handle safari_opts['cleanSession']
  @server = Server.new(safari_options.port, command_timeout)
  @server.start

  @safari = Browser.new
  @safari.start(prepare_connect_file)

  @server.wait_for_connection

  super(desired_capabilities: capabilities)
end