Class: SeaCucumber::FirefoxBrowser
- Defined in:
- lib/seacucumber/firefox_browser.rb
Instance Method Summary collapse
-
#initialize(path = 'c:\Program Files\Mozilla Firefox') ⇒ FirefoxBrowser
constructor
A new instance of FirefoxBrowser.
- #to_s ⇒ Object
- #visit(url) ⇒ Object
Methods inherited from Browser
#applescript, #host, #linux?, #macos?, #open, #setup, #supported?, #teardown, #windows?
Constructor Details
#initialize(path = 'c:\Program Files\Mozilla Firefox') ⇒ FirefoxBrowser
Returns a new instance of FirefoxBrowser.
4 5 6 |
# File 'lib/seacucumber/firefox_browser.rb', line 4 def initialize(path='c:\Program Files\Mozilla Firefox') @path = path end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/seacucumber/firefox_browser.rb', line 16 def to_s "Firefox" end |
#visit(url) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/seacucumber/firefox_browser.rb', line 8 def visit(url) applescript('tell application "Firefox" to Get URL "' + url + '"') if macos? system("start /D \"#{@path}\" firefox.exe \"#{url}\"") if windows? system("firefox #{url}") if linux? end |