Sha256: c3c9d41bf8d7f5d28038dfccb60fda53ffdc6a2143375be2786e7c4fc0157658

Contents?: true

Size: 702 Bytes

Versions: 5

Compression:

Stored size: 702 Bytes

Contents

module PageObject
  module Platforms
    module Selenium
      module UnorderedList

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

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

        private

        def list_items
          element.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/selenium/unordered_list.rb
page-object-0.2.4 lib/page-object/platforms/selenium/unordered_list.rb
page-object-0.2.3 lib/page-object/platforms/selenium/unordered_list.rb
page-object-0.2.2 lib/page-object/platforms/selenium/unordered_list.rb
page-object-0.2.1 lib/page-object/platforms/selenium/unordered_list.rb