Class: Henry::Navigator

Inherits:
Object
  • Object
show all
Defined in:
lib/henry/navigator.rb

Overview

Defines a common interface for managing bowsers.

Instance Method Summary collapse

Constructor Details

#initialize(driver) ⇒ Navigator

Returns a new instance of Navigator.



8
9
10
# File 'lib/henry/navigator.rb', line 8

def initialize(driver)
  @driver = driver
end

Instance Method Details

#closeObject

Closes the curretn browser



13
14
15
# File 'lib/henry/navigator.rb', line 13

def close
  browser.close
end

Navigates the given URL

Parameters:

  • ulr (String)

    the target URL.

Returns:



21
22
23
24
25
# File 'lib/henry/navigator.rb', line 21

def navigate(url)
  browser.goto(url)

  return self 
end

#titleString

Returns the curretn browser title.

Returns:

  • (String)

    the browser title.



30
31
32
# File 'lib/henry/navigator.rb', line 30

def title
  browser.title
end