Skip to main content
This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.
LinkedIn
Copied!

Data page unit test case assertions

Data page unit test cases help to validate that application data is loaded correctly. You configure assertions that define the expected output of the test. When the test runs, the expected result is compared with the actual results on the data page.

Assertions are applied in the order you that you define them. All assertions, except for run-time assertions, must pass for the test to be successful.

In addition to property and expected run-time assertions, you can create ordered list, unordered list, and result count assertions.

Expected run-time assertions

After you create a data page unit test case, the system generates the expected run-time assertion. The default value of the assertion is the time taken by the data page to fetch results when the test was first run. The system compares this time with the run time of any future tests. You can change this value or create additional assertions.

An actual run time that is significantly longer than the expected run time can indicate an issue, such as a connectivity issue between the application and database from which you are obtaining initial results.

Expected run-time assertion

Expected run-time assertion

Property assertions

You can configure property assertions to compare the expected value of one or more properties with the actual values on the data page.

In the following example, you can verify that the .pxMaxRecords property, which appears only once on the data page, is equal to 500.

Property assertion

Property assertion

Ordered list assertions

You can create ordered list assertions for a page list on the data page to apply assertions to all results returned by the data page so that you do not have to manually create assertions for each result in the list.

The following example shows the results that are obtained when the assertion runs are compared with the .pxResults property. This property contains the list of results that are obtained by running the data page. In addition, the assertion applies only to the data page entries that are specified for the filter value (when the Department is Engineering).

Ordered list assertion

Ordered list assertion

Unordered list assertions

You can create unordered list assertions for a page list on the data page. These assertions determine whether the expected result is anywhere in the list of results returned by the data page.

In the following example, you can verify that the data page results contain an entry where Experience Required is equal to the value of 6, regardless of where the Experienced Required property appears in the data page.

Unordered list assertion

Unordered list assertion

Result count assertions

You can configure assertions to compare the number of items that are returned in a page list, value list, or value group on the data page with the output that you expect to see on the clipboard.

In the following example, the result count assertion verifies that the number of returned results is greater than 7.

Result count assertion

Result count assertion

Did you find this content helpful?

100% found this useful


Related Content

Have a question? Get answers now.

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

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

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

Pega Community 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
Contact us