Class: Watir::Browser
- Inherits:
-
Object
- Object
- Watir::Browser
- Defined in:
- lib/watir/hanami/browser.rb
Overview
Reopened Watir::Browser class for working with Hanami
Instance Method Summary collapse
-
#goto(url)
Opens the url with the browser instance.
-
#initialize(*args) ⇒ Browser
constructor
Will start Hanami instance for Watir automatically and then invoke the original Watir::Browser#initialize method.
Constructor Details
#initialize(*args) ⇒ Browser
Will start Hanami instance for Watir automatically and then invoke the original Watir::Browser#initialize method.
9 10 11 12 |
# File 'lib/watir/hanami/browser.rb', line 9 def initialize(*args) Hanami.boot _original_initialize *args end |
Instance Method Details
#goto(url)
Opens the url with the browser instance. Will add Hanami.host and Hanami.port to the url when path is specified.
27 28 29 30 |
# File 'lib/watir/hanami/browser.rb', line 27 def goto(url) url = "http://#{Hanami.host}:#{Hanami.port}#{url}" unless url =~ %r{^(about|data|https?):}i _original_goto url end |