Sha256: dc1df1290a49c412f9914c93eecf5c4a5934e7c2c9fdb130d29db60ae7c5f050

Contents?: true

Size: 691 Bytes

Versions: 5

Compression:

Stored size: 691 Bytes

Contents

module PageObject
  module Platforms
    module Watir
      module UnorderedList

        #
        # Return the PageObject::Elements::ListItem for the index provided.  Index
        # is zero based.
        #
        # @return [PageObject::Elements::ListItem]
        #
        def [](idx)
          eles = list_items
          PageObject::Elements::ListItem.new(eles[idx], :platform => :watir)
        end

        #
        # Return the number of items contained in the unordered list
        #
        def items
          list_items.size
        end

        private

        def list_items
          element.wd.find_elements(:xpath, child_xpath)
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
page-object-0.2.5 lib/page-object/platforms/watir/unordered_list.rb
page-object-0.2.4 lib/page-object/platforms/watir/unordered_list.rb
page-object-0.2.3 lib/page-object/platforms/watir/unordered_list.rb
page-object-0.2.2 lib/page-object/platforms/watir/unordered_list.rb
page-object-0.2.1 lib/page-object/platforms/watir/unordered_list.rb