mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
[ADF-3329] datatable component e2e (#3589)
* datatable component e2e minor fix tslint * fix review
This commit is contained in:
parent
f2103b43f2
commit
2f7e0e6cb6
@ -1,5 +1,5 @@
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Name filter" [(ngModel)]="data.filterValue">
|
||||
<input id="adf-datatable-filter-input" matInput placeholder="Name filter" [(ngModel)]="data.filterValue">
|
||||
</mat-form-field>
|
||||
|
||||
<adf-datatable
|
||||
|
@ -21,7 +21,6 @@ import ProcessFiltersPage = require('./pages/adf/process_services/processFilters
|
||||
import FileModel = require('./models/ACS/fileModel');
|
||||
import { AttachmentListPage } from './pages/adf/process_services/attachmentListPage';
|
||||
|
||||
|
||||
import TestConfig = require('./test.config');
|
||||
import resources = require('./util/resources');
|
||||
|
||||
|
@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import LoginPage = require('./pages/adf/loginPage');
|
||||
import DataTablePage = require('./pages/adf/dataTablePage');
|
||||
import TestConfig = require('./test.config');
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import DataTablePage = require('../pages/adf/dataTablePage');
|
||||
import TestConfig = require('../test.config');
|
||||
|
||||
import AcsUserModel = require('./models/ACS/acsUserModel');
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
describe('Datatable component - selection', () => {
|
||||
@ -45,15 +45,15 @@ describe('Datatable component - selection', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('1. Data Table Selection Modes', () => {
|
||||
it('[C213258] Should be possible change the selection modes when change the selectionMode property', () => {
|
||||
dataTablePage.selectRow('2');
|
||||
dataTablePage.checkRowIsSelected('2');
|
||||
dataTablePage.getNumberOfSelectedRows().then(function (result) {
|
||||
dataTablePage.getNumberOfSelectedRows().then((result) => {
|
||||
expect(result).toEqual(1);
|
||||
});
|
||||
dataTablePage.selectRow('3');
|
||||
dataTablePage.checkRowIsSelected('3');
|
||||
dataTablePage.getNumberOfSelectedRows().then(function (result) {
|
||||
dataTablePage.getNumberOfSelectedRows().then((result) => {
|
||||
expect(result).toEqual(1);
|
||||
});
|
||||
dataTablePage.selectSelectionMode('Multiple');
|
||||
@ -69,7 +69,7 @@ describe('Datatable component - selection', () => {
|
||||
dataTablePage.checkNoRowIsSelected();
|
||||
});
|
||||
|
||||
it('2. Data Table allows the multiselection of rows', () => {
|
||||
it('[C260059] Should be possible select multiple row when multiselect is true', () => {
|
||||
dataTablePage.clickMultiSelect();
|
||||
dataTablePage.clickCheckbox('1');
|
||||
dataTablePage.checkRowIsChecked('1');
|
||||
@ -82,11 +82,20 @@ describe('Datatable component - selection', () => {
|
||||
dataTablePage.checkRowIsChecked('1');
|
||||
});
|
||||
|
||||
it('3. Can select all in data table', () => {
|
||||
it('[C260058] Should be possible select all the rows when multiselect is true', () => {
|
||||
dataTablePage.checkAllRows();
|
||||
dataTablePage.checkRowIsChecked('1');
|
||||
dataTablePage.checkRowIsChecked('2');
|
||||
dataTablePage.checkRowIsChecked('3');
|
||||
dataTablePage.checkRowIsChecked('4');
|
||||
});
|
||||
|
||||
it('[C277262] Should be possible reset the selected row when click on the reset button', () => {
|
||||
dataTablePage.checkRowIsChecked('1');
|
||||
dataTablePage.checkRowIsChecked('2');
|
||||
dataTablePage.checkRowIsChecked('3');
|
||||
dataTablePage.checkRowIsChecked('4');
|
||||
dataTablePage.clickReset();
|
||||
dataTablePage.checkNoRowIsSelected();
|
||||
});
|
||||
});
|
@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import LoginPage = require('./pages/adf/loginPage.js');
|
||||
import DataTablePage = require('./pages/adf/dataTablePage.js');
|
||||
import AcsUserModel = require('./models/ACS/acsUserModel.js');
|
||||
import TestConfig = require('./test.config.js');
|
||||
import LoginPage = require('../pages/adf/loginPage.js');
|
||||
import DataTablePage = require('../pages/adf/dataTablePage.js');
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel.js');
|
||||
import TestConfig = require('../test.config.js');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
@ -45,8 +45,8 @@ describe('Datatable component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('1. DataTable allows extra rows to be added', () => {
|
||||
dataTablePage.getNumberOfRows().then(function (result) {
|
||||
it('[C91314] Should be possible add new row to the table', () => {
|
||||
dataTablePage.getNumberOfRows().then((result) => {
|
||||
dataTablePage.addRow();
|
||||
expect(dataTablePage.getNumberOfRows()).toEqual(result + 1);
|
||||
dataTablePage.addRow();
|
||||
@ -54,12 +54,20 @@ describe('Datatable component', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('2. Data Table can replace rows', () => {
|
||||
it('[C260039] Should be possible replace rows', () => {
|
||||
dataTablePage.replaceRows(1);
|
||||
});
|
||||
|
||||
it('3. Data Table can replace columns', () => {
|
||||
it('[C260041] Should be possible replace columns', () => {
|
||||
dataTablePage.replaceColumns();
|
||||
});
|
||||
|
||||
it('[C277314] Should filter the table rows when the input filter is passed', () => {
|
||||
expect(dataTablePage.getNumberOfRows()).toEqual(5);
|
||||
dataTablePage.insertFilter('Name');
|
||||
expect(dataTablePage.getNumberOfRows()).toEqual(4);
|
||||
dataTablePage.insertFilter('I');
|
||||
expect(dataTablePage.getNumberOfRows()).toEqual(2);
|
||||
});
|
||||
|
||||
});
|
@ -30,6 +30,7 @@ var DataTablePage = function () {
|
||||
var list = element.all(by.css("div[class*=adf-datatable-row]"));
|
||||
var addRow = element(by.xpath("//span[contains(text(),'Add row')]/.."));
|
||||
var replaceRows = element(by.xpath("//span[contains(text(),'Replace rows')]/.."));
|
||||
var reset = element(by.xpath("//span[contains(text(),'Reset to default')]/.."));
|
||||
var replaceColumns = element(by.xpath("//span[contains(text(),'Replace columns')]/.."));
|
||||
var loadNode = element(by.xpath("//span[contains(text(),'Load Node')]/.."));
|
||||
var createdOnColumn = element(by.css("div[data-automation-id='auto_id_createdOn']"));
|
||||
@ -47,8 +48,8 @@ var DataTablePage = function () {
|
||||
* @param rowNumber
|
||||
*/
|
||||
this.getRowByRowNumber = function (rowNumber) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[data-automation-id='text_" + rowNumber +"']")));
|
||||
return element(by.css("div[data-automation-id='text_" + rowNumber +"']"));
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[data-automation-id='text_" + rowNumber + "']")));
|
||||
return element(by.css("div[data-automation-id='text_" + rowNumber + "']"));
|
||||
};
|
||||
|
||||
/**
|
||||
@ -61,19 +62,26 @@ var DataTablePage = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* Click multiselect option
|
||||
* @property clickMultiSelect
|
||||
* */
|
||||
* Click multiselect option
|
||||
* */
|
||||
this.clickMultiSelect = function () {
|
||||
Util.waitUntilElementIsVisible(multiSelect);
|
||||
multiSelect.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Click specific checkbox in row
|
||||
* @method clickCheckbox
|
||||
* @param {String} row number
|
||||
*/
|
||||
* Click reset option
|
||||
* */
|
||||
this.clickReset = function () {
|
||||
Util.waitUntilElementIsVisible(reset);
|
||||
reset.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Click specific checkbox in row
|
||||
* @method clickCheckbox
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.clickCheckbox = function (rowNumber) {
|
||||
var checkbox = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label"));
|
||||
Util.waitUntilElementIsVisible(checkbox);
|
||||
@ -81,29 +89,29 @@ var DataTablePage = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* Select a specific row
|
||||
* @method selectRow
|
||||
* @param {String} row number
|
||||
*/
|
||||
* Select a specific row
|
||||
* @method selectRow
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.selectRow = function (rowNumber) {
|
||||
return this.getRowByRowNumber(rowNumber).click();
|
||||
};
|
||||
|
||||
/**
|
||||
* Select a specific row using command key
|
||||
* @method selectRow
|
||||
* @param {String} row number
|
||||
*/
|
||||
* Select a specific row using command key
|
||||
* @method selectRow
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.selectRowWithKeyboard = function (rowNumber) {
|
||||
var row = this.getRowByRowNumber(rowNumber);
|
||||
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
|
||||
};
|
||||
|
||||
/**
|
||||
* Select a specific selection mode
|
||||
* @method selectSelectionMode
|
||||
* @param {String} selection mode
|
||||
*/
|
||||
* Select a specific selection mode
|
||||
* @method selectSelectionMode
|
||||
* @param {String} selection mode
|
||||
*/
|
||||
this.selectSelectionMode = function (selectionMode) {
|
||||
var selectMode = element(by.cssContainingText("span[class='mat-option-text']", selectionMode));
|
||||
selectionButton.click();
|
||||
@ -112,29 +120,29 @@ var DataTablePage = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a specific row is selected
|
||||
* @method checkRowIsSelected
|
||||
* @param {String} row number
|
||||
*/
|
||||
* Check if a specific row is selected
|
||||
* @method checkRowIsSelected
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.checkRowIsSelected = function (rowNumber) {
|
||||
var isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'is-selected')]"));
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a specific row is not selected
|
||||
* @method checkRowIsNotSelected
|
||||
* @param {String} row number
|
||||
*/
|
||||
* Check if a specific row is not selected
|
||||
* @method checkRowIsNotSelected
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.checkRowIsNotSelected = function (rowNumber) {
|
||||
var isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]"));
|
||||
Util.waitUntilElementIsNotOnPage(isRowSelected);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check no row is selected
|
||||
* @method checkNoRowIsSelected
|
||||
*/
|
||||
* Check no row is selected
|
||||
* @method checkNoRowIsSelected
|
||||
*/
|
||||
this.checkNoRowIsSelected = function () {
|
||||
Util.waitUntilElementIsNotOnPage(selectedRowNumber);
|
||||
};
|
||||
@ -145,19 +153,19 @@ var DataTablePage = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* Check specfic row is checked
|
||||
* @method checkRowIsChecked
|
||||
* @param {String} row number
|
||||
*/
|
||||
* Check specfic row is checked
|
||||
* @method checkRowIsChecked
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.checkRowIsChecked = function (rowNumber) {
|
||||
Util.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
|
||||
};
|
||||
|
||||
/**
|
||||
* Check specfic row is not checked
|
||||
* @method checkRowIsNotChecked
|
||||
* @param {String} row number
|
||||
*/
|
||||
* Check specfic row is not checked
|
||||
* @method checkRowIsNotChecked
|
||||
* @param {String} row number
|
||||
*/
|
||||
this.checkRowIsNotChecked = function (rowNumber) {
|
||||
Util.waitUntilElementIsNotOnPage(this.getRowCheckbox(rowNumber));
|
||||
};
|
||||
@ -188,10 +196,10 @@ var DataTablePage = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* replace rows
|
||||
* @method replaceRows
|
||||
* @param {String} id
|
||||
*/
|
||||
* replace rows
|
||||
* @method replaceRows
|
||||
* @param {String} id
|
||||
*/
|
||||
this.replaceRows = function (id) {
|
||||
var rowID = this.getRowByRowNumber(id);
|
||||
Util.waitUntilElementIsVisible(rowID);
|
||||
@ -200,9 +208,9 @@ var DataTablePage = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* replace columns
|
||||
* @method replaceColumns
|
||||
*/
|
||||
* replace columns
|
||||
* @method replaceColumns
|
||||
*/
|
||||
this.replaceColumns = function () {
|
||||
Util.waitUntilElementIsVisible(replaceColumns);
|
||||
replaceColumns.click();
|
||||
@ -210,9 +218,9 @@ var DataTablePage = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* check the nodeID is the same with the userHome folder's ID
|
||||
* @method replaceColumns
|
||||
*/
|
||||
* check the nodeID is the same with the userHome folder's ID
|
||||
* @method replaceColumns
|
||||
*/
|
||||
this.checkLoadNode = function (userHome) {
|
||||
var nodeId = element(by.css("div[data-automation-id*='" + userHome + "']"));
|
||||
|
||||
@ -221,7 +229,7 @@ var DataTablePage = function () {
|
||||
Util.waitUntilElementIsVisible(nodeId, 10000);
|
||||
};
|
||||
|
||||
this.navigateToContent = function(content) {
|
||||
this.navigateToContent = function (content) {
|
||||
var row = this.getRowByRowName(content);
|
||||
Util.waitUntilElementIsPresent(row);
|
||||
row.click();
|
||||
@ -242,9 +250,15 @@ var DataTablePage = function () {
|
||||
return this.getRowsName(content).element(rowByRowName);
|
||||
};
|
||||
|
||||
this.waitForTableBody = function (){
|
||||
this.waitForTableBody = function () {
|
||||
Util.waitUntilElementIsVisible(tableBody);
|
||||
};
|
||||
|
||||
this.insertFilter = function (filterText) {
|
||||
var inputFilter = element(by.xpath("//*[@id=\"adf-datatable-filter-input\"]"));
|
||||
inputFilter.clear();
|
||||
return inputFilter.sendKeys(filterText);
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = DataTablePage;
|
||||
|
@ -31,8 +31,8 @@ import Util = require('./util/util.js');
|
||||
import path = require('path');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import {UsersActions} from './actions/users.actions';
|
||||
import {AppsActions} from './actions/APS/apps.actions';
|
||||
import { UsersActions } from './actions/users.actions';
|
||||
import { AppsActions } from './actions/APS/apps.actions';
|
||||
import FileModel = require('./models/ACS/fileModel');
|
||||
|
||||
describe('Attachment list action menu for processes', () => {
|
||||
|
@ -26,7 +26,7 @@ import StartProcessPage = require('./pages/adf/process_services/startProcessPage
|
||||
import ProcessFiltersPage = require('./pages/adf/process_services/processFiltersPage');
|
||||
import AppNavigationBarPage = require('./pages/adf/process_services/appNavigationBarPage');
|
||||
import ProcessDetailsPage = require('./pages/adf/process_services/processDetailsPage');
|
||||
import {AttachmentListPage} from './pages/adf/process_services/attachmentListPage';
|
||||
import { AttachmentListPage } from './pages/adf/process_services/attachmentListPage';
|
||||
|
||||
import User = require('./models/APS/User');
|
||||
import AppPublish = require('./models/APS/AppPublish');
|
||||
|
@ -18,7 +18,7 @@
|
||||
import LoginPage = require('./pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('./pages/adf/process_services/processServicesPage');
|
||||
import TasksPage = require('./pages/adf/process_services/tasksPage');
|
||||
import {AttachmentListPage} from './pages/adf/process_services/attachmentListPage';
|
||||
import { AttachmentListPage } from './pages/adf/process_services/attachmentListPage';
|
||||
import CONSTANTS = require('./util/constants');
|
||||
|
||||
import Task = require('./models/APS/Task');
|
||||
|
@ -18,7 +18,7 @@
|
||||
import LoginPage = require('./pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('./pages/adf/process_services/processServicesPage');
|
||||
import TasksPage = require('./pages/adf/process_services/tasksPage');
|
||||
import {AttachmentListPage} from './pages/adf/process_services/attachmentListPage';
|
||||
import { AttachmentListPage } from './pages/adf/process_services/attachmentListPage';
|
||||
|
||||
import CONSTANTS = require('./util/constants');
|
||||
|
||||
|
@ -124,14 +124,13 @@ describe('Tag component', () => {
|
||||
tagPage.checkTagIsDisplayedInTagList(digitsTag);
|
||||
tagPage.checkTagIsDisplayedInTagListByNodeId(digitsTag);
|
||||
|
||||
tagPage.insertNodeId(pdfFileModel.id)
|
||||
tagPage.insertNodeId(pdfFileModel.id);
|
||||
tagPage.addTag(nonLatinTag);
|
||||
|
||||
tagPage.checkTagIsDisplayedInTagList(nonLatinTag);
|
||||
tagPage.checkTagIsDisplayedInTagListByNodeId(nonLatinTag);
|
||||
});
|
||||
|
||||
|
||||
it('[C260375] Delete tag', () => {
|
||||
let deleteTag = Util.generateRandomStringToUpperCase();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user