Configuring page assertions

Some rules, such as activities and data transforms, can create or remove pages from the system. You can create page assertions to determine whether or not a page exists after a PegaUnit test case runs. You can also verify that the appropriate error messages appear on pages when there are errors that occur on the page while running the test case.

  1. Open the PegaUnit test case if it is not already open.

  2. Complete one of the following steps:

    • To add a new assertion, Add expected result at the bottom of the page.

    • Modify an existing assertion in the pane.

  3. From the Assertion type list, select Page.

  4. In the Page field, enter the name of the page.

  5. From the Comparator list, select one of the following options:

    • exists – The assertion passes if the system finds all the pages that you specify.

    • does not exist – The assertion passes if the system does not find all the pages that you specify.

    • has errors – The assertion passes if the system finds all the pages for which there are errors.

    • has no errors – The assertion passes if the system finds all the pages for which there are no errors.

  6. Click Add pages and perform steps 5 through 6 to add another page to the assertion.
  7. To add a comment, click the Add comment icon, enter a comment, and click OK.
  8. Click Save in the rule form.

When you run the test case, the system searches for the specified page. The assertion passes if all the pages that you specified are either found, not found, have error messages, or do not have error messages.