Sha256: 1687b300548c6b40b56dc439be4c5a98af519132bcfe3d2d26867a58a21fa40f

Contents?: true

Size: 1.07 KB

Versions: 120

Compression:

Stored size: 1.07 KB

Contents

module TestCentricity
  class CellCheckBox < CellElement
    attr_accessor :proxy

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

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

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

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

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

    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
  end
end

Version data entries

120 entries across 120 versions & 2 rubygems

Version Path
testcentricity_web-3.0.2 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity_web-3.0.1 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity_web-3.0.0 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity-2.4.3 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity_web-2.4.3 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity-2.4.2 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity_web-2.4.2 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity-2.4.1 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity_web-2.4.1 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity-2.4.0 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity_web-2.4.0 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity-2.3.19 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity_web-2.3.19 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity-2.3.18 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity_web-2.3.18 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity-2.3.17 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity_web-2.3.17 lib/testcentricity_web/web_elements/cell_checkbox.rb
testcentricity-2.3.16.1 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity-2.3.16 lib/testcentricity/web_elements/cell_checkbox.rb
testcentricity_web-2.3.16 lib/testcentricity_web/web_elements/cell_checkbox.rb