Skip to main content

Creating Pega scenario test cases

You can create Pega scenario test cases for each case type and interaction flow of an application in the corresponding user portal. 

The creation of a Pega scenario test case requires the following prerequisites:

  • The pxscenarioTestAutomation privilege as part of the access roles.
  • A value of true for the pzPegaSUT DSS setting.
  • An unlocked ruleset to save the scenario test case.

As a best practice, you must create unique data-test-ids for all UI components that you want to record as part of the flow. Applications that are created post 8.1 version of your Pega application using out-of-the-box components have the unique data-test-ids generated by default.

Check your knowledge with the following interaction: 

Creating a scenario test case

Create a scenario test case either for a case type or for a portal:

  1. Launch the portal in which you want to do the test.
  2. In the footer of the Portal, click Toggle runtime toolbar
  3. Click Toggle scenario tests pane.
  4. In the Scenario tests pane, click Create test case, and then select the test type:
    • To record a test for a portal, select Portal.
    • To record a test for a case, select Case type, and then select the type of case for which you want to record the test, as shown in the following image:
      Image depicts how user must select the case type for which the test case must be created.
  5. Record the steps for the test by clicking the user interface elements.
Note: After selecting the case type or portal, the flow of the case type begins, and the Scenario tests pane shows that the test case is being recorded. Additionally, the Scenario tests pane displays each step that is recorded as part of the test case. 

An Orange highlight box is displayed on each UI element when you hover over the elements, as shown in the following image:
An orange highlighter displays on each UI element when the user hovers over the elements.
  1. Provide input values required to continue with the flow.

  2. Verify any UI component or content that is displayed on each screen throughout the flow of the test case.

    Note: Each action that you perform in the application is recorded as a step in the scenario test case, as shown in the following image:
    A case in the process of recording
  3. When you finish adding steps, in the Test case pane, click Stop and save test case.
  4. On the New test case form, save the test:
    1. In the Name field, enter a name for the test.
    2. In the Description field, enter extra information
    3. In the Context section, select a branch or ruleset in which you want to save the test.
    4. In the Apply to field, enter the name of a class that is relevant to the test.
    5. Click Save.
       
      Save case

The test case is saved in the selected ruleset and can be viewed in the Scenario tests pane in the user portal. Additionally, you can view the test case on the Application: Scenario test case landing page in Dev Studio.

Adding additional validations on top of default actions performed on the screen

The actions that are performed as part of the case type flow are recorded as steps and become default validations for the test case. 

Add additional validations on any specific UI control:

  1. Hover over the UI control for which you want to add a specific validation.
  2. Click the Add icon that is displayed on the orange highlight box for that UI control.
  3. In the dialog box for the UI control, configure the attributes:
    1. In the Attribute list, select Button caption.
    2. In the Comparator list, select the required condition.
    3. In the Value list, confirm that the value matches the UI control.
    4. Click Save step to save the new validation test case.
    5. Optional: To add another step, follow steps 3a-3c.
      Image depicts how user must click the + icon shown to enter details in the fields of the dialog box that opens to add a new validation.
      Note: Depending on the type of control, attributes vary, and a step or validation can be added for each attribute of a UI control.

    Check your knowledge with the following interaction:


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice