Cleaning up test data for Pega unit test cases
After a rule is run as part of the test case, it is important to remove the test data, pages, and objects that are created as part of the Pega unit test case to ensure that data is not duplicated when the test is run the next time.
You can configure steps to cleanup the test data after the test case is run, using the Cleanup section under the Setup & Cleanup tab on the Pega unit test case Rule form as shown in the following image.
You can select the Clean up the test data at the end of run checkbox for automatic cleanup of the data. Selecting this checkbox automatically removes the following pages from the system at the end of the test case:
- User pages
- Data pages
- Parameter pages
You can include additional steps to remove data that is not automatically cleaned up by configuring the following actions under the Cleanup section:
- Apply data transform
- Execute activity
For more information about configuring the cleanup steps for a test case, see Cleaning up your test environment.
Note: If the Clean up the test data at the end of run checkbox is not selected, no cleanup happens. All the test data that is created as part of the test case will exist on the system. This is helpful when users want to author dependent test cases, to test complex scenarios.
This Topic is available in the following Module:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?