OpenVeo test API

API Docs for: 8.0.0
Show:

TablePage

Extends BackEndPage
Module: e2e

Summary

Defines a TablePage representing a back end page with a table and form to add an entity.

Do not use this directly but extend it.

Constructor

TablePage

Syntax

TablePage

(
  • provider
)

Summary

Parameters:

  • provider EntityProvider

    Provider to interact directly with the database

Example:

var TablePage = require('@openveo/test').e2e.pages.TablePage;

function MyTablePage() {
  MyTablePage.super_.call(this);
  this.path = 'be/myTablePage';
}

module.exports = MyTablePage;
util.inherits(MyTablePage, TablePage);

var page = new MyTablePage();
page.logAsAdmin();
page.load().then(function() {
  console.log('Page fully loaded in the first language');
});

Item Index

Methods

addLine

Syntax

addLine

(
  • name
  • [data]
)
Promise

Summary

Adds a new line.

User must be logged and have permission to create line on this page.

Parameters:

  • name String

    Line name

  • [data] Object optional

    Additional data depending on page type

Returns:

Promise:

Promise resolving when the line has been added

cancelAction

Syntax

cancelAction

() Promise

Summary

Cancels the confirmation dialog.

Confirmation dialog must be displayed.

Returns:

Promise:

Promise resolving when confirmation dialog has been canceled

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectAllLines();
page.performMultipleAction('Remove');
page.cancelAction().then(function() {
  console.Log('Remoe action canceled');
});

clearSearch

Syntax

clearSearch

() Promise

Summary

Clears search fields.

Returns:

Promise:

Promise resolving when fields are cleared

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.clearSearch().then(function() {
  console.Log('Search engine cleared');
});

clickMenu

Syntax

clickMenu

(
  • itemName
)
Promise

Summary

Clicks on a menu item.

This will look for the item in menu and sub menus to find the item by its name.

Parameters:

  • itemName String

    The name of the menu item

Returns:

Promise:

Promise resolving when menu is clicked

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.clickMenu('Roles').then(function() {
  console.log('Roles menu item clicked');
});

clickMenuRecursive

Syntax

clickMenuRecursive

(
  • elements
  • itemName
)
Promise private

Summary

Looks for a menu item and click on it.

This will look for the item in menu and sub menus to find the item by its name.

Parameters:

  • elements ElementArrayFinder

    Menu items elements

  • itemName ItemName

    Name of the menu item to look for

Returns:

Promise:

A promise resolving when the menu item is clicked

clickProfile

Syntax

clickProfile

() Promise

Summary

Clicks on profile link.

Returns:

Promise:

Promise resolving when profile link is clicked

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.clickProfile().then(function() {
  console.log('Profile link clicked');
});

closeAddForm

Syntax

closeAddForm

() Promise

Summary

Closes formular to add an item.

Returns:

Promise:

Promise resolving when add form is closed

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.openAddForm();
page.closeAddForm().then(function() {
  console.log('Add form closed');
});

closeAlerts

Syntax

closeAlerts

() Promise

Summary

Closes all alerts.

Returns:

Promise:

Promise resolving when all alerts are closed

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.closeAlerts().then(function() {
  console.log('All alerts closed');
});

closeLine

Syntax

closeLine

() Promise

Summary

Closes opened line.

Returns:

Promise:

Promise resolving when line is closed

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.closeLine('My line').then(function() {
  console.log('My line closed');
});

closeMenu

Syntax

closeMenu

() Promise

Summary

Closes menu.

Returns:

Promise:

Promise resolving when menu is closed

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.closeMenu().then(function() {
  console.log('Left menu closed');
});

closeSearchEngine

Syntax

closeSearchEngine

() Promise

Summary

Closes search engine.

Returns:

Promise:

Promise resolving when search engine is closed

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.closeSearchEngine().then(function() {
  console.log('Search engine closed');
});

closeSubMenu

Syntax

closeSubMenu

(
  • itemName
)
Promise

Summary

Closes an item sub menu by its name.

Parameters:

  • itemName String

    The name of the menu item having a sub menu

Returns:

Promise:

Promise resolving when sub menu is closed

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.closeSubMenu('Rights').then(function() {
  console.log('Rights sub menu closed');
});

confirmAction

Syntax

confirmAction

() Promise

Summary

Accepts the confirmation dialog.

Confirmation dialog must be displayed.

Returns:

Promise:

