After you create a harness rule, you can run the rule to test it in the context of the
application you are developing. Specify a test page for the rule to use, provide sample data as
the input, run the rule, and examine the results.
Before you begin: Create and open the harness rule that you want to test. For more information, see
Harness form -. Determine how you will provide the sample data to use when testing the
rule. If possible, open a work item of the appropriate class.
- In the navigation pane of Dev Studio, click , and then select the harness you want to test.
-
Click Actions > Run. The Run Rule window opens.
-
In the Test Page pane, select the context and test page to use for the
test.
-
In the Data Context list, select the thread in which you want to run the
rule. If a test page exists for the thread, then it is listed and can be used for
creating the test page.
-
Select the test page to use for the test:
- Select Empty test page to start from a page containing no parameter
values.
- If a clipboard page exists, then you can select Copy existing page to
copy values from a thread of an existing clipboard page to the main test
page.
- Select Create or reset test page to create a new test page or reset the
values of an existing test page.
-
To apply a data transform to values on the test page, click the link in the
Apply field, and then select a data transform.
-
In the lower section of the Run Rule window, enter the test data and click
Execute.
The system runs the harness and displays the results.
-
To convert the test into a Pega unit test case, click Convert to
Test. For more information, see Creating unit test cases for rules.