class PageObject::Elements::Link

Public Class Methods

new(element, platform) click to toggle source
# File lib/page-object/elements/link.rb, line 6
def initialize(element, platform)
  @element = element
  include_platform_for platform
end

Protected Class Methods

selenium_finders() click to toggle source
# File lib/page-object/elements/link.rb, line 21
def self.selenium_finders
  super + [:link, :link_text, :title]
end
selenium_mapping() click to toggle source
# File lib/page-object/elements/link.rb, line 25
def self.selenium_mapping
  super.merge(:text => :link_text)
end
watir_finders() click to toggle source
# File lib/page-object/elements/link.rb, line 13
def self.watir_finders
  super + [:href, :text, :css, :title]
end
watir_mapping() click to toggle source
# File lib/page-object/elements/link.rb, line 17
def self.watir_mapping
  super.merge({:link => :text, :link_text => :text})
end

Protected Instance Methods

include_platform_for(platform) click to toggle source
# File lib/page-object/elements/link.rb, line 29
def include_platform_for platform
  super
  if platform[:platform] == :watir_webdriver
    require 'page-object/platforms/watir_webdriver/link'
    self.class.send :include, PageObject::Platforms::WatirWebDriver::Link
  elsif platform[:platform] == :selenium_webdriver
    require 'page-object/platforms/selenium_webdriver/link'
    self.class.send :include, PageObject::Platforms::SeleniumWebDriver::Link
  else
    raise ArgumentError, "expect platform to be :watir_webdriver or :selenium_webdriver"
  end
end