Sha256: 6e9e75ba6c30b232c8d06223a0014193095a405e056df6e37619ccf9916ec35e

Contents?: true

Size: 962 Bytes

Versions: 3

Compression:

Stored size: 962 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

3 entries across 3 versions & 1 rubygems

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