Class: TestCentricity::CellElement

Inherits:
UIElement show all
Defined in:
lib/testcentricity_web/elements/cell_element.rb

Direct Known Subclasses

CellButton, CellCheckBox, CellRadio

Instance Attribute Summary collapse

Attributes inherited from UIElement

#alt_locator, #context, #locator, #name, #parent, #type

Instance Method Summary collapse

Methods inherited from UIElement

#clear_alt_locator, #click_at, #disabled?, #double_click, #drag_and_drop, #drag_by, #enabled?, #get_attribute, #get_locator, #get_name, #get_native_attribute, #get_object_type, #get_siebel_object_type, #get_value, #hidden?, #hover, #invoke_siebel_dialog, #right_click, #send_keys, #set, #set_alt_locator, #verify_value, #visible?, #wait_until_exists, #wait_until_gone, #wait_until_hidden, #wait_until_value_changes, #wait_until_value_is, #wait_until_visible

Constructor Details

#initialize(name, parent, locator, context, table, column) ⇒ CellElement

Returns a new instance of CellElement.



6
7
8
9
10
11
12
13
14
# File 'lib/testcentricity_web/elements/cell_element.rb', line 6

def initialize(name, parent, locator, context, table, column)
  @name        = name
  @parent      = parent
  @context     = context
  @alt_locator = nil
  @table       = table
  @column      = column
  @locator     = "#{@table.get_table_cell_locator('ROW_SPEC', column)}/#{locator}"
end

Instance Attribute Details

#columnObject

Returns the value of attribute column.



4
5
6
# File 'lib/testcentricity_web/elements/cell_element.rb', line 4

def column
  @column
end

#tableObject

Returns the value of attribute table.



3
4
5
# File 'lib/testcentricity_web/elements/cell_element.rb', line 3

def table
  @table
end

Instance Method Details

#cell_object_not_found_exception(obj, obj_type, row) ⇒ Object



32
33
34
# File 'lib/testcentricity_web/elements/cell_element.rb', line 32

def cell_object_not_found_exception(obj, obj_type, row)
  object_not_found_exception(obj, "Row #{row}/Col #{@column} #{obj_type}")
end

#click(row) ⇒ Object



21
22
23
24
25
# File 'lib/testcentricity_web/elements/cell_element.rb', line 21

def click(row)
  obj, = find_cell_element(row)
  cell_object_not_found_exception(obj, @type, row)
  obj.click
end

#exists?(row) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/testcentricity_web/elements/cell_element.rb', line 16

def exists?(row)
  obj, = find_cell_element(row)
  obj != nil
end

#find_cell_element(row) ⇒ Object



27
28
29
30
# File 'lib/testcentricity_web/elements/cell_element.rb', line 27

def find_cell_element(row)
  set_alt_locator("#{@locator.gsub('ROW_SPEC', row.to_s)}")
  find_element
end