TableAssert
Summary
Defines a table assertion helper to help writing assertions for table pages.
Constructor
TableAssert
Syntax
TableAssert
-
page
-
helper
Summary
Parameters:
Example:
var TableAssert = require('@openveo/test').e2e.asserts.TableAssert;
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
Item Index
Methods
Methods
checkActions
Syntax
Summary
Checks that line actions and global actions are the same.
You don't need to add lines to the table before calling this method. Necessary lines are automatically added and then removed using page addEntitiesAuto / removeEntities methods.
Parameters:
-
expectedActions
ArrayExpected actions
Returns:
Promise resolving when actions have been checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
tableAssert.checkActions(['Action 1', 'Action 2']);
checkCancelRemove
Syntax
Summary
Checks if canceling a remove action is working correctly.
You don't need to add lines to the table before calling this method. Necessary lines are automatically added and then removed using page addEntitiesAuto / removeEntities methods.
Returns:
Promise resolving when cancel is checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
tableAssert.checkCancelRemove();
checkItemsPerPage
Syntax
Summary
Checks if buttons to change the number of displayed items per page are correctly displayed regarding the total number of lines.
You don't need to add lines to the table before calling this method. Necessary lines are automatically added and then removed using page addEntitiesAuto / removeEntities methods.
Returns:
Promise resolving when buttons per page have been checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
tableAssert.checkItemsPerPage();
checkItemsPerPageButtons
Syntax
Summary
Checks if buttons to change the number of displayed items per page are displayed correctly depending on the actual number of lines in the table.
Returns:
Promise resolving when buttons have been checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
tableAssert.checkItemsPerPageButtons();
checkLinesSelection
Syntax
Summary
Checks if selecting lines works.
You don't need to add lines to the table before calling this method. Necessary lines are automatically added and then removed using page addEntitiesAuto / removeEntities methods.
Parameters:
-
nameProperty
StringThe property holding the name of the entity
Returns:
Promise resolving when selection have been checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
tableAssert.checkLinesSelection();
checkMassiveRemove
Syntax
Summary
Checks if removing several lines at the same time works correctly.
You don't need to add lines to the table before calling this method. Necessary lines are automatically added and then removed using page addEntitiesAuto / removeEntities methods.
Returns:
Promise resolving when massive remove has been checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
tableAssert.checkMassiveRemove();
checkPagination
Syntax
Summary
Checks if pagination works correctly.
You don't need to add lines to the table before calling this method. Necessary lines are automatically added and then removed using page addEntitiesAuto / removeEntities methods.
Returns:
Promise resolving when pagination has been checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
tableAssert.checkPagination();
checkSearch
Syntax
Summary
Checks if search engine works correctly.
Parameters:
Returns:
Promise resolving when search has been checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
var expectedValues = ['Test 1', 'Test 2'];
var search = { name: 'Name' };
// Execute search and get all values of column 'Name' then compare this values to the expected values
tableAssert.checkSearch(search, expectedValues, 'Name');
checkSort
Syntax
Summary
Checks if lines are correctly sorted for both ascending and descending order.
You don't need to add lines to the table before calling this method. Necessary lines are automatically added and then removed using helper addEntitiesAuto / removeEntities methods.
Parameters:
-
property
StringThe name of the column to sort on
Returns:
Promise resolving when sort has been checked
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
var helper = new MyHelper(new MyProvider());
var tableAssert = new TableAssert(page, helper);
tableAssert.checkSort('My column');