Class: YuiRestClient::Widgets::Radiobutton

Inherits:
Base
  • Object
show all
Defined in:
lib/yui_rest_client/widgets/radiobutton.rb

Overview

Class representing a RadioButton in the UI. It can be YRadioButton.

Instance Method Summary collapse

Methods inherited from Base

#action, #collect_all, #debug_label, #enabled?, #exists?, #initialize, #property

Methods included from YuiRestClient::Waitable

#wait_until, #wait_while

Constructor Details

This class inherits a constructor from YuiRestClient::Widgets::Base

Instance Method Details

#selectRadiobutton

Sends action to select the radiobutton in UI.

Examples:

Select radiobutton with id ‘test’

app.radiobutton(id: 'test').select

Returns:



11
12
13
14
# File 'lib/yui_rest_client/widgets/radiobutton.rb', line 11

def select
  action(action: Actions::SELECT)
  self
end

#selected?Boolean

Returns the state of radiobutton (selected or not). Gets value from ‘value’ parameter in JSON representation of YRadioButton.

Examples:

Get state for radiobutton with id “manual”

{
  "class": "YRadioButton",
  "debug_label": "Manually",
  "id": "manual",
  "label": "&Manually",
  "notify": true,
  "value": false
}
app.radiobutton(id: 'manual').selected? # false

Returns:

  • (Boolean)

    true if the radiobutton is selected, false otherwise.



30
31
32
# File 'lib/yui_rest_client/widgets/radiobutton.rb', line 30

def selected?
  property(:value)
end