Promise resolving when confirmation dialog has been accepted

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectAllLines();
page.performMultipleAction('Remove');
page.confirmAction().then(function() {
  console.Log('Dialog confirmed, thus all selected lines are removed');
});

deleteCookies

Syntax

deleteCookies

() Promise

Summary

Removes all cookies on the actual page.

Returns:

Promise:

Promise resolving when all cookies are deleted

deselectLine

Syntax

deselectLine

(
  • lineFinder
)
Promise

Summary

Deselects a line by clicking on the line checkbox.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving when line is deselected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.deselectLine('My line').then(function() {
  console.log('My line is deselected');
});

getAddFormFields

Syntax

getAddFormFields

(
  • Add
)
Object

Summary

Gets add form fields.

Parameters:

  • Add ElementFinder

    form element

Returns:

Object:

The list of fields

getAlertMessages

Syntax

getAlertMessages

() Promise

Summary

Gets all alert messages.

Returns:

Promise:

Promise resolving with all alert messages

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.getAlertMessages().then(function(messages) {
  console.log(messages);
});

getAllLineDetails

Syntax

getAllLineDetails

() Promise

Summary

Gets all column / fields values for all lines in all pages.

Returns:

Promise:

Promise resolving with the list of line details

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getAllLineDetails().then(function(data) {
 console.log(data);
});

getAllLineDetailsByIndex

Syntax

getAllLineDetailsByIndex

(
  • lines
  • [index=0]
)
Promise private

Summary

Gets column and field values for a list of lines.

Iterates through the given list of lines and get all information (column values and field values) for each line.

Parameters:

  • lines Array

    The lines in the page (tr elements)

  • [index=0] Number optional

    Current line index being inspected

Returns:

Promise:

Promise resolving with values

getAllLineDetailsByPage

Syntax

getAllLineDetailsByPage

(
  • totalPages
)
Promise private

Summary

Gets line fields values in all pages.

Iterate through all lines of all pages and get columns / fields values for each line. It starts at current page.

Parameters:

  • totalPages Number

    The total number of pages

Returns:

Promise:

Promise resolving with values

getCurrentPage

Syntax

getCurrentPage

() Promise

Summary

Gets current page number.

Returns:

Promise:

Promise resolving with the current page (starting at 1)

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getCurrentPage().then(function(currentPage) {
  console.log('Current page is ' + currentPage);
});

getEditFormFields

Syntax

getEditFormFields

(
  • Edit
)
Obect

Summary

Gets edit form fields.

Parameters:

  • Edit ElementFinder

    form element

Returns:

Obect:

The list of fields

getEditionFormErrors

Syntax

getEditionFormErrors

() Promise

Summary

Gets the list of edition form error messages.

Returns:

Promise:

Promise resolving with the list of errors

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getEditionFormErrors().then(function(errors) {
  console.log(errors);
});

getGlobalActions

Syntax

getGlobalActions

() Promise

Summary

Gets the list of global actions available.

Returns:

Promise:

Promise resolving whith the list of global actions

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getGlobalActions().then(function(actions) {
  console.log(actions);
});

getHeaderIndex

Syntax

getHeaderIndex

(
  • name
)
Promise private

Summary

Gets the index of a table column in the list of columns.

Parameters:

  • name String

    The name of the header to look for

Returns:

Promise:

Promise resolving with the index of the column

getLanguageOption

Syntax

getLanguageOption

(
  • languageCode
)
ElementFinder

Summary

Gets language link element.

Parameters:

  • languageCode String

    The language code to load (e.g. en)

Returns:

ElementFinder:

The language option element

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.click(page.getLanguageOption('fr')).then(function() {
  console.log('Page is now in french');
});

getLanguages

Syntax

getLanguages

() Array

Summary

Gets the list of available languages.

Returns:

Array:

The list of available languages

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
console.log(page.getLanguages());

getLevel1MenuItems

Syntax

getLevel1MenuItems

(
  • [itemName]
)
Promise

Summary

Gets level 1 menu items.

All level 1 menu items will be returned with the promise unless itemName is specified then all elements corresponding to the item name will be returned.

Parameters:

  • [itemName] String optional

    The translated name of the menu item to look for, leave empty to get all level 1 menu items

Returns:

Promise:

Promise resolving with the list of elements

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.getLevel1MenuItems('Rights').then(function(elements) {
  console.log(elements);
});

getLevel2MenuItems

Syntax

getLevel2MenuItems

(
  • level1ItemName
  • [level2ItemName]
)
Promise

