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.8.8 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8.7 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8.6.1 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8.6 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8.5 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8.4 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8.3 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8.2 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8.1 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.8 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.7.6 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.7.5.1 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.7.5 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.7.4 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.7.3 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.7.2 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.7.1 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.7.0 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.6.9 lib/page-object/platforms/watir_webdriver/ordered_list.rb
page-object-0.6.8 lib/page-object/platforms/watir_webdriver/ordered_list.rb