Sha256: e8c6381d0ca5f7072b1e9b579dbeaa19ab2a1032b4ba3e879d966d7eda84c495

Contents?: true

Size: 929 Bytes

Versions: 18

Compression:

Stored size: 929 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, :css, :title]
      end

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

      def self.selenium_finders
        super + [:link, :link_text, :title]
      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
    
    ::PageObject::Elements.tag_to_class[:a] = ::PageObject::Elements::Link

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
page-object-0.9.4 lib/page-object/elements/link.rb
page-object-0.9.3 lib/page-object/elements/link.rb
page-object-0.9.2 lib/page-object/elements/link.rb
page-object-0.9.1 lib/page-object/elements/link.rb
page-object-0.9.0 lib/page-object/elements/link.rb
page-object-0.8.10 lib/page-object/elements/link.rb
page-object-0.8.9 lib/page-object/elements/link.rb
page-object-0.8.8 lib/page-object/elements/link.rb
page-object-0.8.7 lib/page-object/elements/link.rb
page-object-0.8.6.1 lib/page-object/elements/link.rb
page-object-0.8.6 lib/page-object/elements/link.rb
page-object-0.8.5 lib/page-object/elements/link.rb
page-object-0.8.4 lib/page-object/elements/link.rb
page-object-0.8.3 lib/page-object/elements/link.rb
page-object-0.8.2 lib/page-object/elements/link.rb
page-object-0.8.1 lib/page-object/elements/link.rb
page-object-0.8 lib/page-object/elements/link.rb
page-object-0.7.6 lib/page-object/elements/link.rb