Class: SafariBrowser
- Defined in:
- lib/newjs/jstest.rb,
lib/newjs/autotest/javascript_test_ext.rb
Instance Method Summary collapse
-
#setup ⇒ Object
no need to create new Browser, as open command automates this.
- #supported? ⇒ Boolean
-
#teardown ⇒ Object
no need to destroy Browser.
- #to_s ⇒ Object
- #visit(file) ⇒ Object
Methods inherited from Browser
#applescript, #host, #initialize, #linux?, #macos?, #open, #windows?
Constructor Details
This class inherits a constructor from Browser
Instance Method Details
#setup ⇒ Object
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
53 54 55 |
# File 'lib/newjs/jstest.rb', line 53 def supported? macos? end |
#teardown ⇒ Object
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_s ⇒ Object
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 |