Sha256: cc0ffde152d9c37bbe3620b6d2d7b6cf995eb8165278fd10322a4b1b52a95d6a

Contents?: true

Size: 1004 Bytes

Versions: 15

Compression:

Stored size: 1004 Bytes

Contents

module PageObject
  module Platforms
    module WatirWebDriver
      module SelectList

        #
        # Return the PageObject::Elements::Option for the index provided.  Index
        # is zero based.
        #
        # @return [PageObject::Elements::Option]
        #
        def [](idx)
          Object::PageObject::Elements::Option.new(options[idx], :platform => :watir_webdriver)
        end

        #
        # Select a value from the list
        #
        def select(value)
          @element.select(value)
        end

        #
        # Return an array of Options contained in the select lit.
        #
        # @return [array of PageObject::Elements::Option]
        #
        def options
          elements = []
          options = @element.wd.find_elements(:xpath, child_xpath)
          options.each do |opt|
            elements << Object::PageObject::Elements::Option.new(opt, :platform => :watir_webdriver)
          end
          elements
        end
      end
    end
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
page-object-0.6 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.5.5 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.5.4 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.5.3 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.5.2 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.5.1 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.5.0 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.4.4 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.4.3 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.4.2 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.4.1 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.4.0 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.3.2 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.3.1 lib/page-object/platforms/watir_webdriver/select_list.rb
page-object-0.3.0 lib/page-object/platforms/watir_webdriver/select_list.rb