Sha256: fb11fb05a4e45c643404c49d3970369819fe336e08aa0d646ef80ca7869441d7
Contents?: true
Size: 1.54 KB
Versions: 32
Compression:
Stored size: 1.54 KB
Contents
module TestCentricity class Radio < UIElement attr_accessor :proxy def initialize(parent, locator, context, proxy = nil) @parent = parent @locator = locator @context = context @proxy = proxy @type = :radio @alt_locator = nil end # Does radio button object exists? # # @return [Boolean] # @example # accept_terms_radio.exists? # def exists? obj, _ = find_object(:all) obj != nil end # Is radio button selected? # # @return [Boolean] # @example # accept_terms_radio.selected? # 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) # 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 # Set the selected state of a radio button object. # # @example # accept_terms_radio.select # def select set_selected_state(true) end # Unselect a radio button object. # # @example # accept_terms_radio.unselect # def unselect set_selected_state(false) end end end
Version data entries
32 entries across 32 versions & 1 rubygems