Skip to main content
Version: 2.5.0

Assert on Microflow output

Definition

An Assert on Microflow output formulates an expected result of the output value of a Microflow Teststep upon execution, if the microflow returns a primitive datatype (String, Integer, Decimal, Boolean, Datetime or Enumeration).

If the microflow returns an Object or a List of Objects, it is currently only possible to define an Assert on Object count.

It is possible to either define the result to have a single value, or a range that the value should be in.

A Microflow Teststep can have zero or one Assert defined on the output.

When a Teststep uses Data Variation to manipulate Teststep input, the Assert can be applied as a Data Variation Item for each defined variation.

Properties

NameDescription
Compare typeThe type of comparison to be made.
- The 'Equals' / 'Not equals' type means that the value should exactly match (or not match, respectively) a single given value.
- The 'Range' / 'Not range' type means that the value should be within (or outside, respectively) the given boundaries. A 'Range' type is only applicable for Integer, Decimal or Datetime datatypes.
- 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 value should be lower than (or include, respectively) the given value.
ValueThe expected value 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 valueThe expected lower boundary of the value if the selected compare type is 'Range'.
Max valueThe expected higher boundary of the value if the selected compare type is 'Range'.
Trim string valuesUsed to be able trim String values for leading and trailing space characters before evaluating the result (only applicable for the String datatype).

Business rules

The following Assert Compare types are supported for the Mendix data types:

StringIntegerDecimalBooleanDatetimeEnumeration
Equals
Does not equal
Contains
Does not Contain
Within Range
Outside of Range
Greater than
Greater than or Equal to
Less than
Less than or Equal to

Actions on an Assert on Microflow output

Set the Assert

There are multiple ways to add an Assert Microflow output:

  1. Navigate to the "Attributes" tab in the "Details of teststep" pane on the right in the Test Suite overview page. Click on under "Return value of microflow" to set the Assert;
  2. Click on the button on the Teststep where you want to set the assert, and click " Edit asserts" to open the page where asserts can be configured. Click on the " Assert" button to set the Assert;
  3. Click on "Save and configure asserts" after configuring the Teststep. This will show the page where Asserts can be configured. Click on the " Assert" button to set the Assert.

Delete the Assert

  • Click on the button on the Teststep where you want to delete the assert, and click " Edit asserts" to open the page where asserts can be configured;
  • Click on the button.

Feedback?

Missing anything? Let us know!

Last updated: 19 january 2023