Summary

Gets level 2 menu items.

All level 2 menu items will be returned with the promise unless itemName is specified then all elements corresponding to the item name will be returned.

Parameters:

  • level1ItemName String

    The translated name of the first level menu item to look for

  • [level2ItemName] String optional

    The translated name of the second menu item to look for, leave empty to get all level 2 menu items

Returns:

Promise:

Promise resolving with the list of elements

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.getLevel2MenuItems('Rights', 'Users').then(function(elements) {
  console.log(elements);
});

getLine

Syntax

getLine

(
  • lineFinder
)
Promise

Summary

Gets a line.

Looks for a line in all pages.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving with the line (tr element)

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLine('My line').then(function(line) {
  console.log(line);
});

getLineActions

Syntax

getLineActions

(
  • lineFinder
)
Promise

Summary

Gets the list of available actions for a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving whith the list of actions

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLineActions('My line').then(function(actions) {
  console.log(actions);
});

getLineByIndex

Syntax

getLineByIndex

(
  • lines
  • name
  • [index]
)
Promise private

Summary

Finds a line.

Iterate through the given list of lines to look for the expected one.

Parameters:

  • lines Array

    The list of line elements (tr elements) to look into

  • name String

    The name of the line to look for (this value will be compared to the value of each cell)

  • [index] Number optional

    The index in lines to start from

Returns:

Promise:

Promise resolving with the tr element

getLineByPage

Syntax

getLineByPage

(
  • name
  • totalPages
)
Promise private

Summary

Finds a line by page.

Iterate through all lines of all pages to look for the expected line. It starts at current page.

Parameters:

  • name String

    The name of the line to look for (this value will be compared to the value of each cell)

  • totalPages Number

    The total number of pages

Returns:

Promise:

Promise resolving with the searched line (tr element)

getLineCells

Syntax

getLineCells

(
  • lineFinder
)
Promise

Summary

Gets all column values for a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving with the line column values

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLineCells('My line').then(function(data) {
  console.log(data);
});

getLineCellValue

Syntax

getLineCellValue

(
  • lineFinder
  • index
)
Promise

Summary

Gets column value for a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

  • index Number

    Index of the column to read

Returns:

Promise:

Promise resolving with the cell value

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();

// Get value of the third column for the line "Line name"
page.getLineCellValue('Line name', 3).then(function(text) {
  console.log(text);
});

getLineCellValues

Syntax

getLineCellValues

(
  • lineFinder
)
Promise

Summary

Gets all column values for a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving with all cell values

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLineCellValues('Line name').then(function(cellValues) {
  console.log(cellValues);
});

getLineDetails

Syntax

getLineDetails

(
  • lineFinder
)
Promise

Summary

Gets all column / field values of a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving with the line details

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLineDetails('My line').then(function(data) {
  console.log(data);
});

getLineFieldText

Syntax

getLineFieldText

(
  • lineFinder
  • field
)
Promise

Summary

Gets a field text for a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

  • field String

    The field id as described by getEditFormFields() method

Returns:

Promise:

Promise resolving with the field text

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();

// Get text value of the "title" field for the line "Line name"
// "title" field must be defined by getEditFormFields() method
page.getLineFieldText('Line name', 'title').then(function(text) {
  console.log(text);
});

getLineFieldValues

Syntax

getLineFieldValues

(
  • lineFinder
)
Promise

Summary

Gets all fields values for a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving with the line fields values

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLineFieldValues('My line').then(function(data) {
  console.log(data);
});

getLineInPage

Syntax

getLineInPage

(
  • name
)
Promise

Summary

Gets a line within the current page.

Parameters:

  • name String

    The name of the line to look for (each column will be compared to this value)

Returns:

Promise:

Promise resolving with the line (tr element)

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLineInPage('My line').then(function(line) {
  console.log(line);
});

getLineInPageValues

Syntax

getLineInPageValues

(
  • headerTitle
)
Promise

Summary

Gets values of a column for all lines in current page.

Parameters:

  • headerTitle String

    Title of the column to extract values from

Returns:

Promise:

Promise resolving with the list of values

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLineInPageValues('Name').then(function(values) {
 console.log(values);
});

getLinesInPage

Syntax

getLinesInPage

() Promise

Summary

Gets all lines in the table page except the opened one.

Returns:

Promise:

Promise resolving with the list of lines elements in the page (tr elements)

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLinesInPage().then(function(lines) {
  console.log(lines);
});

