class Watir::Browser

Reopened Watir::Browser class for working with Hanami

Public Class Methods

new(*args) click to toggle source

Will start Hanami instance for Watir automatically and then invoke the original Watir::Browser#initialize method.

# File lib/watir/hanami/browser.rb, line 9
def initialize(*args)
  Hanami.boot
  _original_initialize *args
end
Also aliased as: _original_initialize

Public Instance Methods

_original_goto(url)

@private

Alias for: goto
_original_initialize(*args)

@private

Alias for: new
goto(url) click to toggle source

Opens the url with the browser instance. Will add {Hanami.host} and {Hanami.port} to the url when path is specified.

@example Go to the regular url:

browser.goto "http://google.com"

@example Go to the controller path:

browser.goto home_path

@param [String] url URL to be navigated to.

# 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
Also aliased as: _original_goto