Close popover

Table of Contents

Configuring page assertions

Version:

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 unit test case runs. You can also assert if a property has an error and, if it does, what the message is so that you can validate that the message is correct.

You can configure page assertions for embedded pages, data pages, data pages with parameters, and embedded pages within data pages that either have or do not have parameter stop-level pages.

Open the unit test case. For more information, see Opening a unit test case.
  1. On the bottom of the Definition tab, click Add expected result.

  2. In the Assertion type list, select Page.

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

  4. In the Comparator list, select the comparator that you want to use to compare the property with a specified value:

    • To ensure that the page is created after the unit test runs, select exists. The assertion passes if the system does not find the page.
    • To ensure that the page is removed after the unit test runs, select does not exist. The assertion passes if the system does not find the page.
    • To ensure that the page has an error after the unit test runs, select has errors. The assertion passes if the system finds errors on the page.
    • To ensure that the page is free of errors after the unit test runs, select has no errors. The assertion passes if the system finds no errors on the page.
    • To ensure that the page has a specific error message after the unit test runs, select has error with message and then enter the message in the Value box or click the Gear icon to build an expression. The assertion passes if the page contains the complete error message.
    • To ensure that the page has a portion of an error message after the unit test runs, select has error message that contains and then enter the message in the Value box or click the Gear icon to build an expression. The assertion passes if the page contains the words or phrases in the error message.
  5. Optional:

    To add another page to the assertion, click Add pages, and then perform steps 3 through 4.

  6. Optional:

    To add a comment, click the Add comment icon, enter a comment, and then click OK.

  7. Click Save.

An activity runs every week to check the last login time of all operators and deletes any operator record (page) from the system if the last login was six months ago. When you test this activity, you can:
  1. Set up the clipboard to load an operator page that has the last login time as six months ago.
  2. Create a page assertion that ensures that the page no longer exists after the activity runs.

  • Page assertions

    You can configure page assertions to determine if a page exists on the clipboard or if a page has errors.

  • Defining expected test results with assertions

    Use unit test cases to compare the expected output of a rule to the actual results returned by running the rule. To define the expected output, you configure assertions (test conditions) on the test cases that the test, when run, compares to the results returned by the rule.

  • Converting unit tests to test cases
  • Creating unit test cases for rules

    For most rules, you can create a reusable test case by converting a unit test to a test case, configuring case details, and then defining expected test results with assertions (test conditions). When the test case runs, the test results are compared to the expected results defined for the rule’s assertions. If the test results do not meet the defined assertions, then the test fails.

Suggest Edit

Have a question? Get answers now.

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