Class sap.ui.test.actions.EnterTextModule: sap/ui/test/actions/EnterText

extends Action


Since: 1.34.
Constructor Summary
new sap.ui.test.actions.EnterText()The EnterText action is used to simulate a user entering texts to inputs.
Method Summary
sap.ui.test.actions.EnterText.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.test.actions.EnterText with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.test.actions.EnterText.getMetadata()Returns a metadata object for class sap.ui.test.actions.EnterText.
executeOn(oControl)Sets focus on given control and triggers Multiple keyboard events on it, one event for every character in the text.
getClearTextFirst()Gets current value of property clearTextFirst.
getText()Gets current value of property text.
setClearTextFirst(bClearTextFirst)Sets a new value for property clearTextFirst.
setText(sText)Sets a new value for property text.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.test.actions.EnterText()
The EnterText action is used to simulate a user entering texts to inputs. EnterText will be executed on a control's focus dom ref. Supported controls are (for other controls this action still might work):
  • sap.m.Input
  • sap.m.SearchField
  • sap.m.TextArea

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

In addition, all settings applicable to the base type sap.ui.test.actions.Action can be used as well.

Method Detail
sap.ui.test.actions.EnterText.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.test.actions.EnterText with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.test.actions.Action.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.test.actions.EnterText.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.test.actions.EnterText.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
executeOn(oControl)
Sets focus on given control and triggers Multiple keyboard events on it, one event for every character in the text. Logs an error if control has no focusable dom ref or is not visible.
Parameters:
{sap.ui.core.Control}oControl the control on which the text event should be entered in.
getClearTextFirst(): boolean
Gets current value of property clearTextFirst.

Default value is true.

Since:
1.38.0 If it is set to false, the current text of the Control will be preserved. By default the current text of the control will be cleared. When the text is going to be cleared, a delete character event will be fired and then the value of the input is emptied. This will trigger a liveChange event on the input with an empty value.
Returns:
{boolean} Value of property clearTextFirst
getText(): string
Gets current value of property text.

The Text that is going to be typed to the control. If you are entering an empty string, the value will be cleared.

Returns:
{string} Value of property text
setClearTextFirst(bClearTextFirst): sap.ui.test.actions.EnterText
Sets a new value for property clearTextFirst.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bClearTextFirst New value for property clearTextFirst
Since:
1.38.0 If it is set to false, the current text of the Control will be preserved. By default the current text of the control will be cleared. When the text is going to be cleared, a delete character event will be fired and then the value of the input is emptied. This will trigger a liveChange event on the input with an empty value.
Returns:
{sap.ui.test.actions.EnterText} Reference to this in order to allow method chaining
Sets a new value for property text.

The Text that is going to be typed to the control. If you are entering an empty string, the value will be cleared.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sText New value for property text
Returns:
{sap.ui.test.actions.EnterText} Reference to this in order to allow method chaining