Sha256: b736cf9b703e064a80bc53365fdf0a3e23ad56784f663030daabb0ca4488bffb

Contents?: true

Size: 1.07 KB

Versions: 20

Compression:

Stored size: 1.07 KB

Contents

module TestCentricity
  class CellCheckBox < CellElement
    attr_accessor :proxy

    def initialize(name, parent, locator, context, table, column, proxy)
      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

20 entries across 20 versions & 1 rubygems

Version Path
testcentricity_web-2.0.17 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.16 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.15 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.14 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.13 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.12 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.11 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.10 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.9 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.8 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.7 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.6 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.5 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.4 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.3 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.2 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.1 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-2.0.0 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-1.0.23 lib/testcentricity_web/elements/cell_checkbox.rb
testcentricity_web-1.0.22 lib/testcentricity_web/elements/cell_checkbox.rb