getLinesInPageNumber

Syntax

getLinesInPageNumber

() Promise

Summary

Gets the number of lines in the current page.

Returns:

Promise:

Promise resolving with the number of lines in the page

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLinesInPageNumber().then(function(linesNumber) {
  console.log('This page contains ' + linesNumber + ' lines');
});

getLineValues

Syntax

getLineValues

(
  • headerTitle
)
Promise

Summary

Gets values of a column for all lines in all pages.

Parameters:

  • headerTitle String

    Title of the column to extract values from

Returns:

Promise:

Promise resolving with the list of values

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getLineValues('Name').then(function(values) {
 console.log(values);
});

getLineValuesByIndex

Syntax

getLineValuesByIndex

(
  • lines
  • headerIndex
  • [index=0]
)
Promise private

Summary

Gets column value for a list of lines.

Iterates through the given list of lines and find its value in the given column.

Parameters:

  • lines Array

    The lines in the page (tr elements)

  • headerIndex Number

    The index of the column to read

  • [index=0] Number optional

    Current line index being inspected

Returns:

Promise:

Promise resolving with lines values

getLineValuesByPage

Syntax

getLineValuesByPage

(
  • headerIndex
  • totalPages
)
Promise private

Summary

Gets line column values in all pages.

Iterate through all lines of all pages and get column value for each line. It starts at current page.

Parameters:

  • headerIndex Number

    The index of the column to read

  • totalPages Number

    The total number of pages

Returns:

Promise:

Promise resolving with column values

getPath

Syntax

getPath

() Promise

Summary

Helper Url Get only current url path without host

Returns:

Promise:

Promise resolving with current path

getTableHeaderIndex

Syntax

getTableHeaderIndex

(
  • name
)
Promise

Summary

Gets the index of a header in the list of headers.

Be careful, the header index starts at 1 (not 0) due to the checkboxes occupying first column on each line.

Parameters:

  • name String

    The title of the header to look for

Returns:

Promise:

Promise resolving with the index of the header

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getTableHeaderIndex('Action').then(function(index) {
  console.log('Action header index is ' + index);
});

getTitle

Syntax

getTitle

() Promise

Summary

Gets page title as described by the HTMLTitleElement.

Returns:

Promise:

Promise resolving with the title of the page

Example:

// With MyPage extending Page
var page = new MyPage();
assert.eventually.equal(page.getTitle(), 'My page title');

getTotalLines

Syntax

getTotalLines

() Promise

Summary

Gets total number of lines.

Returns:

Promise:

Promise resolving with the total number of lines

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getTotalLines().then(function(totalLines) {
  console.log('There are ' + totalLines + ' lines');
});

getTotalPages

Syntax

getTotalPages

() Promise

Summary

Gets total number of pages.

Returns:

Promise:

Promise resolving with the total number of pages

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getTotalPages().then(function(totalPages) {
  console.log('There are ' + totalPages + ' pages');
});

getUser

Syntax

getUser

() Object

Summary

Gets current logged in user.

Returns:

Object:

The current logged in user

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin().then(function() {
  console.log(page.getUser());
});

isEditionFormOnError

Syntax

isEditionFormOnError

() Promise

Summary

Tests if the edition form is in error.

Returns:

Promise:

Promise resolving with a boolean indicating if the edition form is on error

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.isEditionFormOnError().then(function(isOnError) {
  console.log('Is edition form on error ? ' + isOnError);
});

isNextRangeLinkEnabled

Syntax

isNextRangeLinkEnabled

() Promise

Summary

Tests if next page range link is enabled.

Returns:

Promise:

Promise resolving whith a boolean indicating if the next range link is enabled

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.isNextRangeLinkEnabled().then(function(isEnabled) {
  console.log('Is next range link enabled ?' + isEnabled);
});

isOpenedLine

Syntax

isOpenedLine

() Promise

Summary

Tests if a line is opened.

As only one line can be opened at a time, no name is required.

Returns:

Promise:

Promise resolving with a boolean indicating if a line is opened or not

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.isOpenedLine().then(function(isOpened) {
  console.log('Is a line opened ? ' + isOpened);
});

isPreviousRangeLinkEnabled

Syntax

isPreviousRangeLinkEnabled

() Promise

Summary

Tests if previous page range link is enabled.

Returns:

Promise:

