Class: FirefoxBrowser

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, #linux?, #macos?, #open, #supported?, #windows?

Constructor Details

#initialize(path = File.join(ENV['ProgramFiles'] || 'c:\Program Files', '\Mozilla Firefox\firefox.exe')) ⇒ FirefoxBrowser

Returns a new instance of FirefoxBrowser.



37
38
39
# File 'lib/newjs/jstest.rb', line 37

def initialize(path=File.join(ENV['ProgramFiles'] || 'c:\Program Files', '\Mozilla Firefox\firefox.exe'))
  @path = path
end

Instance Method Details

#setupObject

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



21
# File 'lib/newjs/autotest/javascript_test_ext.rb', line 21

def setup; end

#teardownObject

no need to destroy Browser



27
# File 'lib/newjs/autotest/javascript_test_ext.rb', line 27

def teardown; end

#to_sObject



47
48
49
# File 'lib/newjs/jstest.rb', line 47

def to_s
  "Firefox"
end

#visit(file) ⇒ Object



41
42
43
44
45
# File 'lib/newjs/jstest.rb', line 41

def visit(url)
  system("open -a Firefox '#{url}'") if macos?
  system("#{@path} #{url}") if windows? 
  system("firefox #{url}") if linux?
end