class sap.ui.test.matchers.I18NText

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/test/matchers/I18NText
Application Component: CA-UI5-TA

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.


Constructor

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


Properties

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

Methods Overview

Method Description
sap.ui.test.matchers.I18NText.extend

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.

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 "i18n".

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 null or undefined, the default value of the property will be restored.

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 null or undefined, the default value of the property will be restored.

Default value is "i18n".

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 null or undefined, the default value of the property will be restored.

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 null or undefined, the default value of the property will be restored.

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 null or undefined, the default value of the property will be restored.

sap.ui.test.matchers.I18NText.extend

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

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 "i18n".

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

Param Type DefaultValue Description
oControl sap.ui.core.Control

the control that is checked by the matcher

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 null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sKey string

New value for property key

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 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 modelName

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 null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
oParameters any

New value for property parameters

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 null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sPropertyName string

New value for property propertyName

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 null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
bUseLibraryBundle boolean

New value for property useLibraryBundle