Promise resolving whith a boolean indicating if the previous range link is enabled

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.isPreviousRangeLinkEnabled().then(function(isEnabled) {
  console.log('Is previous range link enabled ?' + isEnabled);
});

isSelectedLine

Syntax

isSelectedLine

(
  • lineFinder
)
Promise

Summary

Tests if a line is selected.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving with a boolean indicating if line is selected or not

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.isSelectedLine('my line name').then(function(isSelected) {
  console.log('Is line selected ? ' + isSelected);
});

isSubMenuOpened

Syntax

isSubMenuOpened

(
  • itemName
)
Promise

Summary

Tests if a sub menu is opened.

Parameters:

  • itemName String

    The name of the menu item

Returns:

Promise:

Promise resolving with true if the sub menu is opened, false if it's closed

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.isSubMenuOpened('Rights').then(function(isOpened) {
  console.log('Is sub menu opened ?' + isOpened);
});

isTableHeader

Syntax

isTableHeader

(
  • name
)
Promise

Summary

Tests if a header exists.

Parameters:

  • name String

    The title of the header to look for

Returns:

Promise:

Promise resolving with a boolean indicating if the table header exists or not

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.isTableHeader('Action').then(function(isHeader) {
  console.log('Is there a column title named "Action" ? ' + isHeader);
});

lineCellContain

Syntax

lineCellContain

(
  • lineFinder
  • value
)
Promise

Summary

Tests if line cells contain a text.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

  • value String

    Value to look for

Returns:

Promise:

Promise resolving with a boolean indicating if the given value correspond to a cell

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.lineCellContain('Line name', 'Text').then(function(contain) {
  console.log('Does my line "Line name" have a cell containing "Text" ? ' + contain);
});

load

Inherited from Page but overwritten in lib/e2e/pages/BackEndPage.js:222

Syntax

load

() Promise

Summary

Loads the page and select the first available language.

This will automatically select the first language in the list of available languages.

Returns:

Promise:

Promise resolving when the page is loaded and language changed

Example:

var BackEndPage = require('@openveo/test').e2e.pages.BackEndPage;

function MyBackEndPage() {
  MyBackEndPage.super_.call(this);
  this.path = 'be/myBackEndPage';
}

module.exports = MyBackEndPage;
util.inherits(MyBackEndPage, BackEndPage);

var page = new MyBackEndPage();
page.logAsAdmin();
page.load().then(function() {
  console.log('Page fully loaded in the first language');
});

logAs

Syntax

logAs

(
  • user
)
Promise

Summary

Authenticates to the back end using the given account.

If an account is already logged in, it will be logged out.

Parameters:

  • user Object

    Information about the user

Returns:

Promise:

Promise resolving when authenticated to the back end

Example:

var user = {
  "email": "some-user@veo-labs.com",
  "password": "some-user"
}

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAs(user).then(function() {
  console.log('Logged as some-user');
});

logAsAdmin

Syntax

logAsAdmin

() Promise

Summary

Logs to the back end using the super administrator account.

The super administrator can perform any actions. If an account is already logged in, it will be logged out.

Returns:

Promise:

Promise resolving when authenticated as the super administrator

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin().then(function() {
  console.log('Logged as super admin');
});

logout

Syntax

logout

() Promise

Summary

Logs out current authenticated user.

This will lead to the login page.

Returns:

Promise:

Promise resolving when user is logged out and login page is displayed

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.logout().then(function() {
  console.log('Logged out');
});

logToCasAs

Syntax

logToCasAs

(
  • user
)
Promise

Summary

Authenticates to the back end using the given CAS account.

cas-server-mock module must be used for this to work. Also process.protractorConf.casConf.userIdAttribute should be set to the name of the CAS user attribute which must be used as user's login. If an account is already logged in, it will be logged out.

Parameters:

  • user Object

    Information about the CAS user

Returns:

Promise:

Promise resolving when authenticated to the back end

Example:

var user =   {
  name: 'test',
  attributes: {
    name: 'test',
    mail: 'test@openveo.com',
    groups: ['test-group1', 'test-group2']
  }
};

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logToCasAs(user).then(function() {
  console.log('Logged as test');
});

logToLdapAs

Syntax

logToLdapAs

(
  • user
)
Promise

Summary

Authenticates to the back end using the given LDAP account.

process.protractorConf.ldapConf.userIdAttribute should be set to the name of the LDAP user attribute which must be used as user's login. If an account is already logged in, it will be logged out.

Parameters:

  • user Object

    Information about the LDAP user

Returns:

