module PageObject::Platforms::WatirWebDriver

Watir implementation of the common functionality found across all elements

Public Class Methods

browser_for(root) click to toggle source
# File lib/page-object/platforms/watir_webdriver.rb, line 14
def self.browser_for root
  return root if root.is_a?(::Watir::Browser)
  root.browser
end
browser_root_for(browser) click to toggle source
# File lib/page-object/platforms/watir_webdriver.rb, line 23
def self.browser_root_for browser
  browser.element
end
create_page_object(browser) click to toggle source
# File lib/page-object/platforms/watir_webdriver.rb, line 5
def self.create_page_object(browser)
  return WatirWebDriver::PageObject.new(browser)
end
is_for?(browser) click to toggle source
# File lib/page-object/platforms/watir_webdriver.rb, line 9
def self.is_for?(browser)
  require 'watir-webdriver'
  browser.is_a?(::Watir::Browser) || browser.is_a?(::Watir::HTMLElement)
end
root_element_for(root) click to toggle source
# File lib/page-object/platforms/watir_webdriver.rb, line 19
def self.root_element_for root
  Elements::Element.new root, :platform => :watir_webdriver if root.is_a? ::Watir::HTMLElement
end