Sha256: 2ecf944d42d19c3354c2fd80e0fdc4f45caa81291f4477e222656b416687eb22

Contents?: true

Size: 775 Bytes

Versions: 46

Compression:

Stored size: 775 Bytes

Contents

module PageObject
  module Platforms
    module WatirWebDriver
      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 => :watir_webdriver)
        end

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

        private

        def children
          list_items.find_all { |item| item.parent == element }
        end

        def list_items
          element.ols(:xpath => child_xpath)
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 3 rubygems

Version Path
page-object-0.6.7 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.6.6 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.6.5 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.6.4 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.6.3 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.6.2 lib/page-object/platforms/watir_webdriver/ordered_list.rb