Promise:

Promise resolving when authenticated to the back end

Example:

var user = {
  dn: 'cn=test,dc=test',
  cn: 'test',
  groups: 'test-group1,test-group2',
  mail: 'test@openveo.com'
};

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logToLdapAs(user).then(function() {
  console.log('Logged as test');
});

onLoaded

Syntax

onLoaded

() Promise

Summary

Handles page loaded.

Use this method to perform actions after the page is loaded. Typically, verify that the page is loaded by waiting for elements to be present on the page.

By default it does nothing, override it to define your own behaviour.

Returns:

Promise:

Promise resolving when the page is fully loaded

openAddForm

Syntax

openAddForm

() Promise

Summary

Opens add form.

Returns:

Promise:

Promise resolving when add form is opened

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.openAddForm().then(function() {
  console.log('Add form opened');
});

openLine

Syntax

openLine

(
  • lineFinder
)
Promise

Summary

Opens a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving when line is opened

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.openLine('My line').then(function() {
  console.log('My line opened');
});

openMenu

Syntax

openMenu

() Promise

Summary

Opens left menu.

Returns:

Promise:

Promise resolving when left menu is opened

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.openMenu().then(function() {
  console.log('Left menu opened');
});

openSearchEngine

Syntax

openSearchEngine

() Promise

Summary

Opens search engine.

Returns:

Promise:

Promise resolving when search engine is opened

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.openSearchEngine().then(function() {
  console.log('Search engine opened');
});

openSubMenu

Syntax

openSubMenu

(
  • itemName
)
Promise

Summary

Opens an item sub menu.

Parameters:

  • itemName String

    The name of the menu item

Returns:

Promise:

Promise resolving when sub menu is opened

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin();
page.openSubMenu('Rights').then(function() {
  console.log('Rights sub menu opened');
});

performAction

Syntax

performAction

(
  • lineFinder
  • action
  • [confirm=false]
)
Promise

Summary

Performs an action on a single line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

  • action String

    The translated name of the action to perform

  • [confirm=false] Boolean optional

    true to confirm the action, false otherwise

Returns:

Promise:

Promise resolving when action is performed

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.performAction('My line', 'Remove').then(function() {
  console.log('Action "Remove" has been performed on line "My line", confirmation dialog is opened');
});
page.performAction('My line', 'Remove', true).then(function() {
  console.log('"My line" removed');
});

performMultipleAction

Syntax

performMultipleAction

(
  • action
  • [confirm=false]
)
Promise

Summary

Performs a grouped action.

At least one line must be selected.

Parameters:

  • action String

    The translated name of the action to perform

  • [confirm=false] Boolean optional

    true to confirm the action, false otherwise

Returns:

Promise:

Promise resolving when the action is performed

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectAllLines();
page.performMultipleAction('Remove').then(function() {
  console.log('Action "Remove" performed on all selected lines, confirmation dialog is opened');
});
page.performMultipleAction('Remove', true).then(function() {
  console.log('All lines removed');
});

refresh

Syntax

refresh

() Promise

Summary

Refreshes actual page.

Returns:

Promise:

Promise resolving when the page is fully loaded

removeAllLinesInPage

Syntax

removeAllLinesInPage

() Promise

Summary

Removes all lines in the page.

Returns:

Promise:

Promise resolving when lines have been removed

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.removeAllLinesInPage().then(function() {
  console.log('All lines in the page have been removed');
});

removeAllSelectedLinesInPage

Syntax

removeAllSelectedLinesInPage

() Promise

Summary

Removes all selected lines in the page.

Returns:

Promise:

Promise resolving when lines have been removed

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.removeAllLinesInPage().then(function() {
  console.log('Selected lines in the page have been removed');
});

removeLine

Syntax

removeLine

(
  • lineFinder
)
Promise

Summary

Removes a line.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving when the line has been removed

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.removeLine('My line').then(function() {
  console.log('Line removed');
});

selectAllLines

Syntax

selectAllLines

() Promise

Summary

Selects all lines.

At least, one line must be in the table.

Returns:

Promise:

Promise resolving when all lines are selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectAllLines().then(function() {
  console.log('All lines selected');
});

selectFirstPage

Syntax

selectFirstPage

() Promise

Summary

Selects the first page in pagination.

Returns:

Promise:

Promise resolving when first page is selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectFirstPage().then(function() {
  console.log('First page selected');
});

selectFirstPageRange

Syntax

