Class: TestCentricity::Radio
- Defined in:
- lib/testcentricity_web/elements/radio.rb
Instance Attribute Summary collapse
-
#proxy ⇒ Object
Returns the value of attribute proxy.
Attributes inherited from UIElement
#alt_locator, #context, #locator, #parent, #type
Instance Method Summary collapse
-
#exists? ⇒ Boolean
Does radio button object exists?.
-
#initialize(parent, locator, context, proxy = nil) ⇒ Radio
constructor
A new instance of Radio.
-
#select ⇒ Object
Set the selected state of a radio button object.
-
#selected? ⇒ Boolean
Is radio button selected?.
-
#set_selected_state(state) ⇒ Object
Set the select state of a radio button object.
-
#unselect ⇒ Object
Unselect a radio button object.
Methods inherited from UIElement
#clear_alt_locator, #click, #click_at, #disabled?, #double_click, #drag_and_drop, #drag_by, #enabled?, #get_attribute, #get_locator, #get_native_attribute, #get_object_type, #get_siebel_object_type, #get_value, #hidden?, #hover, #invoke_siebel_dialog, #right_click, #send_keys, #set, #set_alt_locator, #verify_value, #visible?, #wait_until_exists, #wait_until_gone, #wait_until_value_changes, #wait_until_value_is, #wait_until_visible
Constructor Details
#initialize(parent, locator, context, proxy = nil) ⇒ Radio
Returns a new instance of Radio.
5 6 7 8 9 10 11 12 |
# File 'lib/testcentricity_web/elements/radio.rb', line 5 def initialize(parent, locator, context, proxy = nil) @parent = parent @locator = locator @context = context @proxy = proxy @type = :radio @alt_locator = nil end |
Instance Attribute Details
#proxy ⇒ Object
Returns the value of attribute proxy.
3 4 5 |
# File 'lib/testcentricity_web/elements/radio.rb', line 3 def proxy @proxy end |
Instance Method Details
#exists? ⇒ Boolean
Does radio button object exists?
20 21 22 23 |
# File 'lib/testcentricity_web/elements/radio.rb', line 20 def exists? obj, _ = find_object(:all) obj != nil end |
#select ⇒ Object
Set the selected state of a radio button object.
59 60 61 |
# File 'lib/testcentricity_web/elements/radio.rb', line 59 def select set_selected_state(true) end |
#selected? ⇒ Boolean
Is radio button selected?
31 32 33 34 35 |
# File 'lib/testcentricity_web/elements/radio.rb', line 31 def selected? obj, _ = find_element(:all) object_not_found_exception(obj, 'Radio') obj.checked? end |
#set_selected_state(state) ⇒ Object
Set the select state of a radio button object.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/testcentricity_web/elements/radio.rb', line 43 def set_selected_state(state) obj, _ = find_element(:all) object_not_found_exception(obj, 'Radio') invalid_object_type_exception(obj, 'radio') if @proxy.nil? obj.set(state) else @proxy.click unless state == obj.checked? end end |
#unselect ⇒ Object
Unselect a radio button object.
68 69 70 |
# File 'lib/testcentricity_web/elements/radio.rb', line 68 def unselect set_selected_state(false) end |