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

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

Constant Summary collapse

CAPABILITIES =
{automatic_inspection: 'safari:automaticInspection',
automatic_profiling: 'safari:automaticProfiling'}.freeze
BROWSER =
Selenium::WebDriver::Safari.technology_preview? ? 'Safari Technology Preview' : 'safari'

Constants inherited from Options

Options::GRID_OPTIONS, Options::W3C_OPTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Options

#==, chrome, edge, firefox, ie, #initialize, safari, set_capabilities

Constructor Details

This class inherits a constructor from Selenium::WebDriver::Options

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#add_option(name, value = nil) ⇒ Object

Raises:

  • (ArgumentError)


31
32
33
34
35
36
# File 'rb/lib/selenium/webdriver/safari/options.rb', line 31

def add_option(name, value = nil)
  key = name.is_a?(Hash) ? name.keys.first : name
  raise ArgumentError, 'Safari does not support options that are not namespaced' unless key.to_s.include?(':')

  super
end

#as_jsonObject



38
39
40
41
# File 'rb/lib/selenium/webdriver/safari/options.rb', line 38

def as_json(*)
  @options[:browser_name] = Safari.technology_preview? ? 'Safari Technology Preview' : 'safari'
  super
end