Sha256: 8b12ad8c51d5fe2c908455975c750a7185b5d8b067d9bbc760cde5a53b072d61

Contents?: true

Size: 963 Bytes

Versions: 5

Compression:

Stored size: 963 Bytes

Contents

module PageObject
  module Elements
    class SelectList < Element

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

      protected

      def child_xpath
        ".//child::option"
      end

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

      def include_platform_for platform
        super
        if platform[:platform] == :watir_webdriver
          require 'page-object/platforms/watir_webdriver/select_list'
          self.class.send :include, PageObject::Platforms::WatirWebDriver::SelectList
        elsif platform[:platform] == :selenium_webdriver
          require 'page-object/platforms/selenium_webdriver/select_list'
          self.class.send :include, PageObject::Platforms::SeleniumWebDriver::SelectList
        else
          raise ArgumentError, "expect platform to be :watir_webdriver or :selenium_webdriver"
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
page-object-0.5.4 lib/page-object/elements/select_list.rb
page-object-0.5.3 lib/page-object/elements/select_list.rb
page-object-0.5.2 lib/page-object/elements/select_list.rb
page-object-0.5.1 lib/page-object/elements/select_list.rb
page-object-0.5.0 lib/page-object/elements/select_list.rb