TablePage
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
EntityProviderProvider 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
- cancelAction
- clearSearch
- clickMenu
- clickMenuRecursive
- clickProfile
- closeAddForm
- closeAlerts
- closeLine
- closeMenu
- closeSearchEngine
- closeSubMenu
- confirmAction
- deleteCookies
- deselectLine
- getAddFormFields
- getAlertMessages
- getAllLineDetails
- getAllLineDetailsByIndex
- getAllLineDetailsByPage
- getCurrentPage
- getEditFormFields
- getEditionFormErrors
- getGlobalActions
- getHeaderIndex
- getLanguageOption
- getLanguages
- getLevel1MenuItems
- getLevel2MenuItems
- getLine
- getLineActions
- getLineByIndex
- getLineByPage
- getLineCells
- getLineCellValue
- getLineCellValues
- getLineDetails
- getLineFieldText
- getLineFieldValues
- getLineInPage
- getLineInPageValues
- getLinesInPage
- getLinesInPageNumber
- getLineValues
- getLineValuesByIndex
- getLineValuesByPage
- getPath
- getTableHeaderIndex
- getTitle
- getTotalLines
- getTotalPages
- getTotalPaginationLinks
- getUser
- isEditionFormOnError
- isNextRangeLinkEnabled
- isOpenedLine
- isPreviousRangeLinkEnabled
- isSelectedLine
- isSubMenuOpened
- isTableHeader
- lineCellContain
- load
- logAs
- logAsAdmin
- logout
- logToCasAs
- logToLdapAs
- onLoaded
- openAddForm
- openLine
- openMenu
- openSearchEngine
- openSubMenu
- performAction
- performMultipleAction
- refresh
- removeAllLinesInPage
- removeAllSelectedLinesInPage
- removeLine
- search
- selectAllLines
- selectFirstPage
- selectFirstPageRange
- selectLanguage
- selectLastPage
- selectLastPageRange
- selectLine
- selectNextPageRange
- selectPage
- selectPageByRange
- selectPreviousPageRange
- setLinesNumber
- setSelectAllMouseOver
- sortBy
- submitAddForm
Properties
- actionsButtonElement
- actionsElement
- addButtonElement
- addFormElement
- addFormWrapperElement
- addLinkElement
- alertElements
- bodyElement
- currentPageElement
- dialogCancelActionButtonElement
- dialogConfirmActionButtonElement
- dialogElement
- EC
- flow
- headerElements
- itemsPerPageLinkElements
- languageLinkElement
- leftMenuElement
- level1MenuLinkElements
- lineDetailElement
- logoutLinkElement
- pageElement
- paginationElement
- paginationLinkElements
- paginationNextRangeElement
- paginationPageLinkElements
- paginationPreviousRangeElement
- popoverElement
- profileLinkElement
- provider
- rowElements
- searchFormElement
- searchLinkElement
- selectAllElement
- tableElement
- toggleLeftMenuLinkElement
- totalLinesElement
- totalPagesElement
- translations
Methods
addLine
Syntax
Summary
Adds a new line.
User must be logged and have permission to create line on this page.
Returns:
Promise resolving when the line has been added
cancelAction
Syntax
Summary
Cancels the confirmation dialog.
Confirmation dialog must be displayed.
Returns:
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
Summary
Clears search fields.
Returns:
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
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
StringThe name of the menu item
Returns:
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
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
ElementArrayFinderMenu items elements
-
itemName
ItemNameName of the menu item to look for
Returns:
A promise resolving when the menu item is clicked
clickProfile
Syntax
Summary
Clicks on profile link.
Returns:
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
Summary
Closes formular to add an item.
Returns:
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
Summary
Closes all alerts.
Returns:
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
Summary
Closes opened line.
Returns:
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
Summary
Closes menu.
Returns:
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
Summary
Closes search engine.
Returns:
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
Summary
Closes an item sub menu by its name.
Parameters:
-
itemName
StringThe name of the menu item having a sub menu
Returns:
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
Summary
Accepts the confirmation dialog.
Confirmation dialog must be displayed.
Returns:
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
Summary
Removes all cookies on the actual page.
Returns:
Promise resolving when all cookies are deleted
deselectLine
Syntax
Summary
Deselects a line by clicking on the line checkbox.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Gets add form fields.
Parameters:
-
Add
ElementFinderform element
Returns:
The list of fields
getAlertMessages
Syntax
Summary
Gets all alert messages.
Returns:
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
Summary
Gets all column / fields values for all lines in all pages.
Returns:
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
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:
Returns:
Promise resolving with values
getAllLineDetailsByPage
Syntax
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
NumberThe total number of pages
Returns:
Promise resolving with values
getCurrentPage
Syntax
Summary
Gets current page number.
Returns:
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
Summary
Gets edit form fields.
Parameters:
-
Edit
ElementFinderform element
Returns:
The list of fields
getEditionFormErrors
Syntax
Summary
Gets the list of edition form error messages.
Returns:
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
Summary
Gets the list of global actions available.
Returns:
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
Summary
Gets the index of a table column in the list of columns.
Parameters:
-
name
StringThe name of the header to look for
Returns:
Promise resolving with the index of the column
getLanguageOption
Syntax
getLanguageOption
-
languageCode
Summary
Gets language link element.
Parameters:
-
languageCode
StringThe language code to load (e.g. en)
Returns:
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
Summary
Gets the list of available languages.
Returns:
The list of available languages
Example:
// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
console.log(page.getLanguages());
getLevel1MenuItems
Syntax
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 optionalThe translated name of the menu item to look for, leave empty to get all level 1 menu items
Returns:
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
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:
Returns:
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
Summary
Gets a line.
Looks for a line in all pages.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Gets the list of available actions for a line.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Finds a line.
Iterate through the given list of lines to look for the expected one.
Parameters:
Returns:
Promise resolving with the tr element
getLineByPage
Syntax
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:
Returns:
Promise resolving with the searched line (tr element)
getLineCells
Syntax
Summary
Gets all column values for a line.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Gets column value for a line.
Parameters:
Returns:
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
Summary
Gets all column values for a line.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Gets all column / field values of a line.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Gets a field text for a line.
Parameters:
Returns:
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
Summary
Gets all fields values for a line.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Gets a line within the current page.
Parameters:
-
name
StringThe name of the line to look for (each column will be compared to this value)
Returns:
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
Summary
Gets values of a column for all lines in current page.
Parameters:
-
headerTitle
StringTitle of the column to extract values from
Returns:
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
Summary
Gets all lines in the table page except the opened one.
Returns:
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
Summary
Gets the number of lines in the current page.
Returns:
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
Summary
Gets values of a column for all lines in all pages.
Parameters:
-
headerTitle
StringTitle of the column to extract values from
Returns:
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
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:
Returns:
Promise resolving with lines values
getLineValuesByPage
Syntax
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:
Returns:
Promise resolving with column values
getPath
Syntax
Summary
Helper Url Get only current url path without host
Returns:
Promise resolving with current path
getTableHeaderIndex
Syntax
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
StringThe title of the header to look for
Returns:
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
Summary
Gets page title as described by the HTMLTitleElement.
Returns:
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
Summary
Gets total number of lines.
Returns:
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
Summary
Gets total number of pages.
Returns:
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');
});
getTotalPaginationLinks
Syntax
Summary
Gets the total number of page links.
Gets the number of page links in the pagination.
Returns:
Promise resolving with the total number of links
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
page.getTotalPaginationLinks().then(function(totalLinks) {
console.log('There are ' + totalLinks + ' pagination links');
});
getUser
Syntax
Summary
Gets current logged in user.
Returns:
The current logged in user
Example:
// With MyBackEndPage extending BackEndPage
var page = new MyBackEndPage();
page.logAsAdmin().then(function() {
console.log(page.getUser());
});
isEditionFormOnError
Syntax
Summary
Tests if the edition form is in error.
Returns:
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
Summary
Tests if next page range link is enabled.
Returns:
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
Summary
Tests if a line is opened.
As only one line can be opened at a time, no name is required.
Returns:
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
Summary
Tests if previous page range link is enabled.
Returns:
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
Summary
Tests if a line is selected.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Tests if a sub menu is opened.
Parameters:
-
itemName
StringThe name of the menu item
Returns:
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
Summary
Tests if a header exists.
Parameters:
-
name
StringThe title of the header to look for
Returns:
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
Summary
Tests if line cells contain a text.
Parameters:
Returns:
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
Syntax
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 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
Summary
Authenticates to the back end using the given account.
If an account is already logged in, it will be logged out.
Parameters:
-
user
ObjectInformation about the user
Returns:
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
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 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
Summary
Logs out current authenticated user.
This will lead to the login page.
Returns:
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
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
ObjectInformation about the CAS user
Returns:
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
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
ObjectInformation about the LDAP user
Returns:
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
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 resolving when the page is fully loaded
openAddForm
Syntax
Summary
Opens add form.
Returns:
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
Summary
Opens a line.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Opens left menu.
Returns:
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
Summary
Opens search engine.
Returns:
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
Summary
Opens an item sub menu.
Parameters:
-
itemName
StringThe name of the menu item
Returns:
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
Summary
Performs an action on a single line.
Parameters:
Returns:
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
Summary
Performs a grouped action.
At least one line must be selected.
Parameters:
Returns:
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
Summary
Refreshes actual page.
Returns:
Promise resolving when the page is fully loaded
removeAllLinesInPage
Syntax
Summary
Removes all lines in the page.
Returns:
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
Summary
Removes all selected lines in the page.
Returns:
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
Summary
Removes a line.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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');
});
search
Syntax
Summary
Searches in the list of lines using search engine.
Fills search fields.
Parameters:
-
fields
ObjectList of values for fields returned by method getSearchFields
Returns:
Promise resolving when search is done
Example:
// With MyTablePage extending TablePage
var page = new MyTablePage();
page.logAsAdmin();
page.load();
var searchFieldsValues = {
myField: 'Value'
};
page.search(searchFieldsValues).then(function() {
console.Log('Search done');
});
selectAllLines
Syntax
Summary
Selects all lines.
At least, one line must be in the table.
Returns:
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
Summary
Selects the first page in pagination.
Returns:
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
Summary
Selects first page range in pagination.
Returns:
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
Summary
Sets page language.
It uses the top menu to change the language, a page reload will be performed.
Parameters:
-
language
ObjectThe language to load
Returns:
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
Summary
Selects the last page in pagination.
Returns:
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
Summary
Selects last page range in pagination.
Returns:
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
Summary
Selects a line by checking the line checkbox.
Parameters:
-
lineFinder
String | ElementFinderThe name of the line (each column will be compared to this value) or the line element
Returns:
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
Summary
Selects next page range in pagination.
Returns:
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
Summary
Selects a page in pagination.
Parameters:
-
page
NumberThe page to select (starting at 1)
Returns:
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
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
StringThe page to select (starting at 1 instead of 0)
Returns:
Promise resolving when the page is selected
selectPreviousPageRange
Syntax
Summary
Selects previous page range in pagination.
Returns:
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
Summary
Sets the desired number of lines to display in the table.
Parameters:
-
linesNumbers
NumberEither 5, 10, 20 or 30
Returns:
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
Summary
Moves the cursor over the "select all" checkbox to display the information popover.
Returns:
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
Summary
Sorts lines.
Parameters:
Returns:
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
Summary
Submit formular to add an item.
Returns:
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
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
Syntax
EC
ExpectedConditions
final
Summary
Protractor expected conditions.
flow
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
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).