Module: WatirPageHelper

Included in:
Page
Defined in:
lib/watir-page-helper.rb,
lib/watir-page-helper/commands.rb,
lib/watir-page-helper/generated.rb

Overview

A helper mixin to make accessing web elements via Watir-WebDriver easier. This module assumes there is a @browser variable available.

Defined Under Namespace

Modules: ClassMethods, Commands Classes: Page

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.browserObject

Returns the value of attribute browser.



19
20
21
# File 'lib/watir-page-helper/commands.rb', line 19

def browser
  @browser
end

Class Method Details

.closeObject



25
26
27
# File 'lib/watir-page-helper/commands.rb', line 25

def close
  @browser.close
end

.createObject



21
22
23
# File 'lib/watir-page-helper/commands.rb', line 21

def create
  @browser = ::Watir::Browser.new ENV['WEBDRIVER'] || :firefox
end

.included(cls) ⇒ Nil

A method that is called when this Module is included into a class

Parameters:

  • cls (Class)

    The class that this module is being included in the literal expected title for the page

Returns:

  • (Nil)


10
11
12
# File 'lib/watir-page-helper.rb', line 10

def self.included(cls)
  cls.extend ClassMethods
end