Class: TestCentricity::TextField
- Defined in:
- lib/testcentricity_web/elements/textfield.rb
Instance Attribute Summary
Attributes inherited from UIElement
#alt_locator, #context, #locator, #parent, #type
Instance Method Summary collapse
-
#get_max_length ⇒ Integer
Return maxlength character count of a text field.
-
#get_placeholder ⇒ String
Return placeholder text of a text field.
-
#initialize(parent, locator, context) ⇒ TextField
constructor
A new instance of TextField.
-
#read_only? ⇒ Boolean
Is text field set to read-only?.
Methods inherited from UIElement
#clear_alt_locator, #click, #click_at, #disabled?, #double_click, #drag_by, #enabled?, #exists?, #get_attribute, #get_list_items, #get_locator, #get_native_attribute, #get_object_type, #get_siebel_object_type, #get_value, #hidden?, #hover, #invoke_siebel_dialog, #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) ⇒ TextField
Returns a new instance of TextField.
3 4 5 6 7 8 9 |
# File 'lib/testcentricity_web/elements/textfield.rb', line 3 def initialize(parent, locator, context) @parent = parent @locator = locator @context = context @type = :textfield @alt_locator = nil end |
Instance Method Details
#get_max_length ⇒ Integer
Return maxlength character count of a text field.
29 30 31 32 33 |
# File 'lib/testcentricity_web/elements/textfield.rb', line 29 def get_max_length obj, _ = find_element object_not_found_exception(obj, nil) obj.native.attribute('maxlength') end |
#get_placeholder ⇒ String
Return placeholder text of a text field.
41 42 43 44 45 |
# File 'lib/testcentricity_web/elements/textfield.rb', line 41 def get_placeholder obj, _ = find_element object_not_found_exception(obj, nil) obj.native.attribute('placeholder') end |
#read_only? ⇒ Boolean
Is text field set to read-only?
17 18 19 20 21 |
# File 'lib/testcentricity_web/elements/textfield.rb', line 17 def read_only? obj, _ = find_element object_not_found_exception(obj, nil) !!obj.native.attribute('readonly') end |