The Press
action is used to simulate a press interaction with a control. Most controls are supported, for example buttons, links, list items, tables, filters, and form controls.
The Press
action targets a special DOM element representing the control. This DOM element can be customized.
For most most controls (even custom ones), the DOM focus reference is an appropriate choice. You can choose a different DOM element by specifying its ID suffix. You can do this by directly passing the ID suffix to the Press constructor, or by defining a control adapter.
There are some basic controls for which OPA5 has defined Press
control adapters. For more information, see sap.ui.test.actions.Press.controlAdapters.
new sap.ui.test.actions.Press(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 |
---|---|---|---|
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 a 'tap' event on it (which is internally translated into a 'press' event). Logs an error if control is not visible (i.e. has no dom representation) |
sap.ui.test.actions.Press.extend |
Creates a new subclass of class sap.ui.test.actions.Press with name
|
sap.ui.test.actions.Press.getMetadata |
Returns a metadata object for class sap.ui.test.actions.Press. |
Sets focus on given control and triggers a 'tap' event on it (which is internally translated into a 'press' event). Logs an error if control is not visible (i.e. has no dom representation)
Param | Type | DefaultValue | Description |
---|---|---|---|
oControl | sap.ui.core.Control |
the control on which the 'press' event is triggered |
Creates a new subclass of class sap.ui.test.actions.Press 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 |