When you create a PegaUnit 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.
See Data that you can record for flows and case types for information about the data that you can record.
Some properties, like .pyID, are not processed when a PegaUnit test case is run. These properties vary for every test run. The pxDataCapturePropertyIgnore data transform displays the properties that PegaUnit tests do not process.
Complete the following steps:
Optional: Exclude properties in your work class from the test by modifying the pyDataCapturePropertyIgnores data transform.
Click App > Classes.
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.
From the Action list, select Set.
In the Target field, enter the property that you want to exclude.
Repeat step f through step i to specify additional properties that you want to exclude.
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 Action > Record test case. 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 PegaUnit test case.
See Configuring PegaUnit test cases in the Create Test Case rule form if you are configuring the test case in the Create Test Case rule form. This rule form appears immediately after you create the test case but before you click Create and open or Create and close.
See Modifying PegaUnit test cases in the Edit Test Case rule form if you are configuring the test case in the Edit Test Case rule form. This rule form appears after you click Create and open or Create and close or save the test case.
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.