Sha256: d1c7462be6eae6ba30b98071bd5d98b2a8c01f33ee38dabffceccbd5e77002fc

Contents?: true

Size: 824 Bytes

Versions: 3

Compression:

Stored size: 824 Bytes

Contents

module PageObject
  module Elements
    class Link < Element

      def initialize(element, platform)
        @element = element
        include_platform_for platform
      end

      protected

      def self.watir_finders
        super + [:href, :text]
      end

      def self.watir_mapping
        super.merge({:link => :text, :link_text => :text})
      end

      def self.selenium_finders
        super + [:link, :link_text]
      end

      def self.selenium_mapping
        super.merge(:text => :link_text)
      end

      def include_platform_for platform
        super
        if platform[:platform] == :selenium_webdriver
          require 'page-object/platforms/selenium_webdriver/link'
          self.class.send :include, PageObject::Platforms::SeleniumWebDriver::Link
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
page-object-0.3.2 lib/page-object/elements/link.rb
page-object-0.3.1 lib/page-object/elements/link.rb
page-object-0.3.0 lib/page-object/elements/link.rb