selectFirstPageRange

() Promise

Summary

Selects first page range in pagination.

Returns:

Promise:

Promise resolving when first page range is selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectFirstPageRange().then(function() {
  console.log('First range selected');
});

selectLanguage

Syntax

selectLanguage

(
  • language
)
Promise

Summary

Sets page language.

It uses the top menu to change the language, a page reload will be performed.

Parameters:

  • language Object

    The language to load

Returns:

Promise:

Promise resolving when the page is reloaded with the expected language

Example:

// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
var languages = page.getLanguages();

page.logAsAdmin();
page.selectLanguage(languages[1]).then(function() {
  console.log('Page reloaded in french');
});

selectLastPage

Syntax

selectLastPage

() Promise

Summary

Selects the last page in pagination.

Returns:

Promise:

Promise resolving when last page is selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectLastPage().then(function() {
  console.log('Last page selected');
});

selectLastPageRange

Syntax

selectLastPageRange

() Promise

Summary

Selects last page range in pagination.

Returns:

Promise:

Promise resolving when last page range is selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectLastPageRange().then(function() {
  console.log('Last range selected');
});

selectLine

Syntax

selectLine

(
  • lineFinder
)
Promise

Summary

Selects a line by checking the line checkbox.

Parameters:

  • lineFinder String | ElementFinder

    The name of the line (each column will be compared to this value) or the line element

Returns:

Promise:

Promise resolving when line is selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectLine('My line').then(function() {
  console.log('My line is selected');
});

selectNextPageRange

Syntax

selectNextPageRange

() Promise

Summary

Selects next page range in pagination.

Returns:

Promise:

Promise resolving when next page range is selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectNextPageRange().then(function() {
  console.log('Next range selected');
});

selectPage

Syntax

selectPage

(
  • page
)
Promise

Summary

Selects a page in pagination.

Parameters:

  • page Number

    The page to select (starting at 1)

Returns:

Promise:

Promise resolving when page is selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectPage(5).then(function() {
  console.log('Page 5 selected');
});

selectPageByRange

Syntax

selectPageByRange

(
  • page
)
Promise private

Summary

Selects a page.

Look for page link in pagination links, if page link is not in the pagination actual range, it will search for the page link in the other pagination ranges.

Parameters:

  • page String

    The page to select (starting at 1 instead of 0)

Returns:

Promise:

Promise resolving when the page is selected

selectPreviousPageRange

Syntax

selectPreviousPageRange

() Promise

Summary

Selects previous page range in pagination.

Returns:

Promise:

Promise resolving when previous page range is selected

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.selectPreviousPageRange().then(function() {
  console.log('Previous range selected');
});

setLinesNumber

Syntax

setLinesNumber

(
  • linesNumbers
)
Promise

Summary

Sets the desired number of lines to display in the table.

Parameters:

  • linesNumbers Number

    Either 5, 10, 20 or 30

Returns:

Promise:

Promise resolving when the expected number of lines is set

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.setLinesNumber(20).then(function() {
  console.log('20 lines are now displayed per page');
});

setSelectAllMouseOver

Syntax

setSelectAllMouseOver

() Promise

Summary

Moves the cursor over the "select all" checkbox to display the information popover.

Returns:

Promise:

Promise resolving when the mouse is over the "select all" checkbox

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.setSelectAllMouseOver().then(function() {
  console.log('Mouse over the "select all" checkbox');
});

sortBy

Syntax

sortBy

(
  • name
  • asc
)
Promise

Summary

Sorts lines.

Parameters:

  • name String

    The value of the column to act on, each column will be compared to this value

  • asc Boolean

    true to sort in ascendant order, false to sort in descendant order

Returns:

Promise:

Promise resolving when column is clicked

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.sortBy('Name', true).then(function() {
  console.log('Lines sorted by Name');
});

submitAddForm

Syntax

submitAddForm

() Promise

Summary

Submit formular to add an item.

Returns:

Promise:

Promise resolving when add form submit button has been clicked

Example:

// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.submitAddForm().then(function() {
  console.log('Add form submitted');
});

Properties

actionsButtonElement

Syntax

actionsButtonElement

ElementFinder final

Summary

Main action button element to perform actions on all selected lines.

actionsElement

Syntax

actionsElement

ElementFinder final

Summary

Element holding the list of actions under main action button.

addButtonElement

Syntax

addButtonElement

ElementFinder final

Summary

Submit button of the form to add a new entity.

