Class: SeaCucumber::SafariBrowser

Inherits:
Browser
  • Object
show all
Defined in:
lib/seacucumber/safari_browser.rb

Overview

TODO need to update this to support Safari on Windows

Instance Method Summary collapse

Methods inherited from Browser

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

Instance Method Details

#setupObject



9
10
11
# File 'lib/seacucumber/safari_browser.rb', line 9

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

#supported?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/seacucumber/safari_browser.rb', line 5

def supported?
  macos?
end

#teardownObject



17
18
19
# File 'lib/seacucumber/safari_browser.rb', line 17

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

#to_sObject



21
22
23
# File 'lib/seacucumber/safari_browser.rb', line 21

def to_s
  "Safari"
end

#visit(url) ⇒ Object



13
14
15
# File 'lib/seacucumber/safari_browser.rb', line 13

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