Class: YuiRestClient::Widgets::Numberbox

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

Overview

Class representing a numberbox in the UI. It can be YIntField.

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

#max_valueInteger

Returns maximum value to set in the numberbox

Examples:

Get maximum value to set numberbox with id ‘test’

{
   "class": "YIntField",
   "debug_label": "label_test",
   "hstretch": true,
   "id": "test",
   "label": "label_test",
   "max_value": 65535,
   "min_value": 0,
   "value": 3260
}
app.numberbox(id: 'test').max_value

Returns:

  • (Integer)

    with maximum value



41
42
43
# File 'lib/yui_rest_client/widgets/numberbox.rb', line 41

def max_value
  property(:max_value)
end

#min_valueInteger

Returns minimum value to set in the numberbox

Examples:

Get minimum value to set numberbox with id ‘test’

{
   "class": "YIntField",
   "debug_label": "label_test",
   "hstretch": true,
   "id": "test",
   "label": "label_test",
   "max_value": 65535,
   "min_value": 0,
   "value": 3260
}
app.numberbox(id: 'test').min_value

Returns:

  • (Integer)

    with minimum value



22
23
24
# File 'lib/yui_rest_client/widgets/numberbox.rb', line 22

def min_value
  property(:min_value)
end

#set(value) ⇒ Numberbox

Sends action to set the value of numberbox.

Examples:

Set text in numberbox with id ‘test’ to 123

app.numberbox(id: 'test').set(123)

Parameters:

  • value (Integer)

    to be set in numberbox

Returns:

  • (Numberbox)

    in case action is successful



50
51
52
53
# File 'lib/yui_rest_client/widgets/numberbox.rb', line 50

def set(value)
  action(action: Actions::ENTER_TEXT, value: value)
  self
end

#valueInteger

Returns number that is currently set for numberbox. Gets value from ‘value’ parameter in JSON representation of YIntField.

Examples:

Get value from numberbox with id “test”

{
   "class": "YIntField",
   "debug_label": "label_test",
   "hstretch": true,
   "id": "test",
   "label": "label_test",
   "max_value": 65535,
   "min_value": 0,
   "value": 3260
}
app.numberbox(id: 'address').value # 3260

Returns:

  • (Integer)

    value



71
72
73
# File 'lib/yui_rest_client/widgets/numberbox.rb', line 71

def value
  property(:value)
end