The I18NText matcher checks if a control property has the same value as a text from an I18N file.
The matcher automatically:
As of version 1.72, it is available as a declarative matcher with the following syntax: {
i18NText: {
propertyName: "string",
key: "string",
parameters: "any",
modelName: "string"
}
}
As of version 1.95 if the useLibraryBundle
flag is set to true
, the library resource bundle of the control is used to resolve the i18n key.
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.matchers.I18NText(mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
mSettings? | object | optional map/JSON-object with initial settings for the new I18NText |
Name | Type | Default Value | Description |
---|---|---|---|
key | string | The key of the I18N text in the containing module:sap/base/i18n/ResourceBundle. Visibility: public |
|
modelName | string | i18n | The name of the sap.ui.model.resource.ResourceModel assigned to the control. Visibility: public |
parameters | any | The parameters for replacing the placeholders of the I18N text. See module:sap/base/i18n/ResourceBundle#getText. Visibility: public |
|
propertyName | string | The name of the control property to match the I18N text with. Visibility: public |
|
useLibraryBundle | boolean | The boolean flag to indicate whether to utiliize the library bundle of the control Visibility: public |
Method | Description |
---|---|
sap.ui.test.matchers.I18NText.extend |
Creates a new subclass of class sap.ui.test.matchers.I18NText with name
|
getKey |
Gets current value of property key. The key of the I18N text in the containing module:sap/base/i18n/ResourceBundle. |
sap.ui.test.matchers.I18NText.getMetadata |
Returns a metadata object for class sap.ui.test.matchers.I18NText. |
getModelName |
Gets current value of property modelName. The name of the sap.ui.model.resource.ResourceModel assigned to the control. Default value is |
getParameters |
Gets current value of property parameters. The parameters for replacing the placeholders of the I18N text. See module:sap/base/i18n/ResourceBundle#getText. |
getPropertyName |
Gets current value of property propertyName. The name of the control property to match the I18N text with. |
getUseLibraryBundle |
Gets current value of property useLibraryBundle. The boolean flag to indicate whether to utiliize the library bundle of the control |
isMatching |
Checks if the control has a property that matches the I18N text |
setKey |
Sets a new value for property key. The key of the I18N text in the containing module:sap/base/i18n/ResourceBundle. When called with a value of |
setModelName |
Sets a new value for property modelName. The name of the sap.ui.model.resource.ResourceModel assigned to the control. When called with a value of Default value is |
setParameters |
Sets a new value for property parameters. The parameters for replacing the placeholders of the I18N text. See module:sap/base/i18n/ResourceBundle#getText. When called with a value of |
setPropertyName |
Sets a new value for property propertyName. The name of the control property to match the I18N text with. When called with a value of |
setUseLibraryBundle |
Sets a new value for property useLibraryBundle. The boolean flag to indicate whether to utiliize the library bundle of the control When called with a value of |
Creates a new subclass of class sap.ui.test.matchers.I18NText 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.matchers.Matcher.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 key.
The key of the I18N text in the containing module:sap/base/i18n/ResourceBundle.
Returns a metadata object for class sap.ui.test.matchers.I18NText.
Gets current value of property modelName.
The name of the sap.ui.model.resource.ResourceModel assigned to the control.
Default value is "i18n"
.
Gets current value of property parameters.
The parameters for replacing the placeholders of the I18N text. See module:sap/base/i18n/ResourceBundle#getText.
Gets current value of property propertyName.
The name of the control property to match the I18N text with.
Gets current value of property useLibraryBundle.
The boolean flag to indicate whether to utiliize the library bundle of the control
Checks if the control has a property that matches the I18N text
Param | Type | DefaultValue | Description |
---|---|---|---|
oControl | sap.ui.core.Control |
the control that is checked by the matcher |
Sets a new value for property key.
The key of the I18N text in the containing module:sap/base/i18n/ResourceBundle.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sKey | string |
New value for property |
Sets a new value for property modelName.
The name of the sap.ui.model.resource.ResourceModel assigned to the control.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "i18n"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sModelName | string | "i18n" |
New value for property |
Sets a new value for property parameters.
The parameters for replacing the placeholders of the I18N text. See module:sap/base/i18n/ResourceBundle#getText.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
oParameters | any |
New value for property |
Sets a new value for property propertyName.
The name of the control property to match the I18N text with.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sPropertyName | string |
New value for property |
Sets a new value for property useLibraryBundle.
The boolean flag to indicate whether to utiliize the library bundle of the control
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
bUseLibraryBundle | boolean |
New value for property |