lib/testcentricity/app_elements/checkbox.rb in testcentricity-2.3.13 vs lib/testcentricity/app_elements/checkbox.rb in testcentricity-2.3.14

- old
+ new

@@ -1,20 +1,26 @@ module TestCentricity class AppCheckBox < AppUIElement - def initialize(name, parent, strategy, locator, context) + def initialize(name, parent, locator, context) super @type = :checkbox end def checked? - element.attribute('checked') == 'true' + obj = element + object_not_found_exception(obj) + obj.attribute('checked') == 'true' end def check - element.click unless checked? + obj = element + object_not_found_exception(obj) + obj.click unless obj.attribute('checked') == 'true' end def uncheck - element.click if checked? + obj = element + object_not_found_exception(obj) + obj.click if obj.attribute('checked') == 'true' end end end