Assert on Attribute Value
This document is based on MTA version 1.8.
An Assert on Attribute Value formulates an expected result of an attribute in a Teststep upon execution. It is possible to either define the result to have a single value, or a range that the value should be in. A Teststep can have multiple Asserts on Attribute Value.
An Assert on Attribute Value can be added for:
- an Attribute Value of a created or changed object;
- an Attribute Value of a retrieved object. In that case the assert evaluates the Attribute Value of all retrieved objects;
- the value of a primitive microflow output parameter like string, integer, etc.
Note that there are also Asserts on Object Count, that are added on a retrieve object action, or on a microflow call action.
Each Assert is evaluated after the execution of a Teststep. A Teststep execution fails when the evaluated value does not match to the defined expectation.
|Compare type||The type of comparison to be made. |
- The 'Equals' / 'Not equals' type means that the attribute value should exactly match (or not match, respectively) a single given value.
- The 'Range' / 'Not range' type means that the attribute value should be within (or outside, respectively) the given boundaries. A 'Range' type is only applicable for numeric or date attributes.
- The 'Greater than' / 'Greater than or equal to' means that the attribute value should be higher than (or include, respectively) the given value.
- The 'Less than' / 'Less than or equal to' means that the attribute value should be lower than (or include, respectively) the given value.
|Value||The expected value of the attribute upon executing the test when the selected compare type is 'Equals'. If the asserted value is empty, the result must be empty in order for the assert to pass.|
|Min value||The expected lower boundary of the attribute value if the selected compare type is 'Range'.|
|Max value||The expected higher boundary of the attribute value if the selected compare type is 'Range'.|
|Trim string values||Used to be able trim string values for leading and trailing space characters before evaluating the result (only applicable for string attributes).|
- The compare type is mandatory.
- If the compare type is 'Range', both Min and Max values are mandatory.
The following Assert Compare types are supported for the Mendix data types:
|Does not equal|
|Does not Contain|
|Outside of Range|
|Greater than or Equal to|
|Less than or Equal to|
Actions on an Assert on Attribute Value
View Teststeps that have Asserts
- All Teststeps in a Test Case with one or more Assert, are marked with in the list of Teststeps.
View attributes that have Asserts
- All attributes with one or more Assert are highlighted in the Attributes tab in the Details of teststep pane on the right in the Test Suite overview page.
- If an Assert is included in Data Variation, is also shown.
Add an Assert on Attribute Value
There are multiple ways to add an Assert on Attribute Value:
- Navigate to the "Attributes" tab in the "Details of teststep" pane on the right in the Test Suite overview page. Click on next to the attribute to add the Assert;
- Hover your mouse on a Teststep and click on to open the page where asserts can be configured;
- Click on "Save and configure asserts" after configuring the Teststep. This will show the page where Asserts can be configured. Navigate to the "Attributes" tab, click on the "+ Assertion" button to add the Assert.
Delete an Assert on Attribute Value
- Open the assertion configuration page and go to the Attributes tab.
- Click on on the attribute to delete the Assert from.
Missing anything? Let us know!
Last updated 20 september 2022