Sha256: 5e6f0174fb5fdc771165e8a1b8bd9f64bad36f79392180e9d2da80169926bf44

Contents?: true

Size: 1006 Bytes

Versions: 13

Compression:

Stored size: 1006 Bytes

Contents

module PageObject
  module Elements
    class Button < Element

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

      protected

      def self.watir_finders
        super + [:text, :value, :src, :alt, :css]
      end

      def self.selenium_finders
        super + [:value, :src, :alt, :css]
      end

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

    ::PageObject::Elements.type_to_class[:submit] = ::PageObject::Elements::Button
    ::PageObject::Elements.type_to_class[:image] = ::PageObject::Elements::Button
    ::PageObject::Elements.type_to_class[:button] = ::PageObject::Elements::Button
    ::PageObject::Elements.type_to_class[:reset] = ::PageObject::Elements::Button
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
page-object-0.7.5.1 lib/page-object/elements/button.rb
page-object-0.7.5 lib/page-object/elements/button.rb
page-object-0.7.4 lib/page-object/elements/button.rb
page-object-0.7.3 lib/page-object/elements/button.rb
page-object-0.7.2 lib/page-object/elements/button.rb
page-object-0.7.1 lib/page-object/elements/button.rb
page-object-0.7.0 lib/page-object/elements/button.rb
page-object-0.6.9 lib/page-object/elements/button.rb
page-object-0.6.8 lib/page-object/elements/button.rb
page-object-0.6.7 lib/page-object/elements/button.rb
page-object-0.6.6 lib/page-object/elements/button.rb
page-object-0.6.5 lib/page-object/elements/button.rb
page-object-0.6.4 lib/page-object/elements/button.rb