module PageObject::Platforms::SeleniumWebDriver

Selenium implementation of the common functionality found across all elements

Public Class Methods

browser_for(root) click to toggle source
# File lib/page-object/platforms/selenium_webdriver.rb, line 14
def self.browser_for root
  return root if root.is_a?(::Selenium::WebDriver::Driver)
  Selenium::WebDriver::Driver.new(root.send(:bridge))
end
browser_root_for(browser) click to toggle source
# File lib/page-object/platforms/selenium_webdriver.rb, line 23
def self.browser_root_for browser
  browser.find_element(tag_name: 'html')
end
create_page_object(browser) click to toggle source
# File lib/page-object/platforms/selenium_webdriver.rb, line 5
def self.create_page_object(browser)
  SeleniumWebDriver::PageObject.new(browser)
end
is_for?(browser) click to toggle source
# File lib/page-object/platforms/selenium_webdriver.rb, line 9
def self.is_for?(browser)
  require 'selenium-webdriver'
  browser.is_a?(::Selenium::WebDriver::Driver) || browser.is_a?(::Selenium::WebDriver::Element)
end
root_element_for(root) click to toggle source
# File lib/page-object/platforms/selenium_webdriver.rb, line 19
def self.root_element_for root
  Elements::Element.new root, platform: :selenium_webdriver if root.is_a?(::Selenium::WebDriver::Element)
end