addFormElement

Syntax

addFormElement

ElementFinder final

Summary

Form element to add a new entity.

addFormWrapperElement

Syntax

addFormWrapperElement

ElementFinder final

Summary

Wrapper of the add form element.

This element will be displayed when add form is displayed and hidden when add form is closed.

addLinkElement

Syntax

addLinkElement

ElementFinder final

Summary

Link to open / close form element to add a new entity.

alertElements

Syntax

alertElements

ElementArrayFinder final

Summary

List of alert elements.

bodyElement

Inherited from Page: lib/e2e/pages/Page.js:55

Syntax

bodyElement

ElementFinder final

Summary

Body element.

currentPageElement

Syntax

currentPageElement

ElementFinder final

Summary

Element holding the current table page (pagination).

dialogCancelActionButtonElement

Syntax

dialogCancelActionButtonElement

ElementFinder final

Summary

Dialog box cancel button.

dialogConfirmActionButtonElement

Syntax

dialogConfirmActionButtonElement

ElementFinder

Summary

Dialog box confirmation button.

dialogElement

Syntax

dialogElement

ElementFinder final

Summary

Dialog box.

EC

Inherited from Page: lib/e2e/pages/Page.js:37

Syntax

EC

ExpectedConditions final

Summary

Protractor expected conditions.

flow

Inherited from Page: lib/e2e/pages/Page.js:46

Syntax

flow

ControlFlow final

Summary

Protractor control flow.

headerElements

Syntax

headerElements

ElementArrayFinder final

Summary

Table header elements.

itemsPerPageLinkElements

Syntax

itemsPerPageLinkElements

ElementArrayFinder final

Summary

List of per page links to select the number of elements to display per table page.

languageLinkElement

Syntax

languageLinkElement

ElementFinder final

Summary

Language link element to open the list of languages.

leftMenuElement

Syntax

leftMenuElement

ElementFinder final

Summary

Left menu wrapper element.

Displayed or not as the left menu is opened or not.

level1MenuLinkElements

Syntax

level1MenuLinkElements

ElementArrayFinder final

Summary

List of first level link elements in left menu.

lineDetailElement

Syntax

lineDetailElement

ElementFinder final

Summary

Opened line detail containing information about the opened line.

logoutLinkElement

Syntax

logoutLinkElement

ElementFinder final

Summary

Logout link element.

pageElement

Inherited from Page: lib/e2e/pages/Page.js:64

Syntax

pageElement

ElementFinder final

Summary

Page element.

Page wrapper holding the content scrollbar.

paginationElement

Syntax

paginationElement

ElementFinder final

Summary

Pagination links wrapper.

paginationLinkElements

Syntax

paginationLinkElements

ElementArrayFinder final

Summary

List of pagination links, including the previous and next range buttons.

paginationNextRangeElement

Syntax

paginationNextRangeElement

ElementFinder final

Summary

Pagination next range link.

paginationPageLinkElements

Syntax

paginationPageLinkElements

ElementArrayFinder final

Summary

List of pagination links, excluding the previous and next range buttons.

paginationPreviousRangeElement

Syntax

paginationPreviousRangeElement

ElementFinder final

Summary

Pagination previous range link.

popoverElement

Syntax

popoverElement

ElementFinder final

Summary

Popover element.

profileLinkElement

Syntax

profileLinkElement

ElementFinder final

Summary

Profile link element.

provider

Syntax

provider

EntityProvider final

Summary

The entity provider.

rowElements

Syntax

rowElements

ElementArrayFinder final

Summary

Table row elements.

searchFormElement

Syntax

searchFormElement

ElementFinder final

Summary

Search engine form to filter lines in the table.

searchLinkElement

Syntax

searchLinkElement

ElementFinder final

Summary

Link to open / close search engine.

selectAllElement

Syntax

selectAllElement

ElementFinder final

Summary

Checkbox to select all line.

tableElement

Syntax

tableElement

ElementFinder final

Summary

Table element.

toggleLeftMenuLinkElement

Syntax

toggleLeftMenuLinkElement

ElementFinder final

Summary

Button to toggle left menu.

totalLinesElement

Syntax

totalLinesElement

ElementFinder final

Summary

Element holding the total number of lines in all table pages (pagination).

totalPagesElement

Syntax

totalPagesElement

ElementFinder final

Summary

Element holding the total number of table pages (pagination).

translations

Syntax

translations

Object

Summary

List of back end translations.