Disable control flow e2e ADF (#4954)

* update project script possible different JS-API

* first commit no controll flow

* second commit no controll flow

* third commit no controll flow

* 4 commit no controll flow

* 5 commit no controll flow

* 6 commit no controll flow

* 7 commit no controll flow

* 8 commit no controll flow

* 9 commit no controll flow

* 10 commit no controll flow

* 11 commit no controll flow

* 12 commit no controll flow

* 13 commit no controll flow

* 14 commit no controll flow

* 15 commit no controll flow

* 16 commit no controll flow

* 17 commit no controll flow

* 18 commit no controll flow

* 19 commit no controll flow

* 20 commit no controll flow

* remove wdpromise, protractor promise and deferred promises

* - fixed some incorrect “expect” calls
- fixed some matchers
- removed “return this;” when not needed
- added a few more await-s

* forgot a file

* fix some failing tests

* replaced driver calls with browser calls and enabled back waitForAngular

* fix rightClick methods and hopefully some tests

* fix settings-component

* some more fixes for core and content tests

* try to fix some more issues

* linting

* revert some changes, allowing download on headless chrome won’t work with multiple browser instances

* fixes for Search tests

* try to remove some wait calls

* fix build

* increase allScriptsTimeout and try another protractor and web driver version

* improve navigation methods

* some fixes for notification history and login sso

* forgot a space

* fix packages and enable some screenshots

* navigation bar fixes

* fix some test

* some fixes for notification history and navigation bar
use correct visibility method in attachFileWidget test

* fix searching and another fix for navigation

* try solve sso login

* some more fixes

* refactor async forEach into for..of

* try fix for search tests

* resolve rebabse problems

* remove install

* fix lint

* fix core e2e

* fix core e2e

* fix core e2e

* fix ps tests

* fix some tests

* fix core e2e

* fix core e2e

* fix core

* fix some issues PS

* fix core

* fix core

* fix some ps test

* fix rebase issues

* remove save

* fix url regressed after rebase

* fix url regressed after rebase

* fix ps and core

* fix lint

* more parallel e2e ps

* fix some ps cloud test

* some cloud fix

* fix lint

* fix some test

* remove files to be ignored

* out-tsc

* improve one cs test

* fix candidate base app

* fix ps test

* remove click function

* clean methods alrady present in browser action

* try ugly wait

* move wait

* remove duplicate call

* remove underscore

* fix after review

* fix imports

* minor cosmetic fixes

* fix comments test
This commit is contained in:
Eugenio Romano
2019-08-17 14:32:02 +02:00
committed by GitHub
parent 4f3cf669f2
commit 83412bb9b6
328 changed files with 17653 additions and 18793 deletions

View File

@@ -16,7 +16,13 @@
*/
import { browser, by, element } from 'protractor';
import { LoginPage, PaginationPage, UploadActions, StringUtil, ContentNodeSelectorDialogPage } from '@alfresco/adf-testing';
import {
LoginPage,
PaginationPage,
UploadActions,
StringUtil,
ContentNodeSelectorDialogPage
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
@@ -56,12 +62,12 @@ describe('Document List Component - Actions', () => {
const nrOfFiles = 5;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
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
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const files = {
@@ -69,7 +75,7 @@ describe('Document List Component - Actions', () => {
extension: '.txt'
};
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -85,150 +91,150 @@ describe('Document List Component - Actions', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
browser.driver.sleep(12000);
done();
await browser.sleep(10000);
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async(done) => {
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
done();
});
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('[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.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
});
it('[C260131] Copy - Destination picker search', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
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', () => {
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
it('[C297491] Should be able to move a file', async () => {
await 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);
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.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
});
it('[C260127] Move - Destination picker search', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
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', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280561] Should be able to delete a file via dropdown menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(fileNames[0]);
contentServicesPage.deleteContent(fileNames[0]);
contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
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', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', async () => {
await 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]);
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', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentListPage.rightClickOnRow(fileNames[2]);
contentServicesPage.pressContextMenuActionNamed('Delete');
contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
it('[C280565] Should be able to delete a file using context menu', async () => {
await contentServicesPage.doubleClickRow(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', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280567] Only one file is deleted when multiple files are selected using context menu', async () => {
await 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]);
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', () => {
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();
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();
});
});
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('[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.doubleClickRow(secondUploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderName);
});
it('[C260123] Should be able to delete a folder using context menu', () => {
contentServicesPage.deleteContent(folderName);
contentServicesPage.checkContentIsNotDisplayed(folderName);
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', () => {
contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
it('[C280568] Should be able to open context menu with right click', async () => {
await 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');
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');
});
});
@@ -236,19 +242,19 @@ describe('Document List Component - Actions', () => {
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()});
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) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
@@ -260,118 +266,117 @@ describe('Document List Component - Actions', () => {
folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-');
folder6 = await uploadActions.createFolder('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();
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await folders.forEach(function (folder) {
uploadActions.deleteFileOrFolder(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');
contentNodeSelector.checkDialogIsDisplayed();
expect(contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
contentNodeSelector.checkSearchInputIsDisplayed();
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
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);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
infinitePaginationPage.clickLoadMoreButton();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
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);
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
it('[C305051] Copy action on folder with - Load more', () => {
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);
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);
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.doubleClickRow('F' + folderModel6.name);
await 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);
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.id);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await breadCrumbPage.chooseBreadCrumb(contentServicesUser.id);
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().waitForTableBody();
await contentServicesPage.doubleClickRow('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});

View File

@@ -38,7 +38,7 @@ describe('Document List Component', () => {
let acsUser = null;
let testFileNode, pdfBFileNode;
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (uploadedFolder) {
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
@@ -56,32 +56,32 @@ describe('Document List Component', () => {
await uploadActions.deleteFileOrFolder(pdfBFileNode.entry.id);
pdfBFileNode = null;
}
done();
});
describe('Custom Column', () => {
let folderName;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const docxFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const timeAgoFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const mediumFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
name: resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
let pdfUploadedNode, docxUploadedNode, timeAgoUploadedNode, mediumDateUploadedNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
@@ -96,10 +96,10 @@ describe('Document List Component', () => {
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
pdfUploadedNode = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
docxUploadedNode = await uploadActions.uploadFile(docxFileModel.location, docxFileModel.name, '-my-');
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (pdfUploadedNode) {
@@ -114,71 +114,71 @@ describe('Document List Component', () => {
if (mediumDateUploadedNode) {
await uploadActions.deleteFileOrFolder(mediumDateUploadedNode.entry.id);
}
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
it('[C279926] Should only display the user\'s files and folders', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
expect(contentServicesPage.getDocumentListRowNumber()).toBe(4);
it('[C279926] Should only display the user\'s files and folders', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await expect(await contentServicesPage.getDocumentListRowNumber()).toBe(4);
});
it('[C279927] Should display default columns', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkColumnNameHeader();
contentServicesPage.checkColumnSizeHeader();
contentServicesPage.checkColumnCreatedByHeader();
contentServicesPage.checkColumnCreatedHeader();
it('[C279927] Should display default columns', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkColumnNameHeader();
await contentServicesPage.checkColumnSizeHeader();
await contentServicesPage.checkColumnCreatedByHeader();
await contentServicesPage.checkColumnCreatedHeader();
});
it('[C279928] Should be able to display date with timeAgo', async (done) => {
it('[C279928] Should be able to display date with timeAgo', async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
timeAgoUploadedNode = await uploadActions.uploadFile(timeAgoFileModel.location, timeAgoFileModel.name, '-my-');
contentServicesPage.goToDocumentList();
const dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
expect(dateValue).toMatch(/(ago|few)/);
done();
await contentServicesPage.goToDocumentList();
const dateValue = await contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
await expect(dateValue).toMatch(/(ago|few)/);
});
it('[C279929] Should be able to display the date with date type', async (done) => {
it('[C279929] Should be able to display the date with date type', async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
mediumDateUploadedNode = await uploadActions.uploadFile(mediumFileModel.location, mediumFileModel.name, '-my-');
const createdDate = moment(mediumDateUploadedNode.createdAt).format('ll');
contentServicesPage.goToDocumentList();
contentServicesPage.enableMediumTimeFormat();
const dateValue = contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created');
expect(dateValue).toContain(createdDate);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.enableMediumTimeFormat();
const dateValue = await contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created');
await expect(dateValue).toContain(createdDate);
});
});
describe('Column Sorting', () => {
const fakeFileA = new FileModel({
'name': 'A',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'A',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const fakeFileB = new FileModel({
'name': 'B',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'B',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const fakeFileC = new FileModel({
'name': 'C',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'C',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
let fileANode, fileBNode, fileCNode;
beforeAll(async (done) => {
beforeAll(async () => {
const user = new AcsUserModel();
@@ -192,12 +192,11 @@ describe('Document List Component', () => {
fileCNode = await uploadActions.uploadFile(fakeFileC.location, fakeFileC.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(user);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (fileANode) {
await uploadActions.deleteFileOrFolder(fileANode.entry.id);
@@ -208,53 +207,53 @@ describe('Document List Component', () => {
if (fileCNode) {
await uploadActions.deleteFileOrFolder(fileCNode.entry.id);
}
done();
});
it('[C260112] Should be able to sort by name (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByName('asc')).toBe(true, 'List is not sorted.');
it('[C260112] Should be able to sort by name (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByName('asc')).toBe(true, 'List is not sorted.');
});
it('[C272770] Should be able to sort by name (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByName('desc')).toBe(true, 'List is not sorted.');
it('[C272770] Should be able to sort by name (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByName('desc')).toBe(true, 'List is not sorted.');
});
it('[C272771] Should be able to sort by author (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByAuthor('asc')).toBe(true, 'List is not sorted.');
it('[C272771] Should be able to sort by author (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('asc')).toBe(true, 'List is not sorted.');
});
it('[C272772] Should be able to sort by author (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByAuthor('desc')).toBe(true, 'List is not sorted.');
it('[C272772] Should be able to sort by author (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('desc')).toBe(true, 'List is not sorted.');
});
it('[C272773] Should be able to sort by date (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByCreated('asc')).toBe(true, 'List is not sorted.');
it('[C272773] Should be able to sort by date (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('asc')).toBe(true, 'List is not sorted.');
});
it('[C272774] Should be able to sort by date (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByCreated('desc')).toBe(true, 'List is not sorted.');
it('[C272774] Should be able to sort by date (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('desc')).toBe(true, 'List is not sorted.');
});
});
it('[C279959] Should display empty folder state for new folders', async (done) => {
it('[C279959] Should display empty folder state for new folders', async () => {
acsUser = new AcsUserModel();
const folderName = 'BANANA';
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.createNewFolder(folderName);
contentServicesPage.doubleClickRow(folderName);
contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
});
it('[C272775] Should be able to upload a file in new folder', async (done) => {
it('[C272775] Should be able to upload a file in new folder', async () => {
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
acsUser = new AcsUserModel();
/* cspell:disable-next-line */
@@ -264,30 +263,30 @@ describe('Document List Component', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.uploadFile(testFile.location);
contentServicesPage.checkContentIsDisplayed(testFile.name);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.uploadFile(testFile.location);
await contentServicesPage.checkContentIsDisplayed(testFile.name);
});
it('[C261997] Should be able to clean Recent Files history', async (done) => {
it('[C261997] Should be able to clean Recent Files history', async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.clickOnContentServices();
contentServicesPage.checkRecentFileToBeShowed();
await contentServicesPage.clickOnContentServices();
await contentServicesPage.checkRecentFileToBeShowed();
const icon = await contentServicesPage.getRecentFileIcon();
expect(icon).toBe('history');
contentServicesPage.expandRecentFiles();
contentServicesPage.checkEmptyRecentFileIsDisplayed();
contentServicesPage.closeRecentFiles();
done();
await expect(icon).toBe('history');
await contentServicesPage.expandRecentFiles();
await contentServicesPage.checkEmptyRecentFileIsDisplayed();
await contentServicesPage.closeRecentFiles();
});
it('[C279970] Should display Islocked field for folders', async (done) => {
it('[C279970] Should display Islocked field for folders', async () => {
acsUser = new AcsUserModel();
const folderNameA = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
const folderNameB = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
@@ -297,22 +296,22 @@ describe('Document List Component', () => {
uploadedFolder = await uploadActions.createFolder(folderNameA, '-my-');
uploadedFolderExtra = await uploadActions.createFolder(folderNameB, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(folderNameA);
contentServicesPage.checkContentIsDisplayed(folderNameB);
contentServicesPage.checkLockIsDisplayedForElement(folderNameA);
contentServicesPage.checkLockIsDisplayedForElement(folderNameB);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(folderNameA);
await contentServicesPage.checkContentIsDisplayed(folderNameB);
await contentServicesPage.checkLockIsDisplayedForElement(folderNameA);
await contentServicesPage.checkLockIsDisplayedForElement(folderNameB);
});
it('[C269086] Should display Islocked field for files', async (done) => {
it('[C269086] Should display Islocked field for files', async () => {
const testFileA = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const testFileB = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
name: resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -321,19 +320,19 @@ describe('Document List Component', () => {
testFileNode = await uploadActions.uploadFile(testFileA.location, testFileA.name, '-my-');
pdfBFileNode = await uploadActions.uploadFile(testFileB.location, testFileB.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(testFileA.name);
contentServicesPage.checkContentIsDisplayed(testFileB.name);
contentServicesPage.checkLockIsDisplayedForElement(testFileA.name);
contentServicesPage.checkLockIsDisplayedForElement(testFileB.name);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(testFileA.name);
await contentServicesPage.checkContentIsDisplayed(testFileB.name);
await contentServicesPage.checkLockIsDisplayedForElement(testFileA.name);
await contentServicesPage.checkLockIsDisplayedForElement(testFileB.name);
});
describe('Once uploaded 20 folders', () => {
let folderCreated;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
folderCreated = [];
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -346,22 +345,19 @@ describe('Document List Component', () => {
folder = await uploadActions.createFolder(folderName, '-my-');
folderCreated.push(folder);
}
done();
});
afterAll(async (done) => {
Promise.all(folderCreated.map((folder) =>
uploadActions.deleteFileOrFolder(folder.entry.id)
)).then(() => {
done();
});
afterAll(async () => {
for (let i = 0; i <= folderCreated.length; i++) {
await uploadActions.deleteFileOrFolder(folderCreated[i].entry.id);
}
});
it('[C277093] Should sort files with Items per page set to default', async (done) => {
it('[C277093] Should sort files with Items per page set to default', async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkListIsSortedByNameColumn('asc');
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
});
@@ -369,14 +365,14 @@ describe('Document List Component', () => {
describe('Column Template', () => {
const file0BytesModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
let file;
const viewer = new ViewerPage();
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -384,16 +380,16 @@ describe('Document List Component', () => {
file = await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList()
.waitForTableBody();
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
});
it('[C291843] Should be able to navigate using nodes hyperlink when activated', () => {
contentServicesPage.clickHyperlinkNavigationToggle()
.checkFileHyperlinkIsEnabled(file.entry.name)
.clickFileHyperlink(file.entry.name);
viewer.checkFileIsLoaded();
it('[C291843] Should be able to navigate using nodes hyperlink when activated', async () => {
await contentServicesPage.clickHyperlinkNavigationToggle();
await contentServicesPage.checkFileHyperlinkIsEnabled(file.entry.name);
await contentServicesPage.clickFileHyperlink(file.entry.name);
await viewer.checkFileIsLoaded();
});
});
});

View File

@@ -50,16 +50,16 @@ describe('Document List Component', () => {
let folderName, sameNameFolder;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
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
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
anotherAcsUser = new AcsUserModel();
folderName = StringUtil.generateRandomString(5);
@@ -90,131 +90,129 @@ describe('Document List Component', () => {
}
});
browser.driver.sleep(12000);
done();
await browser.driver.sleep(12000);
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
try {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
} catch (error) {
// tslint:disable-next-line:no-console
console.log('Error delete file or folder' + error);
}
done();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
});
describe('Document List Component - Actions Move and Copy', () => {
beforeEach(async (done) => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
done();
});
it('[C260128] Move - Same name file', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
beforeEach(async () => {
await BrowserActions.closeMenuAndDialogs();
await navigationBarPage.clickContentServicesButton();
});
it('[C260134] Move - folder with subfolder and file within it', () => {
contentServicesPage.checkContentIsDisplayed(destinationFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(sourceFolder.entry.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(destinationFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name);
contentServicesPage.doubleClickRow(destinationFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
contentServicesPage.doubleClickRow(sourceFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
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('[C260135] Move - Same name folder', () => {
contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
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.doubleClickRow(destinationFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
await contentServicesPage.doubleClickRow(sourceFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
});
it('[C260129] Copy - Same name file', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different 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('[C260136] Copy - Same name folder', () => {
contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
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.');
});
});
describe('Document List actionns - Move, Copy on no permission folder', () => {
beforeAll((done) => {
loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + sourceFolder.entry.id);
contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
done();
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
await BrowserActions.getUrl(`${browser.params.testConfig.adf.url}/files/${sourceFolder.entry.id}`);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260133] Move - no permission folder', () => {
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(subFolder.entry.name);
contentServicesPage.checkContextActionIsVisible('Move');
expect(contentServicesPage.checkContentActionIsEnabled('Move')).toBe(false);
contentServicesPage.closeActionContext();
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', () => {
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(copyFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(copyFolder.entry.name);
contentServicesPage.checkContextActionIsVisible('Copy');
expect(contentServicesPage.checkContentActionIsEnabled('Copy')).toBe(true);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisabled(subFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
expect(contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
contentNodeSelector.contentListPage().dataTablePage().doubleClickRowByContent(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().waitTillContentLoaded();
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder2.entry.name);
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);
});
});

View File

@@ -34,7 +34,6 @@ describe('Document List Component', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let acsUser = null;
const navBar = new NavigationBarPage();
const navigationBarPage = new NavigationBarPage();
describe('Gallery View', () => {
@@ -50,23 +49,23 @@ describe('Document List Component', () => {
let funnyUser;
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const docxFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
let filePdfNode, fileTestNode, fileDocxNode, folderNode, filePDFSubNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
funnyUser = await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -79,7 +78,6 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
@@ -87,92 +85,94 @@ describe('Document List Component', () => {
});
beforeEach(async () => {
navBar.clickHomeButton();
contentServicesPage.goToDocumentList();
contentServicesPage.clickGridViewButton();
contentServicesPage.checkCardViewContainerIsDisplayed();
await navigationBarPage.clickHomeButton();
await contentServicesPage.goToDocumentList();
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkCardViewContainerIsDisplayed();
});
it('[C280016] Should be able to choose Gallery View', () => {
expect(contentServicesPage.getCardElementShowedInPage()).toBe(4);
it('[C280016] Should be able to choose Gallery View', async () => {
await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(4);
});
it('[C280023] Gallery Card should show details', () => {
expect(contentServicesPage.getDocumentCardIconForElement(folderName)).toContain('/assets/images/ft_ic_folder.svg');
expect(contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
expect(contentServicesPage.getDocumentCardIconForElement(docxFile.name)).toContain('/assets/images/ft_ic_ms_word.svg');
expect(contentServicesPage.getDocumentCardIconForElement(testFile.name)).toContain('/assets/images/ft_ic_document.svg');
contentServicesPage.checkMenuIsShowedForElementIndex(0);
contentServicesPage.checkMenuIsShowedForElementIndex(1);
contentServicesPage.checkMenuIsShowedForElementIndex(2);
contentServicesPage.checkMenuIsShowedForElementIndex(3);
it('[C280023] Gallery Card should show details', async () => {
await expect(await contentServicesPage.getDocumentCardIconForElement(folderName)).toContain('/assets/images/ft_ic_folder.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(docxFile.name)).toContain('/assets/images/ft_ic_ms_word.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(testFile.name)).toContain('/assets/images/ft_ic_document.svg');
await contentServicesPage.checkMenuIsShowedForElementIndex(0);
await contentServicesPage.checkMenuIsShowedForElementIndex(1);
await contentServicesPage.checkMenuIsShowedForElementIndex(2);
await contentServicesPage.checkMenuIsShowedForElementIndex(3);
});
it('[C280069] Gallery Card should show attributes', () => {
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.DISPLAY_NAME);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.SIZE);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED_BY);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED);
it('[C280069] Gallery Card should show attributes', async () => {
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.DISPLAY_NAME);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.SIZE);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED_BY);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`105.02 KB`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`105.02 KB`);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY))
.toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY))
.toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
});
it('[C280129] Should keep Gallery View when accessing a folder', () => {
contentServicesPage.navigateToCardFolder(folderName);
it('[C280129] Should keep Gallery View when accessing a folder', async () => {
await contentServicesPage.navigateToCardFolder(folderName);
expect(contentServicesPage.getCardElementShowedInPage()).toBe(1);
expect(contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
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', () => {
contentServicesPage.clickGridViewButton();
contentServicesPage.checkAcsContainer();
contentServicesPage.doubleClickRow(folderName);
contentServicesPage.checkRowIsDisplayed(pdfFile.name);
it('[C280130] Should be able to go back to List View', async () => {
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.checkRowIsDisplayed(pdfFile.name);
});
it('[C261993] Should be able to sort Gallery Cards by display name', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
contentServicesPage.checkListIsSortedByNameColumn('asc');
it('[C261993] Should be able to sort Gallery Cards by display name', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
it('[C261994] Should be able to sort Gallery Cards by size', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.SIZE);
contentServicesPage.checkListIsSortedBySizeColumn('asc');
it('[C261994] Should be able to sort Gallery Cards by size', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.SIZE);
await contentServicesPage.checkListIsSortedBySizeColumn('asc');
});
it('[C261995] Should be able to sort Gallery Cards by author', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY);
contentServicesPage.checkListIsSortedByAuthorColumn('asc');
it('[C261995] Should be able to sort Gallery Cards by author', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY);
await contentServicesPage.checkListIsSortedByAuthorColumn('asc');
});
it('[C261996] Should be able to sort Gallery Cards by created date', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED);
contentServicesPage.checkListIsSortedByCreatedColumn('asc');
it('[C261996] Should be able to sort Gallery Cards by created date', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED);
await contentServicesPage.checkListIsSortedByCreatedColumn('asc');
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (filePdfNode) {
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
@@ -189,7 +189,7 @@ describe('Document List Component', () => {
if (folderNode) {
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
}
done();
});
});

View File

@@ -24,7 +24,7 @@ import { Util } from '../../util/util';
import { browser } from 'protractor';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
describe('Document List - Pagination', function () {
describe('Document List - Pagination', () => {
const pagination = {
base: 'newFile',
secondSetBase: 'secondSet',
@@ -49,21 +49,21 @@ describe('Document List - Pagination', function () {
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
const newFolderModel = new FolderModel({ 'name': 'newFolder' });
const newFolderModel = new FolderModel({ name: 'newFolder' });
let fileNames = [];
const nrOfFiles = 20;
let currentPage = 1;
let secondSetOfFiles = [];
const secondSetNumber = 25;
const folderTwoModel = new FolderModel({ 'name': 'folderTwo' });
const folderThreeModel = new FolderModel({ 'name': 'folderThree' });
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
const folderThreeModel = new FolderModel({ name: 'folderThree' });
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension);
secondSetOfFiles = Util.generateSequenceFiles(10, secondSetNumber + 9, pagination.secondSetBase, pagination.extension);
@@ -80,270 +80,256 @@ describe('Document List - Pagination', function () {
await uploadActions.createEmptyFiles(secondSetOfFiles, folderThreeUploadedModel.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach((done) => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
done();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
});
it('[C260062] Should use default pagination settings', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
});
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C260062] Should use default pagination settings', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C274713] Should be able to set Items per page to 20', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
});
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C274713] Should be able to set Items per page to 20', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
it('[C260069] Should be able to set Items per page to 5', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
});
paginationPage.clickOnNextPage();
it('[C260069] Should be able to set Items per page to 5', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
});
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
browser.refresh();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.refresh();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
it('[C260067] Should be able to set Items per page to 10', () => {
it('[C260067] Should be able to set Items per page to 10', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.ten);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
});
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
browser.refresh();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.refresh();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
currentPage = 1;
});
it('[C260065] Should be able to set Items per page to 15', () => {
it('[C260065] Should be able to set Items per page to 15', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
});
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
browser.refresh();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await browser.refresh();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
});
it('[C91320] Pagination should preserve sorting', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
it('[C91320] Pagination should preserve sorting', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
contentServicesPage.sortByName('DESC');
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await contentServicesPage.sortByName('DESC');
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.selectItemsPerPage(itemsPerPage.ten);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
});
it('[C260107] Should not display pagination bar when a folder is empty', () => {
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
contentServicesPage.createNewFolder(folderTwoModel.name).checkContentIsDisplayed(folderTwoModel.name);
contentServicesPage.doubleClickRow(folderTwoModel.name);
contentServicesPage.checkPaginationIsNotDisplayed();
it('[C260107] Should not display pagination bar when a folder is empty', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await contentServicesPage.createNewFolder(folderTwoModel.name);
await contentServicesPage.checkContentIsDisplayed(folderTwoModel.name);
await contentServicesPage.doubleClickRow(folderTwoModel.name);
await contentServicesPage.checkPaginationIsNotDisplayed();
});
it('[C260071] Should be able to change pagination when having 25 files', () => {
it('[C260071] Should be able to change pagination when having 25 files', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(folderThreeModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
});
await contentServicesPage.doubleClickRow(folderThreeModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + secondSetNumber + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + secondSetNumber + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
currentPage = 1;
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyValue * currentPage + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
});
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyValue * currentPage + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 21-' + secondSetNumber + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 21-' + secondSetNumber + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
});
});

View File

@@ -40,9 +40,9 @@ describe('Document List Component', () => {
});
});
describe('Permission Message', async () => {
describe('Permission Message', () => {
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
const siteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`;
const privateSiteBody = { visibility: 'PRIVATE', title: siteName };
@@ -55,36 +55,35 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
navBar.openLanguageMenu();
navBar.chooseLanguage('English');
done();
await navBar.openLanguageMenu();
await navBar.chooseLanguage('English');
});
it('[C217334] Should display a message when accessing file without permissions', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorCode()).toBe('403');
expect(errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
it('[C217334] Should display a message when accessing file without permissions', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorCode()).toBe('403');
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
});
it('[C279924] Should display custom message when accessing a file without permissions', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.enableCustomPermissionMessage();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorCode()).toBe('403');
it('[C279924] Should display custom message when accessing a file without permissions', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.enableCustomPermissionMessage();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorCode()).toBe('403');
});
it('[C279925] Should display translated message when accessing a file without permissions if language is changed', () => {
navBar.openLanguageMenu();
navBar.chooseLanguage('Italiano');
browser.sleep(2000);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
it('[C279925] Should display translated message when accessing a file without permissions if language is changed', async () => {
await navBar.openLanguageMenu();
await navBar.chooseLanguage('Italiano');
await browser.sleep(2000);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
});
});

View File

@@ -29,7 +29,7 @@ describe('Document List Component - Properties', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const navigationBar = new NavigationBarPage();
let subFolder, parentFolder;
this.alfrescoJsApi = new AlfrescoApi({
@@ -40,13 +40,13 @@ describe('Document List Component - Properties', () => {
let acsUser = null;
const pngFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
describe('Allow drop files property', async () => {
describe('Allow drop files property', () => {
beforeEach(async (done) => {
beforeEach(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -61,46 +61,44 @@ describe('Document List Component - Properties', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(subFolder.entry.id);
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
done();
});
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.doubleClickRow(parentFolder.entry.name);
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.disableDropFilesInAFolder();
await contentServicesPage.disableDropFilesInAFolder();
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
});
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.doubleClickRow(parentFolder.entry.name);
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.enableDropFilesInAFolder();
await contentServicesPage.enableDropFilesInAFolder();
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
await dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
});
});
});

View File

@@ -38,7 +38,7 @@ describe('Document List Component', () => {
let testFileNode, pdfBFileNode;
const navigationBarPage = new NavigationBarPage();
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (uploadedFolder) {
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
@@ -56,29 +56,29 @@ describe('Document List Component', () => {
await uploadActions.deleteFileOrFolder(pdfBFileNode.entry.id);
pdfBFileNode = null;
}
done();
});
describe('Thumbnails and tooltips', () => {
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const docxFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
let filePdfNode, fileTestNode, fileDocxNode, folderNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -90,10 +90,9 @@ describe('Document List Component', () => {
fileDocxNode = await uploadActions.uploadFile(docxFile.location, docxFile.name, '-my-');
folderNode = await uploadActions.createFolder(folderName, '-my-');
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -109,52 +108,52 @@ describe('Document List Component', () => {
if (folderNode) {
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
}
done();
});
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
});
it('[C260108] Should display tooltip for file\'s name', () => {
expect(contentServicesPage.getContentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
it('[C260108] Should display tooltip for file\'s name', async () => {
await expect(await contentServicesPage.getDocumentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
});
it('[C260109] Should display tooltip for folder\'s name', () => {
expect(contentServicesPage.getContentList().getTooltip(folderName)).toEqual(folderName);
it('[C260109] Should display tooltip for folder\'s name', async () => {
await expect(await contentServicesPage.getDocumentList().getTooltip(folderName)).toEqual(folderName);
});
it('[C260119] Should have a specific thumbnail for folders', async (done) => {
it('[C260119] Should have a specific thumbnail for folders', async () => {
const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName);
expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
done();
await expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
});
it('[C280066] Should have a specific thumbnail PDF files', async (done) => {
it('[C280066] Should have a specific thumbnail PDF files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
});
it('[C280067] Should have a specific thumbnail DOCX files', async (done) => {
it('[C280067] Should have a specific thumbnail DOCX files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
});
it('[C280068] Should have a specific thumbnail files', async (done) => {
it('[C280068] Should have a specific thumbnail files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
});
it('[C274701] Should be able to enable thumbnails', async (done) => {
contentServicesPage.enableThumbnails();
contentServicesPage.checkAcsContainer();
it('[C274701] Should be able to enable thumbnails', async () => {
await contentServicesPage.enableThumbnails();
await contentServicesPage.checkAcsContainer();
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
done();
await expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
});
});