Working with automated unit tests
When your operator ID has the AutomatedTesting privilege through an access role, you can use the Automated Unit Testing landing page to work with recorded test cases and unit test suites, including playing them back, scheduling when to run them, and examining their results.
AUT information is available on the Testing Applications landing page on Pega Community and in the automated unit testing topics in the help.
Note the following behavior:
-
When you use switch to using AUT (by clicking Switch to old version ), the Test cases tab for activities, decision tables, and decision trees, which are supported by both automated unit testing and automated rule testing, displays options for creating unit test cases.
and clicking -
In the Automated Unit Testing landing page, you can click Switch to new version to restore to the Automated Testing landing page. When you click the Test cases tab in an activity, decision table, or decision tree, the tab displays options for creating Pega unit test cases.
-
If you are using the Automated Unit Testing landing page and then log out of the system, you can click Switch to new version to restore the Automated Testing landing page.
, and then click
Viewing, playing back, and rerecording test cases
- Click the Automated Unit Tests tab.
- Select Unit Test Cases in the Show field.
- To play back a test case, click its name in the Name column.
- To rerecord a test case, right-click the test case name and click
Re-record. Note: If the underlying test case rule belongs to a ruleset that uses the check-out feature, you must have the test case rule checked out to you before re-recording the test case.
Opening rules in test cases and unit test suites
- Click the Automated Unit Tests tab.
- Right-click a test case or suite and click Open to open its rule.
Withdrawing test cases and unit test suites
- Click the Automated Unit Tests tab.
- Right-click a test case or suite and click Withdraw.
Withdrawn test cases and suites are not displayed on the Automated Unit Tests tab.
Unit test suite run results
You can view the results of your recent unit test suite runs in either the Dashboard tab or Reports tab. The Dashboard tab displays the ten most recent runs. The Reports tab displays earlier results and, for a given unit test suite, shows results from the last fifty (50) runs of that unit test suite.
If you ran a unit test against a saved test case for a decision table, decision tree, activity, or Service SOAP rule and selected the All Cases option in the Run Rule form, those results also appear in the Dashboard tab.
For activity test cases, if the activity test case has an approval list, differences are reported only for pages and properties on the list. If the test case has an approval list and the only differences are for pages and properties not on the list, those differences are not reported. If differences are found for items on the approval list, you can remove the item from the approval list for that test case.
Creating and scheduling unit test suites
- Click the Schedule tab.
- Click Create Suite.
- In the New Rule form, enter the requested information for creating a unit test suite.
- Click the Schedule tab.
- Click the Calendar icon in the Schedule column for the unit test suite you want to run.
- In the Pattern section in the Schedule Unit Test Suite window, specify how to run this unit test suite. When the run is complete, the system displays the results in the Dashboard tab. When you select To run immediately, the system runs the test suite in the foreground; for all other options, the system runs the test in the background.
- For scheduled runs, you can specify additional options.
- Select to run the unit test suite by using a different operator ID. In the Advanced Settings section, enter the Operator ID in the Override Default and Run Suite As field. The system runs the unit test suite by using the rulesets and access rights associated with that operator. If the operator ID form has multiple access groups, the default access group is used.
- Send the completion email to multiple email addresses. Use
the Send Completion Email to field to specify the email
addresses.
If you do not want any emails sent, clear the Send Completion Email field.
- Click OK.
By default, the Pega-AutoTest agents run scheduled unit test suites run every five minutes. When the suite is finished, the agent activity sends an email with the results. By default, this email is sent to the operator who requested the unit test suite run and to any email addresses listed in the Send Completion Email array. If no email addresses appear in that field, no email message is sent.