Class Celerity::TextField
In: lib/celerity/watir_compatibility.rb
lib/celerity/elements/text_field.rb
Parent: Object

Class representing text field elements

This class is the main class for Text Fields Normally a user would not need to create this object as it is returned by the Watir::Container#text_field method

Methods

Constants

NON_TEXT_TYPES = %w[file radio checkbox submit reset image button hidden]
TAGS = [ Identifier.new('textarea'), Identifier.new('input', :type => ["text", "password", /^(?!(#{ Regexp.union(*NON_TEXT_TYPES) })$)/]) ]
DEFAULT_HOW = :name

External Aliases

drag_contents_to -> dragContentsTo
value -> getContents

Public Instance methods

Append the given value to the text in the text field.

Clear the text field.

Check if the given text fields contains the given String or Regexp.

This bascially just moves the text to the other text field using TextField#append TODO: check if HtmlUnit supports some kind of dragging.

Set the text field to the given value. This ensures execution of JavaScript events (onkeypress etc.), but is slower than +value=+

Returns the text in the text field.

This directly sets the text field to the given value, skipping exectuion of JavaScript events. Use set if you want to run events on text fields.

A boolean version of TextField#contains_text

@param [String, Regexp] expected_text The text to look for. @return [boolean]

[Validate]