Class: SafariBrowser

Inherits:
Browser show all
Defined in:
lib/test/browser.rb

Instance Method Summary collapse

Methods inherited from Browser

#applescript, #host, #linux?, #macos?, #open, #windows?

Instance Method Details

#setupObject



51
52
53
# File 'lib/test/browser.rb', line 51

def setup
  applescript('tell application "Safari" to make new document')
end

#supported?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/test/browser.rb', line 47

def supported?
  macos?
end

#teardownObject



59
60
61
# File 'lib/test/browser.rb', line 59

def teardown
  #applescript('tell application "Safari" to close front document')
end

#to_sObject



63
64
65
# File 'lib/test/browser.rb', line 63

def to_s
  "Safari"
end

#visit(url) ⇒ Object



55
56
57
# File 'lib/test/browser.rb', line 55

def visit(url)
  applescript('tell application "Safari" to set URL of front document to "' + url + '"')
end