Module: Selenium::WebDriver::Safari

Defined in:
build/rb/lib/selenium/webdriver/safari.rb,
build/rb/lib/selenium/webdriver/safari/bridge.rb,
build/rb/lib/selenium/webdriver/safari/driver.rb,
build/rb/lib/selenium/webdriver/safari/options.rb,
build/rb/lib/selenium/webdriver/safari/service.rb

Defined Under Namespace

Classes: Bridge, Driver, Options, Service

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.use_technology_previewObject

Returns the value of attribute use_technology_preview.



29
30
31
# File 'build/rb/lib/selenium/webdriver/safari.rb', line 29

def use_technology_preview
  @use_technology_preview
end

Class Method Details

.driver_pathObject



64
65
66
67
68
69
# File 'build/rb/lib/selenium/webdriver/safari.rb', line 64

def driver_path
  WebDriver.logger.deprecate 'Selenium::WebDriver::Safari#driver_path',
                             'Selenium::WebDriver::Safari::Service#driver_path',
                             id: :driver_path
  Selenium::WebDriver::Safari::Service.driver_path
end

.driver_path=(path) ⇒ Object



57
58
59
60
61
62
# File 'build/rb/lib/selenium/webdriver/safari.rb', line 57

def driver_path=(path)
  WebDriver.logger.deprecate 'Selenium::WebDriver::Safari#driver_path=',
                             'Selenium::WebDriver::Safari::Service#driver_path=',
                             id: :driver_path
  Selenium::WebDriver::Safari::Service.driver_path = path
end

.pathObject



49
50
51
52
53
54
55
# File 'build/rb/lib/selenium/webdriver/safari.rb', line 49

def path
  @path ||= '/Applications/Safari.app/Contents/MacOS/Safari'
  return @path if File.file?(@path) && File.executable?(@path)
  raise Error::WebDriverError, 'Safari is only supported on Mac' unless Platform.os.mac?

  raise Error::WebDriverError, 'Unable to find Safari'
end

.path=(path) ⇒ Object



44
45
46
47
# File 'build/rb/lib/selenium/webdriver/safari.rb', line 44

def path=(path)
  Platform.assert_executable(path)
  @path = path
end

.technology_previewObject



31
32
33
# File 'build/rb/lib/selenium/webdriver/safari.rb', line 31

def technology_preview
  "/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/safaridriver"
end

.technology_preview!Object



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

def technology_preview!
  Service.driver_path = technology_preview
  @use_technology_preview = true
end

.technology_preview?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'build/rb/lib/selenium/webdriver/safari.rb', line 40

def technology_preview?
  use_technology_preview
end