Class: FirefoxBrowser
- Defined in:
- lib/newjs/jstest.rb,
lib/newjs/autotest/javascript_test_ext.rb
Instance Method Summary collapse
-
#initialize(path = File.join(ENV['ProgramFiles'] || 'c:\Program Files', '\Mozilla Firefox\firefox.exe')) ⇒ FirefoxBrowser
constructor
A new instance of FirefoxBrowser.
-
#setup ⇒ Object
no need to create new Browser, as open command automates this.
-
#teardown ⇒ Object
no need to destroy Browser.
- #to_s ⇒ Object
- #visit(file) ⇒ Object
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
#setup ⇒ Object
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 |
#teardown ⇒ Object
no need to destroy Browser
27 |
# File 'lib/newjs/autotest/javascript_test_ext.rb', line 27 def teardown; end |
#to_s ⇒ Object
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 |