Class: SafariBrowser

Inherits:
Browser show all
Defined in:
lib/newjs/jstest.rb,
lib/newjs/autotest/javascript_test_ext.rb

Instance Method Summary collapse

Methods inherited from Browser

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

Constructor Details

This class inherits a constructor from Browser

Instance Method Details

#setupObject

no need to create new Browser, as open command automates this



12
13
14
# File 'lib/newjs/autotest/javascript_test_ext.rb', line 12

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

#supported?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/newjs/jstest.rb', line 53

def supported?
  macos?
end

#teardownObject

no need to destroy Browser



17
18
19
# File 'lib/newjs/autotest/javascript_test_ext.rb', line 17

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

#to_sObject



69
70
71
# File 'lib/newjs/jstest.rb', line 69

def to_s
  "Safari"
end

#visit(file) ⇒ Object



61
62
63
# File 'lib/newjs/jstest.rb', line 61

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