- 28 Dec 2021
- 3 Minutes to read
About Unit Testing & Debugging
- Updated on 28 Dec 2021
- 3 Minutes to read
When creating a Flow, users may utilize Sample Data to ensure that the Flow is operating correctly. Sample Data is a specified set of input values. Additionally, users can also create Unit Tests to further check their Flow's operation. Unit Tests are inputs with assertions about what happens to them in addition to a Rule that evaluates the step results and the path that the particular Flow follows. Unit Tests simulate the user filling in a Form by combining input data with different behaviors to test for particular data needed for the Flow steps. These Unit Tests are also available inside the Debugger, providing the ability to run the Debugger with a set of constant input data. Unit tests allow designers to create permanent test cases that exist with the Flow and can always be returned to test and make sure that the Flow is working correctly. These tests can be located and created from within the designer folder as well as the Flow designer.
Unit Tests are inputs with assertions about what happens to them and are run from the Flow Designer or Debugger. They behave like regular tests in the Debugger, but allow users to define Flow Input data; this prevents the need to manually input a value each time the test is ran. Unit Tests can be helpful during the development of a Flow that uses many Input Data.
Begin by creating Sample Data. Sample Data will be available on any Flow that has the same input parameters on the object itself. The newly created Sample Data can be used as is, or as means to begin creating a Unit Test. Unit Tests and Sample Data can be located by right-clicking on the Flow in the designer folders or by selecting Data Samples from the action panel inside of the Flow on the left side of the Flow designer. Running Unit Tests on a Flow
The Debugger runs, tests, and experiments with a workflow in order to look at the data that was mapped into the step and also the data that was mapped out of the step. The Debugger allows designers to understand all of the interactions about a Flow.
Sample Data Storage and Management
Sample Data functions similar to Unit Test data, but Sample Data is global for any Flow that expects input values of the same name and type. For Flows, only a few hundred entries of Sample Data are stored at a time. Therefore, it is important to periodically clean up and delete any old Data Samples, to make room for new ones.
Decisions deletes the oldest entries, but cannot cleanup manually created Sample Data. Such types of excluded data includes, manually created entries from within the Debugger and those created via the Save Sample Data step. These collections of data me be found at data_sample_table 2 and flow_data_sample_table respectively.
Sample Data can be deleted through a number of methods including but not limited to:
Deleting the Sample Data within the Debugger by selecting the Data and clicking Delete.
By selecting the Delete (X) icon on a piece of Sample Data from the Data Samples tab located on the left side of the screen.
Utilizing a DeleteSample step found in the Steps Catalog under Integration > Internal Services > SampleService > DeleteSample.
Deleting Debugger generated data from the Test Data Folder by right-clicking the Sample Data and selecting Delete Data Sample.