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#constructor for a general description of the syntax of the settings object.
new sap.ui.test.actions.EnterText(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | Optional ID for the new instance; generated automatically if no non-empty ID is given. Note: this can be omitted, no matter whether |
|
mSettings? | object | Optional object with initial settings for the new instance |
Name | Type | Default Value | Description |
---|---|---|---|
clearTextFirst | boolean | true | If it is set to |
keepFocus | boolean | false | Visibility: public |
pressEnterKey | boolean | false | Visibility: public |
text | string | The Text that is going to be typed to the control. If you are entering an empty string, the value will be cleared. Visibility: public |
Name | Type | Default Value | Description |
---|---|---|---|
idSuffix | string | Use this only if the target property or the default of the action does not work for your control. The id suffix of the DOM Element the press action will be executed on. For most of the controls you do not have to specify this, since the Control Adapters will find the correct DOM Element. But some controls have multiple DOM elements that could be target of your Action. Then you should set this property. For a detailed documentation of the suffix see sap.ui.core.Element#$ |
Method | Description |
---|---|
executeOn |
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. |
sap.ui.test.actions.EnterText.extend |
Creates a new subclass of class sap.ui.test.actions.EnterText with name
|
getClearTextFirst |
Gets current value of property clearTextFirst. If it is set to Default value is |
getKeepFocus |
Gets current value of property keepFocus. Default value is |
sap.ui.test.actions.EnterText.getMetadata |
Returns a metadata object for class sap.ui.test.actions.EnterText. |
getPressEnterKey |
Gets current value of property pressEnterKey. Default value is |
getText |
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. |
setClearTextFirst |
Sets a new value for property clearTextFirst. If it is set to When called with a value of Default value is |
setKeepFocus |
Sets a new value for property keepFocus. When called with a value of Default value is |
setPressEnterKey |
Sets a new value for property pressEnterKey. When called with a value of Default value is |
setText |
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 |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oControl | sap.ui.core.Control |
the control on which the text event should be entered in. |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Gets current value of property clearTextFirst.
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.
Default value is true
.
Returns a metadata object for class sap.ui.test.actions.EnterText.
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.
Sets a new value for property clearTextFirst.
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.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bClearTextFirst | boolean | true |
New value for property |
Sets a new value for property keepFocus.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bKeepFocus | boolean | false |
New value for property |
Sets a new value for property pressEnterKey.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bPressEnterKey | boolean | false |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sText | string |
New value for property |