mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4059] - Move Copy Folders with Load more- take2 (#4562)
* C260132 automated * debbugging * in progress * done * review comments. * in progress * Update content-node-selector-dialog.page.ts * fix the locators * code review comments * removed the datatablecomponentPage call directly from hte test.
This commit is contained in:
committed by
Eugenio Romano
parent
558ee4c031
commit
1bda3c914c
@@ -15,8 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { browser } from 'protractor';
|
import { browser, by, element } from 'protractor';
|
||||||
import { LoginPage } from '@alfresco/adf-testing';
|
import { LoginPage, PaginationPage } from '@alfresco/adf-testing';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
@@ -27,6 +27,11 @@ import { UploadActions } from '../../actions/ACS/upload.actions';
|
|||||||
import { FileModel } from '../../models/ACS/fileModel';
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import { StringUtil } from '@alfresco/adf-testing';
|
import { StringUtil } from '@alfresco/adf-testing';
|
||||||
import { Util } from '../../util/util';
|
import { Util } from '../../util/util';
|
||||||
|
import { ContentNodeSelectorDialogPage } from '@alfresco/adf-testing';
|
||||||
|
import { BreadCrumbDropdownPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbDropdownPage';
|
||||||
|
import { FolderModel } from '../../models/ACS/folderModel';
|
||||||
|
import { BreadCrumbPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbPage';
|
||||||
|
import { InfinitePaginationPage } from '../../pages/adf/core/infinitePaginationPage';
|
||||||
|
|
||||||
describe('Document List Component - Actions', () => {
|
describe('Document List Component - Actions', () => {
|
||||||
|
|
||||||
@@ -34,169 +39,324 @@ describe('Document List Component - Actions', () => {
|
|||||||
const contentServicesPage = new ContentServicesPage();
|
const contentServicesPage = new ContentServicesPage();
|
||||||
const navigationBarPage = new NavigationBarPage();
|
const navigationBarPage = new NavigationBarPage();
|
||||||
const contentListPage = contentServicesPage.getDocumentList();
|
const contentListPage = contentServicesPage.getDocumentList();
|
||||||
let uploadedFolder, secondUploadedFolder;
|
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||||
|
const paginationPage = new PaginationPage();
|
||||||
|
const breadCrumbDropdownPage = new BreadCrumbDropdownPage();
|
||||||
|
const breadCrumbPage = new BreadCrumbPage();
|
||||||
const uploadActions = new UploadActions();
|
const uploadActions = new UploadActions();
|
||||||
let acsUser = null;
|
const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector')));
|
||||||
let pdfUploadedNode;
|
|
||||||
let folderName;
|
|
||||||
let fileNames = [];
|
|
||||||
const nrOfFiles = 5;
|
|
||||||
|
|
||||||
const pdfFileModel = new FileModel({
|
const alfrescoJsApi = new AlfrescoApi({
|
||||||
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
provider: 'ECM',
|
||||||
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
|
hostEcm: TestConfig.adf.url
|
||||||
});
|
|
||||||
const testFileModel = new FileModel({
|
|
||||||
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
|
|
||||||
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const files = {
|
describe('Document List Component - Check Actions', () => {
|
||||||
base: 'newFile',
|
|
||||||
extension: '.txt'
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeAll(async (done) => {
|
let uploadedFolder, secondUploadedFolder;
|
||||||
this.alfrescoJsApi = new AlfrescoApi({
|
let acsUser = null;
|
||||||
provider: 'ECM',
|
let pdfUploadedNode;
|
||||||
hostEcm: TestConfig.adf.url
|
let folderName;
|
||||||
|
let fileNames = [];
|
||||||
|
const nrOfFiles = 5;
|
||||||
|
|
||||||
|
const pdfFileModel = new FileModel({
|
||||||
|
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||||
|
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
|
||||||
|
});
|
||||||
|
const testFileModel = new FileModel({
|
||||||
|
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
|
||||||
|
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
|
||||||
});
|
});
|
||||||
|
|
||||||
acsUser = new AcsUserModel();
|
const files = {
|
||||||
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
|
base: 'newFile',
|
||||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
extension: '.txt'
|
||||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
};
|
||||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
|
||||||
pdfUploadedNode = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFileModel.location, pdfFileModel.name, '-my-');
|
|
||||||
await uploadActions.uploadFile(this.alfrescoJsApi, testFileModel.location, testFileModel.name, '-my-');
|
|
||||||
uploadedFolder = await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
|
|
||||||
secondUploadedFolder = await uploadActions.createFolder(this.alfrescoJsApi, 'secondFolder', '-my-');
|
|
||||||
|
|
||||||
fileNames = Util.generateSequenceFiles(1, nrOfFiles, files.base, files.extension);
|
beforeAll(async (done) => {
|
||||||
await uploadActions.createEmptyFiles(this.alfrescoJsApi, fileNames, uploadedFolder.entry.id);
|
|
||||||
|
|
||||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
acsUser = new AcsUserModel();
|
||||||
|
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
|
||||||
|
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
|
await alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||||
|
await alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||||
|
pdfUploadedNode = await uploadActions.uploadFile(alfrescoJsApi, pdfFileModel.location, pdfFileModel.name, '-my-');
|
||||||
|
await uploadActions.uploadFile(alfrescoJsApi, testFileModel.location, testFileModel.name, '-my-');
|
||||||
|
uploadedFolder = await uploadActions.createFolder(alfrescoJsApi, folderName, '-my-');
|
||||||
|
secondUploadedFolder = await uploadActions.createFolder(alfrescoJsApi, 'secondFolder', '-my-');
|
||||||
|
|
||||||
browser.driver.sleep(15000);
|
fileNames = Util.generateSequenceFiles(1, nrOfFiles, files.base, files.extension);
|
||||||
done();
|
await uploadActions.createEmptyFiles(alfrescoJsApi, fileNames, uploadedFolder.entry.id);
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach(async (done) => {
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
navigationBarPage.clickAboutButton();
|
|
||||||
navigationBarPage.clickContentServicesButton();
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('File Actions', () => {
|
browser.driver.sleep(15000);
|
||||||
|
done();
|
||||||
it('[C213257] Should be able to copy a file', () => {
|
|
||||||
contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name);
|
|
||||||
|
|
||||||
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
|
||||||
contentServicesPage.pressContextMenuActionNamed('Copy');
|
|
||||||
|
|
||||||
contentServicesPage.typeIntoNodeSelectorSearchField(folderName);
|
|
||||||
contentServicesPage.clickContentNodeSelectorResult(folderName);
|
|
||||||
contentServicesPage.clickChooseButton();
|
|
||||||
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
|
||||||
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
|
||||||
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C297491] Should be able to move a file', () => {
|
beforeEach(async (done) => {
|
||||||
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
|
navigationBarPage.clickAboutButton();
|
||||||
|
navigationBarPage.clickContentServicesButton();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name);
|
describe('File Actions', () => {
|
||||||
|
|
||||||
|
it('[C213257] Should be able to copy a file', () => {
|
||||||
|
contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name);
|
||||||
|
|
||||||
|
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
||||||
|
contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||||
|
|
||||||
|
contentNodeSelector.checkDialogIsDisplayed();
|
||||||
|
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
|
||||||
|
contentNodeSelector.clickContentNodeSelectorResult(folderName);
|
||||||
|
contentNodeSelector.clickMoveCopyButton();
|
||||||
|
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||||
|
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
||||||
|
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C297491] Should be able to move a file', () => {
|
||||||
|
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
|
||||||
|
|
||||||
|
contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name);
|
||||||
|
contentServicesPage.pressContextMenuActionNamed('Move');
|
||||||
|
contentNodeSelector.checkDialogIsDisplayed();
|
||||||
|
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
|
||||||
|
contentNodeSelector.clickContentNodeSelectorResult(folderName);
|
||||||
|
contentNodeSelector.clickMoveCopyButton();
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
|
||||||
|
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
||||||
|
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C280561] Should be able to delete a file via dropdown menu', () => {
|
||||||
|
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
||||||
|
|
||||||
|
contentServicesPage.checkContentIsDisplayed(fileNames[0]);
|
||||||
|
contentServicesPage.deleteContent(fileNames[0]);
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', () => {
|
||||||
|
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
||||||
|
|
||||||
|
contentListPage.selectRow(fileNames[1]);
|
||||||
|
contentListPage.selectRow(fileNames[2]);
|
||||||
|
contentServicesPage.deleteContent(fileNames[1]);
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed(fileNames[1]);
|
||||||
|
contentServicesPage.checkContentIsDisplayed(fileNames[2]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C280565] Should be able to delete a file using context menu', () => {
|
||||||
|
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
||||||
|
|
||||||
|
contentListPage.rightClickOnRow(fileNames[2]);
|
||||||
|
contentServicesPage.pressContextMenuActionNamed('Delete');
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C280567] Only one file is deleted when multiple files are selected using context menu', () => {
|
||||||
|
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
||||||
|
|
||||||
|
contentListPage.selectRow(fileNames[3]);
|
||||||
|
contentListPage.selectRow(fileNames[4]);
|
||||||
|
contentListPage.rightClickOnRow(fileNames[3]);
|
||||||
|
contentServicesPage.pressContextMenuActionNamed('Delete');
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed(fileNames[3]);
|
||||||
|
contentServicesPage.checkContentIsDisplayed(fileNames[4]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C280566] Should be able to open context menu with right click', () => {
|
||||||
|
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Download');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Copy');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Move');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Delete');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Info');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Manage versions');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Permission');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Lock');
|
||||||
|
contentServicesPage.closeActionContext();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Folder Actions', () => {
|
||||||
|
|
||||||
|
it('[C260138] Should be able to copy a folder', () => {
|
||||||
|
contentServicesPage.copyContent(folderName);
|
||||||
|
contentNodeSelector.checkDialogIsDisplayed();
|
||||||
|
contentNodeSelector.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name);
|
||||||
|
contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
|
||||||
|
contentNodeSelector.clickMoveCopyButton();
|
||||||
|
contentServicesPage.checkContentIsDisplayed(folderName);
|
||||||
|
contentServicesPage.doubleClickRow(secondUploadedFolder.entry.name);
|
||||||
|
contentServicesPage.checkContentIsDisplayed(folderName);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260123] Should be able to delete a folder using context menu', () => {
|
||||||
|
contentServicesPage.deleteContent(folderName);
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed(folderName);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C280568] Should be able to open context menu with right click', () => {
|
||||||
|
contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
|
||||||
|
|
||||||
|
contentListPage.rightClickOnRow(secondUploadedFolder.entry.name);
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Download');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Copy');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Move');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Delete');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Info');
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Permission');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Folder Actions - Copy and Move', () => {
|
||||||
|
|
||||||
|
const folderModel1 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||||
|
const folderModel2 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||||
|
const folderModel3 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||||
|
const folderModel4 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||||
|
const folderModel5 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||||
|
const folderModel6 = new FolderModel({'name': StringUtil.generateRandomString()});
|
||||||
|
|
||||||
|
let folder1, folder2, folder3, folder4, folder5, folder6;
|
||||||
|
|
||||||
|
let folders;
|
||||||
|
const contentServicesUser = new AcsUserModel();
|
||||||
|
|
||||||
|
beforeAll(async (done) => {
|
||||||
|
|
||||||
|
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
|
await alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
|
||||||
|
await alfrescoJsApi.login(contentServicesUser.id, contentServicesUser.password);
|
||||||
|
folder1 = await uploadActions.createFolder(alfrescoJsApi, 'A' + folderModel1.name, '-my-');
|
||||||
|
folder2 = await uploadActions.createFolder(alfrescoJsApi, 'B' + folderModel2.name, '-my-');
|
||||||
|
folder3 = await uploadActions.createFolder(alfrescoJsApi, 'C' + folderModel3.name, '-my-');
|
||||||
|
folder4 = await uploadActions.createFolder(alfrescoJsApi, 'D' + folderModel4.name, '-my-');
|
||||||
|
folder5 = await uploadActions.createFolder(alfrescoJsApi, 'E' + folderModel5.name, '-my-');
|
||||||
|
folder6 = await uploadActions.createFolder(alfrescoJsApi, 'F' + folderModel6.name, '-my-');
|
||||||
|
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(async (done) => {
|
||||||
|
loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
|
||||||
|
contentServicesPage.goToDocumentList();
|
||||||
|
contentServicesPage.waitForTableBody();
|
||||||
|
paginationPage.selectItemsPerPage('5');
|
||||||
|
contentServicesPage.checkAcsContainer();
|
||||||
|
contentListPage.waitForTableBody();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async (done) => {
|
||||||
|
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
|
await folders.forEach(function (folder) {
|
||||||
|
uploadActions.deleteFilesOrFolder(alfrescoJsApi, folder.entry.id);
|
||||||
|
});
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C260132] Move action on folder with - Load more', () => {
|
||||||
|
|
||||||
|
expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||||
|
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
|
||||||
|
contentListPage.rightClickOnRow('A' + folderModel1.name);
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Move');
|
||||||
contentServicesPage.pressContextMenuActionNamed('Move');
|
contentServicesPage.pressContextMenuActionNamed('Move');
|
||||||
contentServicesPage.typeIntoNodeSelectorSearchField(folderName);
|
contentNodeSelector.checkDialogIsDisplayed();
|
||||||
contentServicesPage.clickContentNodeSelectorResult(folderName);
|
expect(contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
|
||||||
contentServicesPage.clickChooseButton();
|
contentNodeSelector.checkSearchInputIsDisplayed();
|
||||||
contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
|
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
|
||||||
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
|
||||||
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
|
contentNodeSelector.checkCancelButtonIsDisplayed();
|
||||||
});
|
contentNodeSelector.checkMoveCopyButtonIsDisplayed();
|
||||||
|
expect(contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
|
||||||
|
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
|
||||||
|
infinitePaginationPage.clickLoadMoreButton();
|
||||||
|
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
|
||||||
|
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
|
||||||
|
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
|
||||||
|
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
|
||||||
|
contentNodeSelector.clickCancelButton();
|
||||||
|
contentNodeSelector.checkDialogIsNotDisplayed();
|
||||||
|
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||||
|
|
||||||
it('[C280561] Should be able to delete a file via dropdown menu', () => {
|
contentListPage.rightClickOnRow('A' + folderModel1.name);
|
||||||
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
|
||||||
|
|
||||||
contentServicesPage.checkContentIsDisplayed(fileNames[0]);
|
|
||||||
contentServicesPage.deleteContent(fileNames[0]);
|
|
||||||
contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', () => {
|
|
||||||
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
|
||||||
|
|
||||||
contentListPage.selectRow(fileNames[1]);
|
|
||||||
contentListPage.selectRow(fileNames[2]);
|
|
||||||
contentServicesPage.deleteContent(fileNames[1]);
|
|
||||||
contentServicesPage.checkContentIsNotDisplayed(fileNames[1]);
|
|
||||||
contentServicesPage.checkContentIsDisplayed(fileNames[2]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('[C280565] Should be able to delete a file using context menu', () => {
|
|
||||||
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
|
||||||
|
|
||||||
contentListPage.rightClickOnRow(fileNames[2]);
|
|
||||||
contentServicesPage.pressContextMenuActionNamed('Delete');
|
|
||||||
contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('[C280567] Only one file is deleted when multiple files are selected using context menu', () => {
|
|
||||||
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
|
|
||||||
|
|
||||||
contentListPage.selectRow(fileNames[3]);
|
|
||||||
contentListPage.selectRow(fileNames[4]);
|
|
||||||
contentListPage.rightClickOnRow(fileNames[3]);
|
|
||||||
contentServicesPage.pressContextMenuActionNamed('Delete');
|
|
||||||
contentServicesPage.checkContentIsNotDisplayed(fileNames[3]);
|
|
||||||
contentServicesPage.checkContentIsDisplayed(fileNames[4]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('[C280566] Should be able to open context menu with right click', () => {
|
|
||||||
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Download');
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Copy');
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Move');
|
contentServicesPage.checkContextActionIsVisible('Move');
|
||||||
contentServicesPage.checkContextActionIsVisible('Delete');
|
contentServicesPage.pressContextMenuActionNamed('Move');
|
||||||
contentServicesPage.checkContextActionIsVisible('Info');
|
contentNodeSelector.checkDialogIsDisplayed();
|
||||||
contentServicesPage.checkContextActionIsVisible('Manage versions');
|
infinitePaginationPage.clickLoadMoreButton();
|
||||||
contentServicesPage.checkContextActionIsVisible('Permission');
|
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
|
||||||
contentServicesPage.checkContextActionIsVisible('Lock');
|
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
|
||||||
contentServicesPage.closeActionContext();
|
contentNodeSelector.clickMoveCopyButton();
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
|
||||||
|
contentServicesPage.doubleClickRow('F' + folderModel6.name);
|
||||||
|
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||||
|
|
||||||
|
contentListPage.rightClickOnRow('A' + folderModel1.name);
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Move');
|
||||||
|
contentServicesPage.pressContextMenuActionNamed('Move');
|
||||||
|
contentNodeSelector.checkDialogIsDisplayed();
|
||||||
|
breadCrumbDropdownPage.clickParentFolder();
|
||||||
|
breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
|
||||||
|
breadCrumbDropdownPage.choosePath(contentServicesUser.id);
|
||||||
|
contentNodeSelector.clickMoveCopyButton();
|
||||||
|
contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
|
||||||
|
|
||||||
|
breadCrumbPage.chooseBreadCrumb(contentServicesUser.id);
|
||||||
|
contentServicesPage.waitForTableBody();
|
||||||
|
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C305051] Copy action on folder with - Load more', () => {
|
||||||
|
|
||||||
|
expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||||
|
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
|
||||||
|
contentListPage.rightClickOnRow('A' + folderModel1.name);
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Copy');
|
||||||
|
contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||||
|
contentNodeSelector.checkDialogIsDisplayed();
|
||||||
|
expect(contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
|
||||||
|
contentNodeSelector.checkSearchInputIsDisplayed();
|
||||||
|
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
|
||||||
|
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
|
||||||
|
contentNodeSelector.checkCancelButtonIsDisplayed();
|
||||||
|
contentNodeSelector.checkMoveCopyButtonIsDisplayed();
|
||||||
|
expect(contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
|
||||||
|
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
|
||||||
|
infinitePaginationPage.clickLoadMoreButton();
|
||||||
|
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
|
||||||
|
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
|
||||||
|
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
|
||||||
|
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
|
||||||
|
contentNodeSelector.clickCancelButton();
|
||||||
|
contentNodeSelector.checkDialogIsNotDisplayed();
|
||||||
|
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||||
|
|
||||||
|
contentListPage.rightClickOnRow('A' + folderModel1.name);
|
||||||
|
contentServicesPage.checkContextActionIsVisible('Copy');
|
||||||
|
contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||||
|
contentNodeSelector.checkDialogIsDisplayed();
|
||||||
|
infinitePaginationPage.clickLoadMoreButton();
|
||||||
|
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
|
||||||
|
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
|
||||||
|
contentNodeSelector.clickMoveCopyButton();
|
||||||
|
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||||
|
paginationPage.clickOnNextPage();
|
||||||
|
contentListPage.waitForTableBody();
|
||||||
|
contentServicesPage.doubleClickRow('F' + folderModel6.name);
|
||||||
|
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Folder Actions', () => {
|
|
||||||
|
|
||||||
it('[C260138] Should be able to copy a folder', () => {
|
|
||||||
contentServicesPage.copyContent(folderName);
|
|
||||||
contentServicesPage.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name);
|
|
||||||
contentServicesPage.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
|
|
||||||
contentServicesPage.clickChooseButton();
|
|
||||||
contentServicesPage.checkContentIsDisplayed(folderName);
|
|
||||||
contentServicesPage.doubleClickRow(secondUploadedFolder.entry.name);
|
|
||||||
contentServicesPage.checkContentIsDisplayed(folderName);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('[C260123] Should be able to delete a folder using context menu', () => {
|
|
||||||
contentServicesPage.deleteContent(folderName);
|
|
||||||
contentServicesPage.checkContentIsNotDisplayed(folderName);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('[C280568] Should be able to open context menu with right click', () => {
|
|
||||||
contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
|
|
||||||
|
|
||||||
contentListPage.rightClickOnRow(secondUploadedFolder.entry.name);
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Download');
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Copy');
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Move');
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Delete');
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Info');
|
|
||||||
contentServicesPage.checkContextActionIsVisible('Permission');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -0,0 +1,42 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { element, by } from 'protractor';
|
||||||
|
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
|
export class BreadCrumbDropdownPage {
|
||||||
|
|
||||||
|
breadCrumb = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
|
||||||
|
parentFolder = this.breadCrumb.element(by.css(`button[data-automation-id='dropdown-breadcrumb-trigger']`));
|
||||||
|
breadCrumbDropdown = element(by.css(`div[class*='mat-select-panel']`));
|
||||||
|
|
||||||
|
choosePath(pathName) {
|
||||||
|
const path = this.breadCrumbDropdown.element(by.cssContainingText(`mat-option[data-automation-class='dropdown-breadcrumb-path-option'] span[class='mat-option-text']`,
|
||||||
|
pathName));
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(path);
|
||||||
|
return path.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickParentFolder() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.parentFolder);
|
||||||
|
return this.parentFolder.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkBreadCrumbDropdownIsDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.breadCrumbDropdown);
|
||||||
|
}
|
||||||
|
}
|
32
e2e/pages/adf/content-services/breadcrumb/breadCrumbPage.ts
Normal file
32
e2e/pages/adf/content-services/breadcrumb/breadCrumbPage.ts
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { element, by } from 'protractor';
|
||||||
|
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
|
export class BreadCrumbPage {
|
||||||
|
|
||||||
|
breadCrumb = element(by.css(`adf-breadcrumb nav[data-automation-id='breadcrumb']`));
|
||||||
|
|
||||||
|
chooseBreadCrumb(breadCrumbItem) {
|
||||||
|
const path = this.breadCrumb.element(by.css(`a[data-automation-id='breadcrumb_${breadCrumbItem}']`));
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(path);
|
||||||
|
return path.click();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import { DocumentListPage } from './content-services/documentListPage';
|
|
||||||
import { CreateFolderDialog } from './dialog/createFolderDialog';
|
import { CreateFolderDialog } from './dialog/createFolderDialog';
|
||||||
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
|
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
|
||||||
import { DropActions } from '../../actions/drop.actions';
|
import { DropActions } from '../../actions/drop.actions';
|
||||||
@@ -24,7 +23,7 @@ import { by, element, protractor, $$, browser } from 'protractor';
|
|||||||
|
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
import { DateUtil } from '../../util/dateUtil';
|
import { DateUtil } from '../../util/dateUtil';
|
||||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
import { BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class ContentServicesPage {
|
export class ContentServicesPage {
|
||||||
|
|
||||||
@@ -658,23 +657,6 @@ export class ContentServicesPage {
|
|||||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
typeIntoNodeSelectorSearchField(text) {
|
|
||||||
BrowserVisibility.waitUntilElementIsVisible(this.searchInputElement);
|
|
||||||
this.searchInputElement.sendKeys(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
clickContentNodeSelectorResult(name) {
|
|
||||||
const resultElement = element.all(by.css(`div[data-automation-id="content-node-selector-content-list"] div[data-automation-id="${name}"`)).first();
|
|
||||||
BrowserVisibility.waitUntilElementIsVisible(resultElement);
|
|
||||||
BrowserVisibility.waitUntilElementIsClickable(resultElement);
|
|
||||||
resultElement.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
clickChooseButton() {
|
|
||||||
BrowserVisibility.waitUntilElementIsClickable(this.chooseButton);
|
|
||||||
this.chooseButton.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
clickShareButton() {
|
clickShareButton() {
|
||||||
BrowserVisibility.waitUntilElementIsClickable(this.shareNodeButton);
|
BrowserVisibility.waitUntilElementIsClickable(this.shareNodeButton);
|
||||||
this.shareNodeButton.click();
|
this.shareNodeButton.click();
|
||||||
|
@@ -15,11 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { LoginPage } from '@alfresco/adf-testing';
|
|
||||||
import { SearchDialog } from '../pages/adf/dialog/searchDialog';
|
import { SearchDialog } from '../pages/adf/dialog/searchDialog';
|
||||||
import { SearchFiltersPage } from '../pages/adf/searchFiltersPage';
|
import { SearchFiltersPage } from '../pages/adf/searchFiltersPage';
|
||||||
import { PaginationPage } from '@alfresco/adf-testing';
|
|
||||||
import { DocumentListPage } from '../pages/adf/content-services/documentListPage';
|
|
||||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||||
import { ConfigEditorPage } from '../pages/adf/configEditorPage';
|
import { ConfigEditorPage } from '../pages/adf/configEditorPage';
|
||||||
import { SearchResultsPage } from '../pages/adf/searchResultsPage';
|
import { SearchResultsPage } from '../pages/adf/searchResultsPage';
|
||||||
@@ -28,7 +25,7 @@ import { AcsUserModel } from '../models/ACS/acsUserModel';
|
|||||||
import { FileModel } from '../models/ACS/fileModel';
|
import { FileModel } from '../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import { StringUtil } from '@alfresco/adf-testing';
|
import { StringUtil, DocumentListPage, PaginationPage, LoginPage } from '@alfresco/adf-testing';
|
||||||
import resources = require('../util/resources');
|
import resources = require('../util/resources');
|
||||||
|
|
||||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||||
|
@@ -0,0 +1,100 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { by, element } from 'protractor';
|
||||||
|
import { DocumentListPage } from '../pages/document-list.page';
|
||||||
|
import { BrowserVisibility } from '../../core/browser-visibility';
|
||||||
|
|
||||||
|
export class ContentNodeSelectorDialogPage {
|
||||||
|
dialog = element(by.css(`adf-content-node-selector`));
|
||||||
|
header = this.dialog.element(by.css(`header[data-automation-id='content-node-selector-title']`));
|
||||||
|
searchInputElement = this.dialog.element(by.css(`input[data-automation-id='content-node-selector-search-input']`));
|
||||||
|
searchLabel = this.searchInputElement.element(by.xpath("ancestor::div[@class='mat-form-field-infix']/span/label"));
|
||||||
|
siteListDropdown = this.dialog.element(by.css(`mat-select[data-automation-id='site-my-files-option']`));
|
||||||
|
cancelButton = element(by.css(`button[data-automation-id='content-node-selector-actions-cancel']`));
|
||||||
|
moveCopyButton = element(by.css(`button[data-automation-id='content-node-selector-actions-choose']`));
|
||||||
|
contentList = new DocumentListPage(this.dialog);
|
||||||
|
|
||||||
|
checkDialogIsDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.dialog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkDialogIsNotDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsNotOnPage(this.dialog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getDialogHeaderText() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.header);
|
||||||
|
return this.header.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSearchInputIsDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.searchInputElement);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getSearchLabel() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.searchLabel);
|
||||||
|
return this.searchLabel.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSelectedSiteIsDisplayed(siteName) {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.siteListDropdown.element(by.cssContainingText('.mat-select-value-text span', siteName)));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCancelButtonIsDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
clickCancelButton() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
|
||||||
|
return this.cancelButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkMoveCopyButtonIsDisplayed() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
getMoveCopyButtonText() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton);
|
||||||
|
return this.moveCopyButton.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickMoveCopyButton() {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton);
|
||||||
|
return this.moveCopyButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
numberOfResultsDisplayed() {
|
||||||
|
return this.contentList.dataTablePage().numberOfRows();
|
||||||
|
}
|
||||||
|
|
||||||
|
typeIntoNodeSelectorSearchField(text) {
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(this.searchInputElement);
|
||||||
|
this.searchInputElement.sendKeys(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
clickContentNodeSelectorResult(name) {
|
||||||
|
this.contentList.dataTablePage().clickRowByContent(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
contentListPage() {
|
||||||
|
return this.contentList;
|
||||||
|
}
|
||||||
|
}
|
@@ -15,6 +15,4 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export class ExamplePage {
|
export * from './content-node-selector-dialog.page';
|
||||||
|
|
||||||
}
|
|
@@ -16,8 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element, ElementFinder, browser } from 'protractor';
|
import { by, element, ElementFinder, browser } from 'protractor';
|
||||||
import { DataTableComponentPage } from '@alfresco/adf-testing';
|
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
||||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
import { BrowserVisibility } from '../../core/browser-visibility';
|
||||||
|
|
||||||
export class DocumentListPage {
|
export class DocumentListPage {
|
||||||
|
|
@@ -15,4 +15,4 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './example.page';
|
export * from './document-list.page';
|
||||||
|
@@ -17,3 +17,4 @@
|
|||||||
|
|
||||||
export * from './pages/public-api';
|
export * from './pages/public-api';
|
||||||
export * from './actions/public-api';
|
export * from './actions/public-api';
|
||||||
|
export * from './dialog/public-api';
|
||||||
|
@@ -282,4 +282,28 @@ export class DataTableComponentPage {
|
|||||||
getCellByRowAndColumn(rowColumn, rowContent, columnName) {
|
getCellByRowAndColumn(rowColumn, rowContent, columnName) {
|
||||||
return this.getRow(rowColumn, rowContent).element(by.css(`div[title='${columnName}']`));
|
return this.getRow(rowColumn, rowContent).element(by.css(`div[title='${columnName}']`));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectRowByContent(content) {
|
||||||
|
const row = this.getCellByContent(content);
|
||||||
|
return row.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkRowByContentIsSelected(folderName) {
|
||||||
|
const selectedRow = this.getCellByContent(folderName).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(selectedRow);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCellByContent(content) {
|
||||||
|
const cell = this.rootElement.element(by.cssContainingText(`div[class*='adf-datatable-row'] div[class*='adf-name-location-cell-name']`, content));
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(cell);
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickRowByContent(name) {
|
||||||
|
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first();
|
||||||
|
BrowserVisibility.waitUntilElementIsVisible(resultElement);
|
||||||
|
BrowserVisibility.waitUntilElementIsClickable(resultElement);
|
||||||
|
resultElement.click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user