Class: Fluent::WebElements::Table

Inherits:
WebElement show all
Includes:
Enumerable
Defined in:
lib/fluent/web_elements/table.rb

Instance Attribute Summary

Attributes inherited from WebElement

#web_element

Instance Method Summary collapse

Methods inherited from WebElement

#class_name, #click, #disabled?, #enabled?, #style, #text

Constructor Details

#initialize(web_element, platform) ⇒ Table

Returns a new instance of Table.



6
7
8
9
# File 'lib/fluent/web_elements/table.rb', line 6

def initialize(web_element, platform)
  @web_element = web_element
  include_platform_specifics_for platform
end

Instance Method Details

#eachFluent::WebElements::TableRow



12
13
14
15
16
# File 'lib/fluent/web_elements/table.rb', line 12

def each
  for index in 1..self.rows do
    yield self[index - 1]
  end
end

#first_rowFluent::WebElements::TableRow



19
20
21
# File 'lib/fluent/web_elements/table.rb', line 19

def first_row
  self[0]
end

#include_platform_specifics_for(platform) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/fluent/web_elements/table.rb', line 36

def include_platform_specifics_for(platform)
  super
  if platform[:platform] == :watir_webdriver
    require 'fluent/platform_watir/platform_web_elements/table'
    self.class.send :include, Fluent::Platforms::WatirWebDriver::Table
  end
end

#initialize_row(element, platform) ⇒ Object



28
29
30
# File 'lib/fluent/web_elements/table.rb', line 28

def initialize_row(element, platform)
  ::Fluent::WebElements::TableRow.new(element, platform)
end

#last_rowFluent::WebElements::TableRow



24
25
26
# File 'lib/fluent/web_elements/table.rb', line 24

def last_row
  self[-1]
end

#row_xpathObject



32
33
34
# File 'lib/fluent/web_elements/table.rb', line 32

def row_xpath
  './/child::tr'
end