Class: Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/test/browser.rb,
lib/distil/browser.rb

Direct Known Subclasses

FirefoxBrowser, IEBrowser, SafariBrowser

Instance Method Summary collapse

Instance Method Details

#applescript(script) ⇒ Object



24
25
26
27
# File 'lib/test/browser.rb', line 24

def applescript(script)
  raise "Can't run AppleScript on #{host}" unless macos?
  system "osascript -e '#{script}' 2>&1 >/dev/null"
end

#hostObject



7
8
9
10
# File 'lib/test/browser.rb', line 7

def host
  require 'rbconfig'
  Config::CONFIG['host']
end

#linux?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/test/browser.rb', line 20

def linux?
  host.include?('linux')
end

#macos?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/test/browser.rb', line 12

def macos?
  host.include?('darwin')
end

#open(url) ⇒ Object



4
# File 'lib/test/browser.rb', line 4

def open(url) ; end

#setupObject



3
# File 'lib/test/browser.rb', line 3

def setup ; end

#supported?Boolean

Returns:

  • (Boolean)


2
# File 'lib/test/browser.rb', line 2

def supported?; true; end

#teardownObject



5
# File 'lib/test/browser.rb', line 5

def teardown ; end

#windows?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/test/browser.rb', line 16

def windows?
  host.include?('mswin')
end