Configuring unordered list assertions
You can create unordered list assertions for page lists on a data page to determine if the expected result is anywhere in the list of results returned by that data page. Even if the order of results changes, the test will continue to work.
- Optional: If the data page unit test case is not already open, open the data page unit test case.
- Click the Definition tab.
- Complete one of the following steps:
- To add a new assertion, click Add expected result.
- Modify an existing assertion in the pane.
- From the Assertion type list, select List.
- From the Appearances list, select In ANY instance.
- In the of object field, enter the path of the object with which the results are compared or counted against when the assertion runs. For example, when the assertion runs, you can compare its results with .pxResults, which contains the results that obtained from running the data page.
- Optional: In the Filter field, enter a property and value on which to filter results or click the Expression Builder icon to provide an expression that is used to filter results. The list assertion applies only to the page list entries that are specified for this filter value.
- Add properties to unordered list assertions.
- Click Save.
When you run the data page unit test, the system searches for the specified properties in the page list. The assertion passes if the all the properties in the set match the expected values in the page list.
If all the properties do not match any of the values in the page list, the assertion does not pass.
Open topic with navigation