Sha256: 97f17b7ded6b5ff45fe0d4ca7954b78bf3548fd9a462f79b67e052b2fa5f11e2

Contents?: true

Size: 817 Bytes

Versions: 5

Compression:

Stored size: 817 Bytes

Contents

module PageObject
  module Platforms
    module LdsWatirWebDriver
      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 => :lds_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

5 entries across 5 versions & 1 rubygems

Version Path
page-object-lds-0.0.14 lib/page-object/platforms/lds_watir_webdriver/ordered_list.rb
page-object-lds-0.0.13 lib/page-object/platforms/lds_watir_webdriver/ordered_list.rb
page-object-lds-0.0.12 lib/page-object/platforms/lds_watir_webdriver/ordered_list.rb
page-object-lds-0.0.11 lib/page-object/platforms/lds_watir_webdriver/ordered_list.rb
page-object-lds-0.0.1 lib/page-object/platforms/lds_watir_webdriver/ordered_list.rb