Module: Selenium::WebDriver::Safari

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

Defined Under Namespace

Classes: Bridge, Service

Class Method Summary collapse

Class Method Details

.driver_path(warning = true) ⇒ Object



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

def driver_path(warning = true)
  if warning
    warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
      [DEPRECATION] `driver_path` is deprecated. Pass the driver path as an option instead.
      e.g. Selenium::WebDriver.for :safari, driver_path: '/path'
    DEPRECATE
  end

  @driver_path ||= nil
end

.driver_path=(path) ⇒ Object



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

def driver_path=(path)
  warn <<-DEPRECATE.gsub(/\n +| {2,}/, ' ').freeze
    [DEPRECATION] `driver_path=` is deprecated. Pass the driver path as an option instead.
    e.g. Selenium::WebDriver.for :safari, driver_path: '/path'
  DEPRECATE

  Platform.assert_executable path
  @driver_path = path
end

.pathObject



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

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 == :macosx
  raise Error::WebDriverError, 'Unable to find Safari'
end

.path=(path) ⇒ Object



27
28
29
30
# File 'lib/selenium/webdriver/safari.rb', line 27

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