mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4028][ADF-4047]Add process list cloud selection tests (#4537)
* Add process list cloud selection tests * Fix lint issues * Fix lint issues * Added columns to contentServicesPage * Fix lint error. * Add the possibility to test the selection mode for process details.
This commit is contained in:
committed by
Eugenio Romano
parent
453415d73b
commit
f2c954d911
@@ -18,6 +18,7 @@
|
||||
import TestConfig = require('../../test.config');
|
||||
import { CreateFolderDialog } from './dialog/createFolderDialog';
|
||||
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
|
||||
import { FormControllersPage } from '@alfresco/adf-testing';
|
||||
import { DropActions } from '../../actions/drop.actions';
|
||||
import { by, element, protractor, $$, browser } from 'protractor';
|
||||
|
||||
@@ -27,7 +28,17 @@ import { BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class ContentServicesPage {
|
||||
|
||||
columns = {
|
||||
name: 'Display name',
|
||||
size: 'Size',
|
||||
nodeId: 'Node id',
|
||||
createdBy: 'Created by',
|
||||
created: 'Created'
|
||||
};
|
||||
|
||||
contentList = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
||||
formControllersPage = new FormControllersPage();
|
||||
multipleFileUploadToggle = element(by.id('adf-document-list-enable-drop-files'));
|
||||
createFolderDialog = new CreateFolderDialog();
|
||||
createLibraryDialog = new CreateLibraryDialog();
|
||||
dragAndDropAction = new DropActions();
|
||||
@@ -165,16 +176,26 @@ export class ContentServicesPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
enableDropFilesInAFolder() {
|
||||
this.formControllersPage.enableToggle(this.multipleFileUploadToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableDropFilesInAFolder() {
|
||||
this.formControllersPage.disableToggle(this.multipleFileUploadToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
getElementsDisplayedSize() {
|
||||
return this.contentList.dataTablePage().getAllRowsColumnValues('Size');
|
||||
return this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.size);
|
||||
}
|
||||
|
||||
getElementsDisplayedName() {
|
||||
return this.contentList.dataTablePage().getAllRowsColumnValues('Display name');
|
||||
return this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.name);
|
||||
}
|
||||
|
||||
getElementsDisplayedId() {
|
||||
return this.contentList.dataTablePage().getAllRowsColumnValues('Node id');
|
||||
return this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.nodeId);
|
||||
}
|
||||
|
||||
checkElementsSortedAsc(elements) {
|
||||
@@ -311,7 +332,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
getAllRowsNameColumn() {
|
||||
return this.contentList.getAllRowsColumnValues('Display name');
|
||||
return this.contentList.getAllRowsColumnValues(this.columns.name);
|
||||
}
|
||||
|
||||
sortByName(sortOrder) {
|
||||
@@ -336,19 +357,19 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async checkListIsSortedByNameColumn(sortOrder) {
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, 'Display name');
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.name);
|
||||
}
|
||||
|
||||
async checkListIsSortedByCreatedColumn(sortOrder) {
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, 'Created');
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.created);
|
||||
}
|
||||
|
||||
async checkListIsSortedByAuthorColumn(sortOrder) {
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, 'Created by');
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.createdBy);
|
||||
}
|
||||
|
||||
async checkListIsSortedBySizeColumn(sortOrder) {
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, 'Size');
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.size);
|
||||
}
|
||||
|
||||
sortAndCheckListIsOrderedByAuthor(sortOrder) {
|
||||
@@ -396,7 +417,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
checkContentIsDisplayed(content) {
|
||||
this.contentList.dataTablePage().checkContentIsDisplayed('Display name', content);
|
||||
this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -408,7 +429,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
checkContentIsNotDisplayed(content) {
|
||||
this.contentList.dataTablePage().checkContentIsNotDisplayed('Display name', content);
|
||||
this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -551,7 +572,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
getColumnValueForRow(file, columnName) {
|
||||
return this.contentList.dataTablePage().getColumnValueForRow('Display name', file, columnName);
|
||||
return this.contentList.dataTablePage().getColumnValueForRow(this.columns.name, file, columnName);
|
||||
}
|
||||
|
||||
async getStyleValueForRowText(rowName, styleName) {
|
||||
@@ -651,7 +672,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
checkRowIsDisplayed(rowName) {
|
||||
const row = this.contentList.dataTablePage().getCellElementByValue('Display name', rowName);
|
||||
const row = this.contentList.dataTablePage().getCellElementByValue(this.columns.name, rowName);
|
||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
}
|
||||
|
||||
@@ -674,4 +695,8 @@ export class ContentServicesPage {
|
||||
this.multiSelectToggle.click();
|
||||
}
|
||||
|
||||
getRowByName(rowName) {
|
||||
return this.contentList.dataTable.getRow(this.columns.name, rowName);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user