Sha256: 701af548eb5dde6edd753b018a205bf05c8da97f2f327b2a05f57a490044eb66

Contents?: true

Size: 952 Bytes

Versions: 5

Compression:

Stored size: 952 Bytes

Contents

require 'mixology'

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.mixin PageObject::Platforms::WatirWebDriver::SelectList
        elsif platform[:platform] == :selenium_webdriver
          require 'page-object/platforms/selenium_webdriver/select_list'
          self.mixin 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.4.4 lib/page-object/elements/select_list.rb
page-object-0.4.3 lib/page-object/elements/select_list.rb
page-object-0.4.2 lib/page-object/elements/select_list.rb
page-object-0.4.1 lib/page-object/elements/select_list.rb
page-object-0.4.0 lib/page-object/elements/select_list.rb