Tag: {Currency}
- Conditions and Restrictions
- Examples of Using the {Currency} Tag in Cyara Test Cases.
- Optional Parameters & Operators for the Currency Tag.
Conditions and Restrictions
- Recognition of Currencies is dependent on the Active Language set in your Cyara Account.
- If an optional variable is specified for the {Currency} Tag, the variable result can not be used in a subsequent dynamic reply.
The Currency tag recognises spoken amounts using currencies specific to your Cyara account active language as shown in the table below:
Language | Currency | Example |
---|---|---|
en-AU | AUD | Two Australian dollars and fifty two cents |
en-AU | none | two dollars and fifty two cents |
en-GB | EUR | two Euros and fifty cents |
en-GB | GBP | two pounds and fifty pence |
en-GB | none | two fifty |
en-US | USD | two U S dollars and fifty cents |
en-US | none | two dollars fifty cents |
es-US | MXN | cinco pesos y cinco centavos |
es-US | none | cinco dólares y cinco centavos |
ja-JP | JPY | にてんれいいちえん |
nl-NL | EUR | vijf euro en vijf cent |
Examples of Using the {Currency} Tag in Cyara Test Cases.
The following scenarios cover how to use the {Currency} Tag in a range of testing situations to accurately recognise spoken monetary values, following onto more advanced implementations of the {Currency} Tag to perform comparison operations.
Scenario 1.
In this Test Case we are using the {Currency} Tag to pass a Test Case step so long as a valid "Dollar" amount (dollar and cents) is spoken during this Test Case Step. Having the Cyara Active Language set to en-US or en-AU will set the {Currency} Tag to recognise these spoken "Dollar" amounts.
This recognition is particularly useful for listening to account balances that could often change, rather than creating a Test Case for each balance, we can use the {Currency} Tag to pass any valid currency.
We hear the audio "Your account balance is two dollars and fifty two cents" which the {Currency} Tag will recognise as a spoken currency, and as a result will mark this Test Case Step as a success.
Actual Audio Heard | Expect to Hear | Outcome |
---|---|---|
Your account balance is two dollars and fifty two cents | Your account balance is {Currency} | Success: When the active language is en-US or en-AU, any prompt saying a valid dollar (or cents-only) amount will match and this Step will be marked as a Success. |
Scenario 2.
To improve our Test Case accuracy further, we will now perform a comparison of the heard currency against a provided value. In this example we want to ensure that the spoken currency value is exactly "£2.52", having the {Currency} Tag recognise British Pounds requires the Active Language on your Cyara account to be set to en-GB.
In this scenario hear the audio "Your account balance is two pounds and fifty two pence" which the {Currency} Tag will recognise as a spoken currency. However this time we are also storing this currency value in the $var Variable in the Expect to Hear field. This Variable is then compared to the supplied value of 2.52 by using the == (EqualTo) Operation.
Actual Audio Heard | Expect to Hear | Outcome |
Your account balance is two pounds and fifty two pence | Your account balance is {Currency $var == 2.52} | Success: As the active language for this account is set to en-GB, the {Currency} Tag would correctly recognise British Pounds. The supplied value of Two Pounds and Fifty Two pence would match 2.52 so the test case step is marked as Success. |
Note: You can use this Test Case example with a range of different operators, such as "==" (EqualTo), "<=" (GreaterOrEqualThan) and more, see the Optional Parameters and Operators table below for more information.
Optional Parameters & Operators for the Currency Tag.
The {Currency} Tag supports the following additional optional parameters and operators.
To use these operators you write the tag using the following syntax.
{Currency $VariableName Operation Value}
For example a Currency Tag that uses a variable called "Currency1" that is performing a GreaterOrEqualTo Operation to the Value of 350 would be expressed as follows.
{Currency $Currency1 >= 350}
To use these operators you write the tag using the following syntax.
Parameter / Operation | Syntax | Description |
<$VariableName> | {Currency $VariableName} |
The {Currency} Tag supports the optional Variable parameter. This variable will be populated with the results of the {Currency} recognition. Using this Variable you can also make comparisons against the Variable, if this comparison fails the step will fail and post a detailed result as follows. |
<$VariableName> EqualTo | {Currency $Variablename == 2} | {Currency} Tag variables can also be used to return a successful step outcome, when the recognised digits Do Match a provided value by using the == (EqualTo) Operation. |
<$VariableName> NotEqualTo | {Currency $Variablename != 2} | {Currency} Tag variables can also be used to return a Successful Step result for a digit that Does Not Match by using the =! (NotEqualTo) operation. |
<$VariableName> GreaterThan | {Currency $Variablename > 2} | Check if the supplied currency is Greater than the supplied value by using > (GreaterThan) operation. |
<$VariableName> LessThan | {Currency $Variablename < 2} | Check if the supplied currency is Less han the supplied value by using > (GreaterThan) operation. |
<$VariableName> GreaterOrEqualThan | {Currency $Variablename >= 2} | The Greater Than or Equal To operations can be combined in the same operation by using the "GreaterOrEqualThan" Operation. If the supplied variable is 2 or greater this example will be marked as Successful. |
<$VariableName> LessOrEqualThan | {Currency $Variablename <= 2} | In the same way, Less Than or Equal To operations can be combined into a single operation by using the "LessOrEqualThan" Operation. If the supplied variable is 2 or less this example will be marked as Successful. |
Comments
0 comments
Please sign in to leave a comment.