Sha256: 108fdab1709edf710ceeb2f787408a2e0c09d2a61dda0be7e01e24c16206328c

Contents?: true

Size: 798 Bytes

Versions: 10

Compression:

Stored size: 798 Bytes

Contents

module Fluent
  module Platforms
    module WatirWebDriver
      module TableRow

        # @return [Fluent::WebElements::Cell]
        def [](index)
          index = find_by_title(index) if index.kind_of?(String)
          return nil unless index && columns >= index + 1
          ::Fluent::WebElements::Cell.new(web_element[index], :platform => :watir_webdriver)
        end

        def columns
          web_element.wd.find_elements(:xpath, cell_xpath).size
        end

        def find_by_title(column_text)
          table = web_element.parent
          table = table.parent if table.tag_name == 'tbody'
          first_row = table[0]
          first_row.cells.find_index {|column| column.text.include? column_text}
        end
        
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fluent-0.7.5 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.7.4 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.7.3 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.7.2 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.7.1 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.7.0 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.6.0 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.5.0 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.4.0 lib/fluent/platform_watir/platform_web_elements/table_row.rb
fluent-0.3.0 lib/fluent/platform_watir/platform_web_elements/table_row.rb