mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
@@ -1,249 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { browser } from 'protractor';
|
||||
import { createApiService,
|
||||
ContentNodeSelectorDialogPage,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
UploadActions,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { FolderModel } from '../../models/ACS/folder.model';
|
||||
|
||||
describe('Document List Component - Actions', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
||||
describe('Document List Component - Check Actions', () => {
|
||||
let uploadedFolder; let secondUploadedFolder;
|
||||
let acsUser = null;
|
||||
let pdfUploadedNode;
|
||||
let folderName;
|
||||
let fileNames = [];
|
||||
const nrOfFiles = 5;
|
||||
|
||||
const pdfFileModel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
|
||||
});
|
||||
const testFileModel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
|
||||
});
|
||||
|
||||
const files = {
|
||||
base: 'newFile',
|
||||
extension: '.txt'
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
|
||||
await apiService.loginWithProfile('admin');
|
||||
acsUser = await usersActions.createUser();
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
pdfUploadedNode = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
|
||||
await uploadActions.uploadFile(testFileModel.location, testFileModel.name, '-my-');
|
||||
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
|
||||
secondUploadedFolder = await uploadActions.createFolder('secondFolder', '-my-');
|
||||
|
||||
fileNames = StringUtil.generateFilesNames(1, nrOfFiles, files.base, files.extension);
|
||||
await uploadActions.createEmptyFiles(fileNames, uploadedFolder.entry.id);
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
|
||||
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
});
|
||||
|
||||
describe('File Actions', () => {
|
||||
it('[C213257] Should be able to copy a file', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.openFolder(uploadedFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
});
|
||||
|
||||
it('[C260131] Copy - Destination picker search', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
|
||||
await contentNodeSelector.clickCancelButton();
|
||||
await contentNodeSelector.checkDialogIsNotDisplayed();
|
||||
});
|
||||
|
||||
it('[C297491] Should be able to move a file', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
|
||||
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Move');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
|
||||
await contentServicesPage.openFolder(uploadedFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
|
||||
});
|
||||
|
||||
it('[C260127] Move - Destination picker search', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Move');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
|
||||
await contentNodeSelector.clickCancelButton();
|
||||
await contentNodeSelector.checkDialogIsNotDisplayed();
|
||||
});
|
||||
|
||||
it('[C280561] Should be able to delete a file via dropdown menu', async () => {
|
||||
await contentServicesPage.openFolder(uploadedFolder.entry.name);
|
||||
|
||||
await contentServicesPage.checkContentIsDisplayed(fileNames[0]);
|
||||
await contentServicesPage.deleteContent(fileNames[0]);
|
||||
await contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
|
||||
});
|
||||
|
||||
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', async () => {
|
||||
await contentServicesPage.openFolder(uploadedFolder.entry.name);
|
||||
|
||||
await contentServicesPage.getDocumentList().selectRow(fileNames[1]);
|
||||
await contentServicesPage.getDocumentList().selectRow(fileNames[2]);
|
||||
await contentServicesPage.deleteContent(fileNames[1]);
|
||||
await contentServicesPage.checkContentIsNotDisplayed(fileNames[1]);
|
||||
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
|
||||
});
|
||||
|
||||
it('[C280565] Should be able to delete a file using context menu', async () => {
|
||||
await contentServicesPage.openFolder(uploadedFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[2]);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Delete');
|
||||
await contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
|
||||
});
|
||||
|
||||
it('[C280567] Only one file is deleted when multiple files are selected using context menu', async () => {
|
||||
await contentServicesPage.openFolder(uploadedFolder.entry.name);
|
||||
|
||||
await contentServicesPage.getDocumentList().selectRow(fileNames[3]);
|
||||
await contentServicesPage.getDocumentList().selectRow(fileNames[4]);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[3]);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Delete');
|
||||
await contentServicesPage.checkContentIsNotDisplayed(fileNames[3]);
|
||||
await contentServicesPage.checkContentIsDisplayed(fileNames[4]);
|
||||
});
|
||||
|
||||
it('[C280566] Should be able to open context menu with right click', async () => {
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Download');
|
||||
await contentServicesPage.checkContextActionIsVisible('Copy');
|
||||
await contentServicesPage.checkContextActionIsVisible('Move');
|
||||
await contentServicesPage.checkContextActionIsVisible('Delete');
|
||||
await contentServicesPage.checkContextActionIsVisible('Info');
|
||||
await contentServicesPage.checkContextActionIsVisible('Manage versions');
|
||||
await contentServicesPage.checkContextActionIsVisible('Permission');
|
||||
await contentServicesPage.checkContextActionIsVisible('Lock');
|
||||
await contentServicesPage.closeActionContext();
|
||||
});
|
||||
|
||||
it('[C260060] Should be able to open a file/folder through double click action - file', async () => {
|
||||
await contentServicesPage.doubleClickRow(pdfFileModel.name);
|
||||
await expect(await viewerPage.getDisplayedFileName()).toEqual(pdfFileModel.name);
|
||||
await viewerPage.checkPreviewFileDefaultOptionsAreDisplayed();
|
||||
await viewerPage.clickCloseButton();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Folder Actions', () => {
|
||||
it('[C260138] Should be able to copy a folder', async () => {
|
||||
await contentServicesPage.copyContent(folderName);
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await contentServicesPage.checkContentIsDisplayed(folderName);
|
||||
await contentServicesPage.openFolder(secondUploadedFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(folderName);
|
||||
});
|
||||
|
||||
it('[C260060] Should be able to open a file/folder through double click action - folder', async () => {
|
||||
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
|
||||
const numberOfSubFolders = 3;
|
||||
|
||||
await contentServicesPage.createNewFolder(folderTwoModel.name);
|
||||
const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id');
|
||||
await contentServicesPage.openFolder(folderTwoModel.name);
|
||||
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo);
|
||||
}
|
||||
|
||||
await browser.refresh();
|
||||
|
||||
await contentServicesPage.checkContentsAreDisplayed(numberOfSubFolders);
|
||||
});
|
||||
|
||||
it('[C260123] Should be able to delete a folder using context menu', async () => {
|
||||
await contentServicesPage.deleteContent(folderName);
|
||||
await contentServicesPage.checkContentIsNotDisplayed(folderName);
|
||||
});
|
||||
|
||||
it('[C280568] Should be able to open context menu with right click', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
|
||||
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(secondUploadedFolder.entry.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Download');
|
||||
await contentServicesPage.checkContextActionIsVisible('Copy');
|
||||
await contentServicesPage.checkContextActionIsVisible('Move');
|
||||
await contentServicesPage.checkContextActionIsVisible('Delete');
|
||||
await contentServicesPage.checkContextActionIsVisible('Info');
|
||||
await contentServicesPage.checkContextActionIsVisible('Permission');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
@@ -1,295 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { browser } from 'protractor';
|
||||
import { createApiService,
|
||||
BrowserActions,
|
||||
ContentNodeSelectorDialogPage,
|
||||
LoginPage,
|
||||
NotificationHistoryPage,
|
||||
StringUtil,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { NodesApi, SitesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
||||
let uploadedFolder; let uploadedFile; let sourceFolder; let destinationFolder; let subFolder; let subFolder2; let copyFolder; let subFile;
|
||||
let duplicateFolderName;
|
||||
const acsUser = new UserModel();
|
||||
const anotherAcsUser = new UserModel();
|
||||
let folderName; let sameNameFolder; let site;
|
||||
|
||||
const pdfFileModel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
|
||||
});
|
||||
|
||||
const testFileModel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
folderName = StringUtil.generateRandomString(5);
|
||||
sameNameFolder = StringUtil.generateRandomString(5);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.createUser(acsUser);
|
||||
await usersActions.createUser(anotherAcsUser);
|
||||
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
site = await sitesApi.createSite({
|
||||
title: StringUtil.generateRandomString(8),
|
||||
visibility: 'PUBLIC'
|
||||
});
|
||||
await sitesApi.createSiteMembership(site.entry.id, {
|
||||
id: anotherAcsUser.username,
|
||||
role: CONSTANTS.CS_USER_ROLES.COLLABORATOR
|
||||
});
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
|
||||
destinationFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
|
||||
sourceFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
|
||||
subFolder = await uploadActions.createFolder(sameNameFolder, sourceFolder.entry.id);
|
||||
subFolder2 = await uploadActions.createFolder(StringUtil.generateRandomString(5), subFolder.entry.id);
|
||||
copyFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), sourceFolder.entry.id);
|
||||
duplicateFolderName = await uploadActions.createFolder(sameNameFolder, '-my-');
|
||||
subFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, subFolder.entry.id);
|
||||
await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, uploadedFolder.entry.id);
|
||||
await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, sourceFolder.entry.id);
|
||||
uploadedFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
|
||||
await nodesApi.updateNode(sourceFolder.entry.id,
|
||||
{
|
||||
permissions: {
|
||||
locallySet: [{
|
||||
authorityId: anotherAcsUser.username,
|
||||
name: 'Consumer',
|
||||
accessStatus: 'ALLOWED'
|
||||
}]
|
||||
}
|
||||
});
|
||||
|
||||
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
|
||||
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
|
||||
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
|
||||
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
|
||||
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
await sitesApi.deleteSite(site.entry.id, { permanent: true });
|
||||
});
|
||||
|
||||
describe('Document List Component - Actions Move and Copy', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await navigationBarPage.navigateToContentServices();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C260128] Move - Same name file', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Move');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
|
||||
});
|
||||
|
||||
it('[C260134] Move - folder with subfolder and file within it', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(destinationFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(sourceFolder.entry.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Move');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(destinationFolder.entry.name);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name);
|
||||
await contentServicesPage.openFolder(destinationFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
|
||||
await contentServicesPage.openFolder(sourceFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
|
||||
await contentServicesPage.openFolder(subFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
|
||||
});
|
||||
|
||||
it('[C260135] Move - Same name folder', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Move');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
|
||||
});
|
||||
|
||||
it('[C260129] Copy - Same name file', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
|
||||
});
|
||||
|
||||
it('[C260136] Copy - Same name folder', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
|
||||
});
|
||||
|
||||
it('[C260124] should be able to move file using action menu and content node selector', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.moveContent(pdfFileModel.name);
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await expect(await contentNodeSelector.getDialogHeaderText()).toBe(`Move '${pdfFileModel.name}' to...`);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
|
||||
await contentNodeSelector.checkSelectedFolder(destinationFolder.entry.name);
|
||||
await contentNodeSelector.checkCopyMoveButtonIsEnabled();
|
||||
await contentNodeSelector.clickCancelButton();
|
||||
await contentNodeSelector.checkDialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
|
||||
await contentServicesPage.moveContent(pdfFileModel.name);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
|
||||
await contentNodeSelector.checkSelectedFolder(destinationFolder.entry.name);
|
||||
await contentNodeSelector.checkCopyMoveButtonIsEnabled();
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await contentNodeSelector.checkDialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Document List actions - Move, Copy on no permission folder', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await loginPage.login(anotherAcsUser.username, anotherAcsUser.password);
|
||||
await BrowserActions.getUrl(`${browser.baseUrl}/files/${sourceFolder.entry.id}`);
|
||||
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C260133] Move - no permission folder', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(subFolder.entry.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Move');
|
||||
await expect(await contentServicesPage.isContextActionEnabled('Move')).toBe(false);
|
||||
await contentServicesPage.closeActionContext();
|
||||
});
|
||||
|
||||
it('[C260140] Copy - No permission folder', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(copyFolder.entry.name);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow(copyFolder.entry.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Copy');
|
||||
await expect(await contentServicesPage.isContextActionEnabled('Copy')).toBe(true);
|
||||
await contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisabled(subFolder.entry.name);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().doubleClickRowByContent(subFolder.entry.name);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().waitTillContentLoaded();
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder2.entry.name);
|
||||
});
|
||||
|
||||
it('[C261160] should disable copy/move button when user is not allowed in a specific folder', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.copyContent(pdfFileModel.name);
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
|
||||
await contentNodeSelector.checkSelectedFolder(subFolder.entry.name);
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
|
||||
await contentNodeSelector.clickCancelButton();
|
||||
await contentNodeSelector.checkDialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
});
|
||||
|
||||
it('[C261990] should enable copy/move button when user selects own site\'s documentLibrary', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.copyContent(pdfFileModel.name);
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(site.entry.title);
|
||||
await contentNodeSelector.doubleClickContentNodeSelectorResult(site.entry.id);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult('documentLibrary');
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
|
||||
await contentNodeSelector.clickCancelButton();
|
||||
await contentNodeSelector.checkDialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
});
|
||||
|
||||
it('[C260137] should disable delete action when user has no permission', async () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.checkDeleteIsDisabled(pdfFileModel.name);
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
await BrowserActions.getUrl(`${browser.baseUrl}/files/${sourceFolder.entry.id}`);
|
||||
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.deleteContent(pdfFileModel.name);
|
||||
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,191 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { $ } from 'protractor';
|
||||
import { createApiService,
|
||||
BreadcrumbPage,
|
||||
BreadcrumbDropdownPage,
|
||||
ContentNodeSelectorDialogPage,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
StringUtil,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { InfinitePaginationPage } from '../../core/pages/infinite-pagination.page';
|
||||
import { FolderModel } from '../../models/ACS/folder.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
describe('Document List Component - Actions', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentListPage = contentServicesPage.getDocumentList();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
const breadCrumbDropdownPage = new BreadcrumbDropdownPage();
|
||||
const breadCrumbPage = new BreadcrumbPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const infinitePaginationPage = new InfinitePaginationPage($('adf-content-node-selector'));
|
||||
|
||||
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; let folder2; let folder3; let folder4; let folder5; let folder6;
|
||||
|
||||
let folders;
|
||||
const contentServicesUser = new UserModel();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.createUser(contentServicesUser);
|
||||
await apiService.login(contentServicesUser.username, contentServicesUser.password);
|
||||
folder1 = await uploadActions.createFolder('A' + folderModel1.name, '-my-');
|
||||
folder2 = await uploadActions.createFolder('B' + folderModel2.name, '-my-');
|
||||
folder3 = await uploadActions.createFolder('C' + folderModel3.name, '-my-');
|
||||
folder4 = await uploadActions.createFolder('D' + folderModel4.name, '-my-');
|
||||
folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-');
|
||||
folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-');
|
||||
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(contentServicesUser.username, contentServicesUser.password);
|
||||
await contentServicesPage.goToDocumentList();
|
||||
await paginationPage.selectItemsPerPage('5');
|
||||
await contentServicesPage.checkAcsContainer();
|
||||
await contentListPage.waitForTableBody();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
for (const folder of folders) {
|
||||
await uploadActions.deleteFileOrFolder(folder.entry.id);
|
||||
}
|
||||
});
|
||||
|
||||
it('[C260132] Move action on folder with - Load more', async () => {
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
|
||||
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Move');
|
||||
await contentServicesPage.pressContextMenuActionNamed('Move');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
|
||||
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
|
||||
await contentNodeSelector.checkSearchInputIsDisplayed();
|
||||
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
|
||||
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
|
||||
await contentNodeSelector.checkCancelButtonIsDisplayed();
|
||||
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
|
||||
|
||||
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
|
||||
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
|
||||
await infinitePaginationPage.clickLoadMoreButton();
|
||||
|
||||
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
|
||||
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
|
||||
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
|
||||
await contentNodeSelector.clickCancelButton();
|
||||
await contentNodeSelector.checkDialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Move');
|
||||
await contentServicesPage.pressContextMenuActionNamed('Move');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await infinitePaginationPage.clickLoadMoreButton();
|
||||
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
|
||||
await contentServicesPage.openFolder('F' + folderModel6.name);
|
||||
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Move');
|
||||
await contentServicesPage.pressContextMenuActionNamed('Move');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await breadCrumbDropdownPage.clickParentFolder();
|
||||
await breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
|
||||
await breadCrumbDropdownPage.choosePath(contentServicesUser.username);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
|
||||
|
||||
await breadCrumbPage.chooseBreadCrumb(contentServicesUser.username);
|
||||
await contentServicesPage.waitForTableBody();
|
||||
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||
});
|
||||
|
||||
it('[C305051] Copy action on folder with - Load more', async () => {
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Copy');
|
||||
await contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
|
||||
await contentNodeSelector.checkSearchInputIsDisplayed();
|
||||
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
|
||||
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
|
||||
await contentNodeSelector.checkCancelButtonIsDisplayed();
|
||||
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
|
||||
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
|
||||
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
|
||||
await infinitePaginationPage.clickLoadMoreButton();
|
||||
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
|
||||
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
|
||||
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
|
||||
await contentNodeSelector.clickCancelButton();
|
||||
await contentNodeSelector.checkDialogIsNotDisplayed();
|
||||
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||
|
||||
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
|
||||
await contentServicesPage.checkContextActionIsVisible('Copy');
|
||||
await contentServicesPage.pressContextMenuActionNamed('Copy');
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await infinitePaginationPage.clickLoadMoreButton();
|
||||
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.getDocumentList().dataTable.waitTillContentLoaded();
|
||||
await contentServicesPage.openFolder('F' + folderModel6.name);
|
||||
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
|
||||
});
|
||||
});
|
||||
});
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('Document List Component', () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
let acsUser = null;
|
||||
let acsUser: UserModel;
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
describe('Gallery View', () => {
|
||||
@@ -90,10 +90,9 @@ describe('Document List Component', () => {
|
||||
if (folderNode) {
|
||||
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await contentServicesPage.goToDocumentList();
|
||||
await contentServicesPage.clickGridViewButton();
|
||||
await contentServicesPage.checkCardViewContainerIsDisplayed();
|
||||
@@ -146,21 +145,6 @@ describe('Document List Component', () => {
|
||||
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line ban/ban
|
||||
xit('[C280129] Should keep Gallery View when accessing a folder', async () => {
|
||||
await contentServicesPage.navigateToCardFolder(folderName);
|
||||
|
||||
await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(1);
|
||||
await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
|
||||
});
|
||||
|
||||
it('[C280130] Should be able to go back to List View', async () => {
|
||||
await contentServicesPage.clickGridViewButton();
|
||||
await contentServicesPage.checkAcsContainer();
|
||||
await contentServicesPage.openFolder(folderName);
|
||||
await contentServicesPage.checkRowIsDisplayed(pdfFile.name);
|
||||
});
|
||||
|
||||
it('[C261993] Should be able to sort Gallery Cards by display name', async () => {
|
||||
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
|
||||
await contentServicesPage.checkListIsSortedByNameColumn('asc');
|
||||
|
@@ -50,8 +50,6 @@ describe('Document List - Pagination', () => {
|
||||
|
||||
let acsUser: UserModel;
|
||||
let fileNames = [];
|
||||
|
||||
let currentPage = 1;
|
||||
let secondSetOfFiles = [];
|
||||
|
||||
const nrOfFiles = 20;
|
||||
@@ -130,6 +128,7 @@ describe('Document List - Pagination', () => {
|
||||
});
|
||||
|
||||
it('[C260069] Should be able to set Items per page to 5', async () => {
|
||||
let currentPage = 1;
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await paginationPage.selectItemsPerPage('5');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
@@ -178,7 +177,7 @@ describe('Document List - Pagination', () => {
|
||||
});
|
||||
|
||||
it('[C260067] Should be able to set Items per page to 10', async () => {
|
||||
currentPage = 1;
|
||||
let currentPage = 1;
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await paginationPage.selectItemsPerPage('10');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
@@ -207,9 +206,8 @@ describe('Document List - Pagination', () => {
|
||||
});
|
||||
|
||||
it('[C260065] Should be able to set Items per page to 15', async () => {
|
||||
currentPage = 1;
|
||||
let currentPage = 1;
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
|
||||
await paginationPage.selectItemsPerPage('15');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
@@ -236,7 +234,6 @@ describe('Document List - Pagination', () => {
|
||||
|
||||
it('[C91320] Pagination should preserve sorting', async () => {
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
|
||||
|
||||
await paginationPage.selectItemsPerPage('20');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
@@ -269,7 +266,6 @@ describe('Document List - Pagination', () => {
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
|
||||
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
|
||||
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
|
||||
@@ -280,9 +276,8 @@ describe('Document List - Pagination', () => {
|
||||
});
|
||||
|
||||
it('[C260071] Should be able to change pagination when having 25 files', async () => {
|
||||
currentPage = 1;
|
||||
let currentPage = 1;
|
||||
await contentServicesPage.openFolder(folderThreeModel.name);
|
||||
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
|
||||
await paginationPage.selectItemsPerPage('15');
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
@@ -370,7 +365,6 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
@@ -436,5 +430,4 @@ describe('Document List - Pagination', () => {
|
||||
|
||||
await contentServicesPage.deleteSubFolderUnderRoot(newFolderModel.name, folderTwoModel.name);
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -1,92 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { createApiService, DropActions, LoginPage, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
|
||||
describe('Document List Component - Properties', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const navigationBar = new NavigationBarPage();
|
||||
|
||||
let subFolder; let parentFolder;
|
||||
const apiService = createApiService();
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
let acsUser = null;
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const pngFile = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
describe('Allow drop files property', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
acsUser = await usersActions.createUser();
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
parentFolder = await uploadActions.createFolder('parentFolder', '-my-');
|
||||
subFolder = await uploadActions.createFolder('subFolder', parentFolder.entry.id);
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
|
||||
await navigationBar.navigateToContentServices();
|
||||
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await uploadActions.deleteFileOrFolder(subFolder.entry.id);
|
||||
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
|
||||
await navigationBar.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
|
||||
await contentServicesPage.openFolder(parentFolder.entry.name);
|
||||
await contentServicesPage.disableDropFilesInAFolder();
|
||||
await browser.sleep(1000);
|
||||
|
||||
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
|
||||
|
||||
await DropActions.dropFile(dragAndDropArea, pngFile.location);
|
||||
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
|
||||
await contentServicesPage.openFolder(subFolder.entry.name);
|
||||
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
|
||||
});
|
||||
|
||||
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => {
|
||||
await contentServicesPage.openFolder(parentFolder.entry.name);
|
||||
await contentServicesPage.enableDropFilesInAFolder();
|
||||
await browser.sleep(1000);
|
||||
|
||||
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
|
||||
|
||||
await DropActions.dropFile(dragAndDropArea, pngFile.location);
|
||||
|
||||
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
|
||||
await contentServicesPage.openFolder(subFolder.entry.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
|
||||
});
|
||||
});
|
||||
});
|
@@ -17,38 +17,31 @@
|
||||
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const apiService = createApiService();
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
let acsUser = null;
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let acsUser: UserModel;
|
||||
|
||||
describe('Thumbnails and tooltips', () => {
|
||||
const pdfFile = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
|
||||
});
|
||||
|
||||
const testFile = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
|
||||
});
|
||||
|
||||
const docxFile = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_path
|
||||
});
|
||||
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
|
||||
let filePdfNode; let fileTestNode; let fileDocxNode; let folderNode;
|
||||
let filePdfNode: NodeEntry;
|
||||
let folderNode: NodeEntry;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -57,8 +50,6 @@ describe('Document List Component', () => {
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
|
||||
fileTestNode = await uploadActions.uploadFile(testFile.location, testFile.name, '-my-');
|
||||
fileDocxNode = await uploadActions.uploadFile(docxFile.location, docxFile.name, '-my-');
|
||||
folderNode = await uploadActions.createFolder(folderName, '-my-');
|
||||
});
|
||||
|
||||
@@ -69,12 +60,6 @@ describe('Document List Component', () => {
|
||||
if (filePdfNode) {
|
||||
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
|
||||
}
|
||||
if (fileTestNode) {
|
||||
await uploadActions.deleteFileOrFolder(fileTestNode.entry.id);
|
||||
}
|
||||
if (fileDocxNode) {
|
||||
await uploadActions.deleteFileOrFolder(fileDocxNode.entry.id);
|
||||
}
|
||||
if (folderNode) {
|
||||
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
|
||||
}
|
||||
@@ -97,26 +82,6 @@ describe('Document List Component', () => {
|
||||
await expect(await contentServicesPage.getDocumentList().getTooltip(folderName)).toEqual(folderName);
|
||||
});
|
||||
|
||||
it('[C260119] Should have a specific thumbnail for folders', async () => {
|
||||
const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName);
|
||||
await expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
|
||||
});
|
||||
|
||||
it('[C280066] Should have a specific thumbnail PDF files', async () => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
|
||||
await expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
|
||||
});
|
||||
|
||||
it('[C280067] Should have a specific thumbnail DOCX files', async () => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name);
|
||||
await expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
|
||||
});
|
||||
|
||||
it('[C280068] Should have a specific thumbnail files', async () => {
|
||||
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name);
|
||||
await expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
|
||||
});
|
||||
|
||||
it('[C274701] Should be able to enable thumbnails', async () => {
|
||||
await contentServicesPage.enableThumbnails();
|
||||
await contentServicesPage.checkAcsContainer();
|
||||
|
Reference in New Issue
Block a user