Sha256: 4a4b496e5473a5aff59af4e9a7d884ed1a6b86460df89787b174581d078e53e2

Contents?: true

Size: 1.03 KB

Versions: 120

Compression:

Stored size: 1.03 KB

Contents

module TestCentricity
  class ListCheckBox < ListElement
    attr_accessor :proxy

    def initialize(name, parent, locator, context, list, proxy = nil)
      super
      @type  = :list_checkbox
      @proxy = proxy
    end

    def checked?(row)
      obj, = find_list_element(row)
      list_object_not_found_exception(obj, 'List CheckBox', row)
      obj.checked?
    end

    def set_checkbox_state(row, state)
      obj, = find_list_element(row)
      list_object_not_found_exception(obj, 'List 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} List Checkbox #{object_ref_message}") :
          assert_equal(state, actual, "Expected Row #{row} List 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.3.0 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.25 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.24 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.23 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.22 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.21 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.20 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.19 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.18 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.17 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.16 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.15 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.14 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.13 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.12 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.11 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.10 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.9 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.8 lib/testcentricity_web/web_elements/list_checkbox.rb
testcentricity_web-3.2.7 lib/testcentricity_web/web_elements/list_checkbox.rb