Class: TestCentricity::CellCheckBox

Inherits:
CellElement show all
Defined in:
lib/testcentricity_web/web_elements/cell_checkbox.rb

Constant Summary

Constants inherited from UIElement

UIElement::CSS_SELECTORS, UIElement::XPATH_SELECTORS

Instance Attribute Summary collapse

Attributes inherited from CellElement

#column, #element_locator, #table

Attributes inherited from UIElement

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

Instance Method Summary collapse

Methods inherited from CellElement

#cell_object_not_found_exception, #click, #exists?, #find_cell_element, #get_native_attribute, #get_value, #set_column

Methods inherited from UIElement

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

Constructor Details

#initialize(name, parent, locator, context, table, column, proxy = nil) ⇒ CellCheckBox

Returns a new instance of CellCheckBox.



5
6
7
8
9
# File 'lib/testcentricity_web/web_elements/cell_checkbox.rb', line 5

def initialize(name, parent, locator, context, table, column, proxy = nil)
  super
  @type  = :cell_checkbox
  @proxy = proxy
end

Instance Attribute Details

#proxyObject

Returns the value of attribute proxy.



3
4
5
# File 'lib/testcentricity_web/web_elements/cell_checkbox.rb', line 3

def proxy
  @proxy
end

Instance Method Details

#check(row) ⇒ Object



23
24
25
# File 'lib/testcentricity_web/web_elements/cell_checkbox.rb', line 23

def check(row)
  set_checkbox_state(row, true)
end

#checked?(row) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/testcentricity_web/web_elements/cell_checkbox.rb', line 11

def checked?(row)
  obj, = find_cell_element(row)
  cell_object_not_found_exception(obj, 'Cell CheckBox', row)
  obj.checked?
end

#set_checkbox_state(row, state) ⇒ Object



17
18
19
20
21
# File 'lib/testcentricity_web/web_elements/cell_checkbox.rb', line 17

def set_checkbox_state(row, state)
  obj, = find_cell_element(row)
  cell_object_not_found_exception(obj, 'Cell CheckBox', row)
  obj.set(state)
end

#uncheck(row) ⇒ Object



27
28
29
# File 'lib/testcentricity_web/web_elements/cell_checkbox.rb', line 27

def uncheck(row)
  set_checkbox_state(row, false)
end

#verify_check_state(row, state, enqueue = false) ⇒ Object



31
32
33
34
35
36
# File 'lib/testcentricity_web/web_elements/cell_checkbox.rb', line 31

def verify_check_state(row, state, enqueue = false)
  actual = checked?(row)
  enqueue ?
      ExceptionQueue.enqueue_assert_equal(state, actual, "Expected Row #{row}/Col #{@column} Cell Checkbox #{object_ref_message}") :
      assert_equal(state, actual, "Expected Row #{row}/Col #{@column} Cell Checkbox #{object_ref_message} to be #{state} but found #{actual} instead")
end