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

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

Constant Summary collapse

CAPABILITIES =
{automatic_inspection: 'safari:automaticInspection',
automatic_profiling: 'safari:automaticProfiling'}.freeze
BROWSER =
'safari'
TECHNOLOGY_PREVIEW =
'Safari Technology Preview'

Constants inherited from Options

Options::GRID_OPTIONS, Options::W3C_OPTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Options

#==, #as_json, #bidi?, chrome, edge, #enable_bidi!, 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 'lib/selenium/webdriver/safari/options.rb', line 24

def options
  @options
end

Instance Method Details

#add_option(name, value = nil) ⇒ Object

Raises:

  • (ArgumentError)


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

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

#browser_nameObject



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

def browser_name
  @options[:browser_name] = Safari.technology_preview? ? TECHNOLOGY_PREVIEW : BROWSER
end

#browser_name=(value) ⇒ Object



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

def browser_name=(value)
  @options[:browser_name] = value
end