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.
-
Open the PegaUnit test case if it is not already open.
-
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.
-
-
From the Assertion type list, select Page.
-
In the Page field, enter the name of the page.
-
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.
-
- Click Add pages and perform steps 5 through 6 to add another page to the assertion.
- To add a comment, click the Add comment icon, enter a comment, and click OK.
-
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.