When you create a unit test case for a flow or case type, you run the flow or case type
and enter data for assignments and decisions. The system records the data that you enter in a
data transform, which is created after you save the test form. You can start recording at any
time.
For information about the data that you can record, see Data that you can record for flows and case types.
Some properties, like .pyID, are not processed when a Pega unit test
case is run. These properties vary for every test run. The pxDataCapturePropertyIgnore data
transform displays the properties that Pega unit tests do not process.
-
Exclude properties in your work class from the test by modifying the
pyDataCapturePropertyIgnores data transform.
Complete the following steps:
-
Click .
-
In the search field, enter
Work-
.
-
Expand Data Model > Data Transform.
-
Click the pyDataCapturePropertyIgnores data transform.
-
Save the data transform to your Work- class and in your test
ruleset.
-
On the Definition tab, click the plus sign.
-
From the Action list, select
Set.
-
In the Target field, enter the property that you want to
exclude.
-
In the Source field, enter two double quotation marks,
separated by a space
" "
.
-
To specify additional properties that you want to exclude, repeat step f through
step i.
-
Save the data transform.
-
Complete one of the following tasks:
- Open a flow by searching for it or by using the Application Explorer.
- Open a case type by clicking Cases and then clicking the
case type that you want to open.
-
From the toolbar, click . The system starts running the flow or case type.
-
Enter input as you step through the flow or case type.
-
Click Create test case in the bottom right corner of the browser
to start recording the test case and create a test case in a new tab. The test case
contains all the information that you entered up until you created the test case.
You can continue to run the flow or case type and create additional test cases in the
tab that is running the flow or case type.
-
Configure the unit test case. See Modifying Pega unit test cases for more information.
Result:
After you save the test case, a data transform, which captures the input that you entered,
is created and associated with the test case. You can edit this data transform to modify the
test case input. The Edit test case form also displays the path of the flow or case
type.