Sha256: 5717bd4c07037e637b7ebf17d776b217453321ae50bb5f0df4ad1839d50ec501

Contents?: true

Size: 965 Bytes

Versions: 5

Compression:

Stored size: 965 Bytes

Contents

module PageObject
  module Platforms
    module SeleniumWebDriver
      module OrderedList

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

        #
        # Return the number of items contained in the ordered list
        #
        def items
          children.size
        end

        #
        # Return the ListItem objects that are children of the OrderedList
        #
        def list_items
          children.collect do |obj|
            Object::PageObject::Elements::ListItem.new(obj, :platform => :selenium_webdriver)
          end
        end

        private

        def children
          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-2.0.0 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.2.2 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.2.1 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.2.0 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.1.1 lib/page-object/platforms/selenium_webdriver/ordered_list.rb