Class: PageObject::Elements::TableRow

Inherits:
Element
  • Object
show all
Includes:
Enumerable
Defined in:
lib/page-object/elements/table_row.rb

Instance Attribute Summary

Attributes inherited from Element

#element

Instance Method Summary collapse

Methods inherited from Element

#==, #check_exists, #check_visible, #children, #disabled?, #drag_and_drop_on, #following_sibling, #following_siblings, #initialize, #method_missing, #name, #parent, plural_form, #preceding_sibling, #preceding_siblings, #present?, #respond_to_missing?, #siblings, #wait_until, #when_not_present, #when_present

Methods included from NestedElements

included

Constructor Details

This class inherits a constructor from PageObject::Elements::Element

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageObject::Elements::Element

Instance Method Details

#[](what) ⇒ Object

Return the PageObject::Elements::TableCell for the index provided. Index is zero based. If the index provided is a String then it will be matched with the text from the columns in the first row. The text can be a substring of the full column text.



21
22
23
24
# File 'lib/page-object/elements/table_row.rb', line 21

def [](what)
  idx = find_index(what)
  idx && cell_items[idx]
end

#columnsObject

Returns the number of columns in the table.



29
30
31
# File 'lib/page-object/elements/table_row.rb', line 29

def columns
  cell_items.size
end

#each(&block) ⇒ Object

iterator that yields with a PageObject::Elements::TableCell



11
12
13
# File 'lib/page-object/elements/table_row.rb', line 11

def each(&block)
  cell_items.each(&block)
end