OpenVeo test API

API Docs for: 8.0.0
Show:

TableAssert

Summary

Defines a table assertion helper to help writing assertions for table pages.

Constructor

TableAssert

Syntax

TableAssert

(
  • page
  • helper
)

Summary

Parameters:

  • page TablePage

    The table page to test

  • helper Helper

    The helper to manipulate entities without interacting with the web browser

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);

Methods

checkActions

Syntax

checkActions

(
  • expectedActions
)
Promise

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 Array

    Expected actions

Returns:

Promise:

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

checkCancelRemove

() Promise

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:

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

checkItemsPerPage

() Promise

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:

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

checkItemsPerPageButtons

() Promise private

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:

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

checkLinesSelection

(
  • nameProperty
)
Promise

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 String

    The property holding the name of the entity

Returns:

Promise:

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

checkMassiveRemove

() Promise

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:

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();

checkNavigation

Syntax

checkNavigation

(
  • totalElements
  • numberPerPage
  • [index]
)
Promise

Summary

Checks that table navigation is working.

Use table navigation links to navigate on pages and verify, on each page, the current page, total pages, total lines and the number of lines in the page.

Parameters:

  • totalElements Number

    The total number of elements

  • numberPerPage Number

    The number of elements displayed per page

  • [index] Number optional

    The page index

Returns:

Promise:

Promise resolving when navigation 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(50, 10);

checkPagination

Syntax

checkPagination

() Promise

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:

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

checkSearch

(
  • search
  • expectedValues
  • columnName
)
Promise

Summary

Checks if search engine works correctly.

Parameters:

  • search Object

    A search description object

  • expectedValues Array

    The expected list of line values corresponding to the research

  • columnName String

    The name of the column to extract value from and compare to expectedValues

Returns:

Promise:

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

checkSort

(
  • property
)
Promise

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 String

    The name of the column to sort on

Returns:

Promise:

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');

Properties

helper

Syntax

helper

Helper final

Summary

The helper to manipulate entities.

page

Syntax

page

TablePage final

Summary

The page containing the table to test.