Sha256: a496eb373ccfadcb113eeb468d59c20f9400b4bd886f256962770990ae130060

Contents?: true

Size: 857 Bytes

Versions: 4

Compression:

Stored size: 857 Bytes

Contents

module PageObject
  module Platforms
    module SeleniumTable      
      
      #
      # Return the PageObject::Elements::TableRow for the index provided.  Index
      # is zero based.
      #
      # @return [PageObject::Elements::TableRow]
      #
      def [](idx)
        eles = table_rows
        PageObject::Elements::TableRow.new(eles[idx], :platform => :selenium)
      end

      #
      # Returns the number of rows in the table.
      #
      def rows
        table_rows.size
      end
 
      #
      # override PageObject::Platforms::SeleniumElement because exists? is not
      # available on a table element in Selenium.
      #
      def exists?
        raise "exists? not available on table element"
      end
      
      private
      
      def table_rows
        @element.find_elements(:xpath, child_xpath)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
page-object-0.2 lib/page-object/platforms/selenium_table.rb
page-object-0.1.1 lib/page-object/platforms/selenium_table.rb
page-object-0.1 lib/page-object/platforms/selenium_table.rb
page-object-0.0.5 lib/page-object/platforms/selenium_table.rb