Class: TestCentricity::AppSwitch
- Inherits:
-
AppUIElement
- Object
- AppUIElement
- TestCentricity::AppSwitch
- Defined in:
- lib/testcentricity/app_elements/switch.rb
Instance Attribute Summary
Attributes inherited from AppUIElement
#context, #locator, #name, #parent, #type
Instance Method Summary collapse
-
#initialize(name, parent, locator, context) ⇒ AppSwitch
constructor
A new instance of AppSwitch.
- #off ⇒ Object
- #on ⇒ Object
- #on? ⇒ Boolean
Methods inherited from AppUIElement
#clear, #click, #disabled?, #double_tap, #enabled?, #exists?, #get_attribute, #get_caption, #get_locator, #get_name, #get_object_type, #get_value, #height, #hidden?, #scroll, #selected?, #send_keys, #set, #swipe, #tag_name, #tap, #visible?, #wait_until_enabled, #wait_until_exists, #wait_until_gone, #wait_until_hidden, #wait_until_value_changes, #wait_until_value_is, #wait_until_visible, #width, #x_loc, #y_loc
Constructor Details
#initialize(name, parent, locator, context) ⇒ AppSwitch
Returns a new instance of AppSwitch.
3 4 5 6 |
# File 'lib/testcentricity/app_elements/switch.rb', line 3 def initialize(name, parent, locator, context) super @type = :switch end |
Instance Method Details
#off ⇒ Object
20 21 22 23 24 |
# File 'lib/testcentricity/app_elements/switch.rb', line 20 def off obj = element object_not_found_exception(obj) obj.click if obj.get_value == 1 end |
#on ⇒ Object
14 15 16 17 18 |
# File 'lib/testcentricity/app_elements/switch.rb', line 14 def on obj = element object_not_found_exception(obj) obj.click unless obj.get_value == 1 end |
#on? ⇒ Boolean
8 9 10 11 12 |
# File 'lib/testcentricity/app_elements/switch.rb', line 8 def on? obj = element object_not_found_exception(obj) obj.get_value == 1 end |