LinkedIn
Copied!

Creating a testing application and RuleSet for test cases and unit test suites (V6)

Summary

When using Automated Unit Testing to do regression unit testing, it is a good practice to create a testing application and a RuleSet for regression unit testing and for storing the test case and unit test suite rules.

Having a separate application rule and RuleSet gives you the flexibility to manage the test case and unit test suite rules independently from the rules that make up your main application.

For configuration steps in releases before PRPC 6.1, see Creating a RuleSet for test cases and unit test suites (V5).

Suggested Approach

During the development and unit testing project phases, it is helpful to have a testing application that is built on the main application. In this set up, you avoid having to include the test cases and unit test suites RuleSet in main application's rule. This set up makes it possible to migrate and deliver the main application without requiring the test cases and unit test suite rules to go with it.

To use this method:

  1. Create a new RuleSet and RuleSet version for unit testing.
  2. Create a new application rule that is built on the main application rule, and add the new RuleSet to it.
  3. Provide operator access to the new application.

Step 1: Create a new RuleSet and RuleSet version for unit testing

To create a new RuleSet and version:

  1. In the Rules Explorer, in the SysAdmin category, right-click RuleSet and select New.
  2. Enter a name for the RuleSet for holding the rules related to unit testing of your application. For example, if your application is named OrderEntrySystem, you might name the RuleSet OrderEntrySystem-Test.
  3. Tab out of the RuleSet Namefield, and the system enters some default information in the fields of the form:
    • Version: The system enters a default three-part version identifier of 01-01-01. You can modify the version identifier using another three-part identifier.
    • Description: The system enters a default description. You can modify this description.
    • Requires RuleSet and Versions: This new RuleSet version must have at least one prerequisite. The system enters the highest Pega-ProcessCommander version in the system.
  4. In the Requires RuleSet and Versionssection, replace the system default value with the name and version of your primary application's RuleSet and version.

    For example, if your primary application's RuleSet and version is OrderEntrySystem:02-03, replace the pre-filled Pega-ProcessCommander value with OrderEntrySystem:02-03.

    (Do not choose to update your current application with this new RuleSet.)

  1. Click Create. Then, in the RuleSet form, add a description and save the new RuleSet rule and RuleSet Version rule.

Step 2: Create a new application rule that is built on the main application rule

One way to do this step is:

  1. In the Rules Explorer, in the Application Definition category, right-click Application and select New.
  2. Enter a name and version for this testing application. For example, if your application is named OrderEntrySystem, you might name the testing application rule OrderEntrySystem-Test. Choose a name that is unique in the system.

  1. In the RuleSet field, accept the system default or select a RuleSet to associate with this application rule. (This RuleSet is used by the Export and Import tools. It is not used for rule resolution.) The drop-down menu shows the list of RuleSets that your operator ID can access.
  2. Click Create.
  3. In the Application rule form, select the name of the application to be tested in the Built on Application field. In the Version field, select the appropriate version.
  4. Select Include Parent to ensure that RuleSets from the main application are included in the Application Explorer display.
  5. In the Application RuleSets array, select the unit testing RuleSet created in Step 1, and specify the version; for example, OrderEntrySystem-Test:01-01.

  1. Save the rule form.

Step 3: Provide operator access to the new application

To complete this step you create a new access group and add it to the appropriate operator IDs:

  1. In the Rules Explorer, in the Security category, right-click Access Group and select New.
  2. Enter a name in the form of application:description; for example, OrderEntrySystem-Test:Testers. Click Create.

  1. In the Access Group rule form, select the testing application in the Application Name field, and its version in the Version field.
  2. In the Work Pools field, select the main application's work pool from the list.
  3. In the Roles section, specify the appropriate roles. Usually appropriate roles are the standard roles PegaRULES:SysAdm4 and PegaRULES:AutoTest for performing development and testing tasks in the testing application.

  1. On the Settings tab, select Developer for the Default Portal Layout.
  2. Save the form.
  3. In the Rules Explorer, in the Organization category, select Operator ID to see all of the available operator ID instances.
  4. Open your operator ID instance by selecting its name.
  5. In the Access Groups section, click to add a new row and select the new access group.

  1. Save the form.
  2. Repeat steps 10 through 11 for each operator that needs to access the testing application.

To verify that you have access to the testing application:

  1. Press F5 to refresh your portal.
  2. From the Designer Studio Application menu, select Switch Application and select the name of the testing application.

The Designer Studio refreshes and displays the name of the testing application.


100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.