Configuring ordered list assertions
You can configure ordered list assertions for page lists on the data page to apply assertions to all the results that are returned by a data page. Configure an ordered list assertion so that you do not have to manually input assertions for each result in the list.
- 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 on the tab.
- From the Assertion type list, select List.
- From the Appearances list, select In ALL instances.
- 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 obtained by running the data page.
- Optional: In the Filter field, either 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 ordered list assertions.
Complete the following steps:
- Click Add property.
- In the left pane, select the property or page that you want to add. You can search for a property or its value by entering text in the search bar and pressing Enter. If you select a page, all embedded pages and properties from the page are added. Added properties appear in the right pane.
- In the right pane, from the Comparator list, select the comparator that you want to use to compare the property with a specified value.
- In the Value field, either enter a value with which to compare the property or click the click the Expression Builder icon to enter an expression that is used to provide the value.
- To add a comment, click the Add comment icon.
- Click Done.
- Click Save.
When you run the data page unit test case, 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 every entry in the page list.
If any of the properties do not match any entry in the page list, the assertion does not pass.
Open topic with navigation