Sha256: 964d6971c86b8a17b95c09df73dffda23361d7b4f83d5c356d6b3696eb541a81

Contents?: true

Size: 861 Bytes

Versions: 46

Compression:

Stored size: 861 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)
          children[idx]
        end

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

        private

        def children
          items = list_items.map do |item|
            ::PageObject::Elements::ListItem.new(item, :platform => :selenium_webdriver)
          end
          items.find_all { |item| item.parent.element == element }
        end

        def list_items
          element.find_elements(:xpath, child_xpath)
        end

      end
    end
  end
end

Version data entries

46 entries across 46 versions & 3 rubygems

Version Path
page_object-1.1.3 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page_object-1.1.2 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page_object-1.1.1 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.1.0 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.0.3 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
meeane-page-object-0.1.11 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.0.2 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.0.1 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-1.0 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.8 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.7 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.6 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.5 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.4 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.3 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.2 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.1 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.9.0 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.8.10 lib/page-object/platforms/selenium_webdriver/ordered_list.rb
page-object-0.8.9 lib/page-object/platforms/selenium_webdriver/ordered_list.rb