Class: TestCentricity::TextField
- Defined in:
- lib/testcentricity_web/elements/textfield.rb
Instance Attribute Summary
Attributes inherited from UIElement
#alt_locator, #context, #locator, #name, #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(name, 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_and_drop, #drag_by, #enabled?, #exists?, #get_attribute, #get_locator, #get_name, #get_native_attribute, #get_object_type, #get_siebel_object_type, #get_value, #hidden?, #hover, #invoke_siebel_dialog, #right_click, #send_keys, #set, #set_alt_locator, #verify_value, #visible?, #wait_until_exists, #wait_until_gone, #wait_until_hidden, #wait_until_value_changes, #wait_until_value_is, #wait_until_visible
Constructor Details
#initialize(name, parent, locator, context) ⇒ TextField
Returns a new instance of TextField.
3 4 5 6 |
# File 'lib/testcentricity_web/elements/textfield.rb', line 3 def initialize(name, parent, locator, context) super @type = :textfield end |
Instance Method Details
#get_max_length ⇒ Integer
Return maxlength character count of a text field.
26 27 28 29 30 31 |
# File 'lib/testcentricity_web/elements/textfield.rb', line 26 def get_max_length obj, = find_element object_not_found_exception(obj, nil) max_length = obj.native.attribute('maxlength') max_length.to_i unless max_length.blank? end |
#get_placeholder ⇒ String
Return placeholder text of a text field.
39 40 41 42 43 |
# File 'lib/testcentricity_web/elements/textfield.rb', line 39 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?
14 15 16 17 18 |
# File 'lib/testcentricity_web/elements/textfield.rb', line 14 def read_only? obj, = find_element object_not_found_exception(obj, nil) !!obj.native.attribute('readonly') end |