Class: Selenium::WebDriver::Safari::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/safari/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Options

Returns a new instance of Options.



26
27
28
# File 'lib/selenium/webdriver/safari/options.rb', line 26

def initialize(opts = {})
  extract_options(opts)
end

Instance Attribute Details

#data_dirObject

Returns the value of attribute data_dir.



24
25
26
# File 'lib/selenium/webdriver/safari/options.rb', line 24

def data_dir
  @data_dir
end

#portObject

Returns the value of attribute port.



24
25
26
# File 'lib/selenium/webdriver/safari/options.rb', line 24

def port
  @port
end

#skip_extension_installationObject

Returns the value of attribute skip_extension_installation.



24
25
26
# File 'lib/selenium/webdriver/safari/options.rb', line 24

def skip_extension_installation
  @skip_extension_installation
end

Instance Method Details

#as_jsonObject



41
42
43
44
45
46
47
# File 'lib/selenium/webdriver/safari/options.rb', line 41

def as_json
  {
    'port'                      => port,
    'dataDir'                   => data_dir,
    'cleanSession'              => clean_session?,
  }
end

#clean_session?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/selenium/webdriver/safari/options.rb', line 30

def clean_session?
  !!@clean_session
end

#to_capabilitiesObject



34
35
36
37
38
39
# File 'lib/selenium/webdriver/safari/options.rb', line 34

def to_capabilities
  caps = Remote::Capabilities.safari
  caps.merge!('safari.options' => as_json)

  caps
end