class TestCentricity::Radio
Attributes
Public Class Methods
# File lib/testcentricity_web/web_elements/radio.rb, line 5 def initialize(name, parent, locator, context, proxy = nil) @name = name @parent = parent @locator = locator @context = context @alt_locator = nil @proxy = proxy @type = :radio set_locator_type end
Public Instance Methods
Is radio button disabled (not enabled)?
@return [Boolean] @example
accept_terms_radio.disabled?
# File lib/testcentricity_web/web_elements/radio.rb, line 55 def disabled? visibility = @proxy.nil? ? true : :all obj, type = find_element(visibility) object_not_found_exception(obj, type) obj.disabled? end
Does radio button object exists?
@return [Boolean] @example
accept_terms_radio.exists?
# File lib/testcentricity_web/web_elements/radio.rb, line 22 def exists? obj, = find_object(:all) obj != nil end
Return radio button caption
@return [Boolean] @example
accept_terms_radio.get_value
# File lib/testcentricity_web/web_elements/radio.rb, line 68 def get_value @proxy.nil? ? super : @proxy.get_value end
Highlight a radio button with a 3 pixel wide, red dashed border for the specified wait time. If wait time is zero, then the highlight will remain until the page is refreshed
@param duration [Integer or Float] wait time in seconds @example
accept_terms_radio.highlight(3)
# File lib/testcentricity_web/web_elements/radio.rb, line 114 def highlight(duration = 1) @proxy.nil? ? super : @proxy.highlight(duration) end
Set the selected state of a radio button object.
@example
accept_terms_radio.select
# File lib/testcentricity_web/web_elements/radio.rb, line 94 def select set_selected_state(true) end
Is radio button selected?
@return [Boolean] @example
accept_terms_radio.selected?
# File lib/testcentricity_web/web_elements/radio.rb, line 33 def selected? obj, = find_element(:all) object_not_found_exception(obj, 'Radio') obj.checked? end
Set the select state of a radio button object.
@param state [Boolean] true = selected / false = unselected @example
accept_terms_radio.set_selected_state(true)
# File lib/testcentricity_web/web_elements/radio.rb, line 78 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
Restore a highlighted radio button's original style
@example
accept_terms_radio.unhighlight
# File lib/testcentricity_web/web_elements/radio.rb, line 123 def unhighlight @proxy.nil? ? super : @proxy.unhighlight end
Unselect a radio button object.
@example
accept_terms_radio.unselect
# File lib/testcentricity_web/web_elements/radio.rb, line 103 def unselect set_selected_state(state = false) end
Is radio button visible?
@return [Boolean] @example
accept_terms_radio.visible?
# File lib/testcentricity_web/web_elements/radio.rb, line 45 def visible? @proxy.nil? ? super : @proxy.visible? end