[AAE-1880] e2e document-list selection mode (#5518)

* [AAE-1880] e2e document-list selection mode, open file/folder

* resolved comments: backtick, refactoring names, using dropdownPage, removing comments, wrapping the API

* added a new try-catch for beforeAll, fixed the error message

* changed the name of a method from clickDropdownWithOption to selectDropdownOption

* changed the method name from clickDropdown... to selectDropdownOption

* added the variable type for some methods, delete the let list and refactor accordingly
This commit is contained in:
Alexandra Abrudan 2020-03-03 18:50:36 +00:00 committed by GitHub
parent 2b1a321baf
commit 24c728a8f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 252 additions and 78 deletions

View File

@ -21,7 +21,7 @@ import {
PaginationPage, PaginationPage,
UploadActions, UploadActions,
StringUtil, StringUtil,
ContentNodeSelectorDialogPage ContentNodeSelectorDialogPage, ViewerPage
} from '@alfresco/adf-testing'; } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/content-services.page'; import { ContentServicesPage } from '../../pages/adf/content-services.page';
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page'; import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
@ -44,6 +44,7 @@ describe('Document List Component - Actions', () => {
const paginationPage = new PaginationPage(); const paginationPage = new PaginationPage();
const breadCrumbDropdownPage = new BreadCrumbDropdownPage(); const breadCrumbDropdownPage = new BreadCrumbDropdownPage();
const breadCrumbPage = new BreadCrumbPage(); const breadCrumbPage = new BreadCrumbPage();
const viewerPage = new ViewerPage();
this.alfrescoJsApi = new AlfrescoApi({ this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM', provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host hostEcm: browser.params.testConfig.adf_acs.host
@ -91,7 +92,6 @@ describe('Document List Component - Actions', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser); await loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.sleep(10000); await browser.sleep(10000);
}); });
afterAll(async () => { afterAll(async () => {
@ -203,6 +203,12 @@ describe('Document List Component - Actions', () => {
await contentServicesPage.closeActionContext(); await contentServicesPage.closeActionContext();
}); });
it('[C260060] Should be able to open a file/folder through double click action - file', async () => {
await contentServicesPage.doubleClickRow(pdfFileModel.name);
await expect(await viewerPage.getDisplayedFileName()).toEqual(pdfFileModel.name);
await viewerPage.checkPreviewFileDefaultOptionsAreDisplayed();
await viewerPage.clickCloseButton();
});
}); });
describe('Folder Actions', () => { describe('Folder Actions', () => {
@ -218,6 +224,16 @@ describe('Document List Component - Actions', () => {
await contentServicesPage.checkContentIsDisplayed(folderName); await contentServicesPage.checkContentIsDisplayed(folderName);
}); });
it('[C260060] Should be able to open a file/folder through double click action - folder', async () => {
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
const numberOfSubFolders = 3;
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
for (let i = 0; i < numberOfSubFolders; i++) {
await contentServicesPage.createNewFolder('subFolder' + (i + 1));
}
await contentServicesPage.checkContentsAreDisplayed(numberOfSubFolders);
});
it('[C260123] Should be able to delete a folder using context menu', async () => { it('[C260123] Should be able to delete a folder using context menu', async () => {
await contentServicesPage.deleteContent(folderName); await contentServicesPage.deleteContent(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName); await contentServicesPage.checkContentIsNotDisplayed(folderName);
@ -253,7 +269,6 @@ describe('Document List Component - Actions', () => {
const contentServicesUser = new AcsUserModel(); const contentServicesUser = new AcsUserModel();
beforeAll(async () => { beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser); await this.alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
await this.alfrescoJsApi.login(contentServicesUser.id, contentServicesUser.password); await this.alfrescoJsApi.login(contentServicesUser.id, contentServicesUser.password);
@ -283,7 +298,6 @@ describe('Document List Component - Actions', () => {
}); });
it('[C260132] Move action on folder with - Load more', async () => { it('[C260132] Move action on folder with - Load more', async () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
@ -339,7 +353,6 @@ describe('Document List Component - Actions', () => {
}); });
it('[C305051] Copy action on folder with - Load more', async () => { it('[C305051] Copy action on folder with - Load more', async () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6); await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);

View File

@ -105,7 +105,7 @@ describe('Document List - Pagination', () => {
it('[C260062] Should use default pagination settings', async () => { it('[C260062] Should use default pagination settings', async () => {
await contentServicesPage.openFolder(newFolderModel.name); await contentServicesPage.openFolder(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${nrOfFiles} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn(); const list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
@ -119,7 +119,7 @@ describe('Document List - Pagination', () => {
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${nrOfFiles} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn(); const list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
@ -141,7 +141,7 @@ describe('Document List - Pagination', () => {
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
let list = await contentServicesPage.getAllRowsNameColumn(); let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
@ -149,7 +149,7 @@ describe('Document List - Pagination', () => {
currentPage++; currentPage++;
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 6-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn(); list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
@ -157,7 +157,7 @@ describe('Document List - Pagination', () => {
currentPage++; currentPage++;
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn(); list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
@ -165,7 +165,7 @@ describe('Document List - Pagination', () => {
currentPage++; currentPage++;
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn(); list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
@ -184,7 +184,7 @@ describe('Document List - Pagination', () => {
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.tenValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
let list = await contentServicesPage.getAllRowsNameColumn(); let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
@ -192,7 +192,7 @@ describe('Document List - Pagination', () => {
currentPage++; currentPage++;
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 11-${itemsPerPage.tenValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
list = await contentServicesPage.getAllRowsNameColumn(); list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
@ -213,7 +213,7 @@ describe('Document List - Pagination', () => {
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fifteenValue * currentPage} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
let list = await contentServicesPage.getAllRowsNameColumn(); let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
@ -222,7 +222,7 @@ describe('Document List - Pagination', () => {
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfFiles + ' of ' + nrOfFiles); await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 16-${nrOfFiles} of ${nrOfFiles}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
list = await contentServicesPage.getAllRowsNameColumn(); list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true); await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
@ -276,7 +276,7 @@ describe('Document List - Pagination', () => {
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + secondSetNumber); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fifteenValue * currentPage} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
let list = await contentServicesPage.getAllRowsNameColumn(); let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true); await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
@ -285,7 +285,7 @@ describe('Document List - Pagination', () => {
await paginationPage.clickOnNextPage(); await paginationPage.clickOnNextPage();
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + secondSetNumber + ' of ' + secondSetNumber); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${secondSetNumber} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
list = await contentServicesPage.getAllRowsNameColumn(); list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true); await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
@ -294,7 +294,7 @@ describe('Document List - Pagination', () => {
await paginationPage.selectItemsPerPage(itemsPerPage.twenty); await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyValue * currentPage + ' of ' + secondSetNumber); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.twentyValue * currentPage} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
list = await contentServicesPage.getAllRowsNameColumn(); list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true); await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
@ -303,7 +303,7 @@ describe('Document List - Pagination', () => {
await paginationPage.clickOnNextPage(); await paginationPage.clickOnNextPage();
await contentServicesPage.checkDocumentListElementsAreDisplayed(); await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 21-' + secondSetNumber + ' of ' + secondSetNumber); await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 21-${secondSetNumber} of ${secondSetNumber}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
list = await contentServicesPage.getAllRowsNameColumn(); list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true); await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
@ -329,7 +329,7 @@ describe('Document List - Pagination', () => {
await paginationPage.selectItemsPerPage(itemsPerPage.twentyOne); await paginationPage.selectItemsPerPage(itemsPerPage.twentyOne);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twentyOne); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twentyOne);
await browser.refresh(); await browser.refresh();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyOneValue + ' of ' + numberOfFilesAfterUpload); await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${itemsPerPage.twentyOneValue} of ${numberOfFilesAfterUpload}`);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyOneValue); await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyOneValue);
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20])); await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20]));
@ -349,15 +349,15 @@ describe('Document List - Pagination', () => {
await contentServicesPage.createNewFolder('subfolder' + (i + 1)); await contentServicesPage.createNewFolder('subfolder' + (i + 1));
} }
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
await paginationPage.clickOnNextPage(); await paginationPage.clickOnNextPage();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + numberOfSubFolders + ' of ' + numberOfSubFolders); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
await contentServicesPage.openFolder('subfolder6'); await contentServicesPage.openFolder('subfolder6');
for (let i = 0; i < numberOfSubFolders; i++) { for (let i = 0; i < numberOfSubFolders; i++) {
await contentServicesPage.createNewFolder('subfolder' + (i + 1)); await contentServicesPage.createNewFolder('subfolder' + (i + 1));
} }
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
await expect(await paginationPage.getCurrentPage()).toEqual('Page 1'); await expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
await expect(await paginationPage.getTotalPages()).toEqual('of 2'); await expect(await paginationPage.getTotalPages()).toEqual('of 2');
@ -372,13 +372,13 @@ describe('Document List - Pagination', () => {
for (let i = 0; i < numberOfSubFolders; i++) { for (let i = 0; i < numberOfSubFolders; i++) {
await contentServicesPage.createNewFolder('subfolder' + (i + 1)); await contentServicesPage.createNewFolder('subfolder' + (i + 1));
} }
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
await contentServicesPage.chooseSelectionMode('Single'); await contentServicesPage.chooseSelectionMode('Single');
await contentServicesPage.selectFolder('subfolder1'); await contentServicesPage.selectFolder('subfolder1');
await paginationPage.clickOnNextPage(); await paginationPage.clickOnNextPage();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + numberOfSubFolders + ' of ' + numberOfSubFolders); await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
await contentServicesPage.selectFolderWithCommandKey('subfolder6'); await contentServicesPage.selectFolderWithCommandKey('subfolder6');
await contentServicesPage.clickDownloadButton(); await contentServicesPage.clickDownloadButton();

View File

@ -0,0 +1,137 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { LoginPage, PaginationPage } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/content-services.page';
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
import { AcsUserModel } from '../../models/ACS/acs-user.model';
import { FolderModel } from '../../models/ACS/folder.model';
import { browser } from 'protractor';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { FileModel } from '../../models/ACS/file.model';
import { UploadDialogPage } from '../../pages/adf/dialog/upload-dialog.page';
describe('Document List - Selection', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const uploadDialog = new UploadDialogPage();
const paginationPage = new PaginationPage();
const acsUser = new AcsUserModel();
const folderModel = new FolderModel({ name: 'folder' });
const docxFileModel = new FileModel({
'name': browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const displayColumnName = 'Display name';
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
beforeAll(async () => {
try {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await contentServicesPage.createNewFolder(folderModel.name);
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
} catch (error) {
throw new Error(`API call failed in beforeAll: ${error}`);
}
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C274696] Should be able to select and unselect a file or folder', async () => {
await contentServicesPage.selectRow(docxFileModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, docxFileModel.name);
await paginationPage.clickItemsPerPageDropdown();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, docxFileModel.name);
await contentServicesPage.selectRow(docxFileModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, docxFileModel.name);
await contentServicesPage.selectRow(folderModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name);
await paginationPage.clickItemsPerPageDropdown();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name);
await contentServicesPage.selectRow(folderModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, folderModel.name);
});
it('[C260057] Should be able to choose between the Selection Mode options and select items accordingly', async () => {
await contentServicesPage.chooseSelectionMode('None');
await contentServicesPage.selectRow(docxFileModel.name);
await contentServicesPage.selectFolderWithCommandKey(folderModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, docxFileModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, folderModel.name);
await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[]');
await contentServicesPage.chooseSelectionMode('Single');
await contentServicesPage.selectRow(docxFileModel.name);
await contentServicesPage.selectFolderWithCommandKey(folderModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, docxFileModel.name );
await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[\"' + folderModel.name + '\"]');
await contentServicesPage.chooseSelectionMode('Multiple');
await contentServicesPage.selectRow(docxFileModel.name);
await contentServicesPage.selectFolderWithCommandKey(folderModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, docxFileModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name);
await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[\"' + docxFileModel.name + '","' + folderModel.name + '\"]');
});
it('[C212928] Should be able to enable the Multiselect (with checkboxes) toggle and select items accordingly', async () => {
await contentServicesPage.chooseSelectionMode('Multiple');
await contentServicesPage.clickMultiSelectToggle();
await expect(await contentServicesPage.multiSelectToggleIsEnabled()).toBe(true);
await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[]');
await contentServicesPage.selectItemWithCheckbox(docxFileModel.name);
await contentServicesPage.selectItemWithCheckbox(folderModel.name);
await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[\"' + docxFileModel.name + '","' + folderModel.name + '\"]');
await contentServicesPage.unSelectItemWithCheckbox(docxFileModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected(displayColumnName, docxFileModel.name );
await contentServicesPage.clickSelectAllCheckbox();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, docxFileModel.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected(displayColumnName, folderModel.name);
await expect(JSON.stringify(await contentServicesPage.getItemSelected())).toEqual('[\"' + folderModel.name + '","' + docxFileModel.name + '\"]');
});
});

View File

@ -99,7 +99,7 @@ describe('Viewer - properties', () => {
}); });
it('[C260079] Should Show/Hide download button when allowDownload is true/false', async () => { it('[C260079] Should Show/Hide download button when allowDownload is true/false', async () => {
await viewerPage.checkDownloadButtonDisplayed(); await viewerPage.checkDownloadButtonIsDisplayed();
await viewerPage.disableDownload(); await viewerPage.disableDownload();
await viewerPage.checkDownloadButtonIsNotDisplayed(); await viewerPage.checkDownloadButtonIsNotDisplayed();
await viewerPage.enableDownload(); await viewerPage.enableDownload();

View File

@ -16,7 +16,7 @@
*/ */
import { BrowserActions, BrowserVisibility, DateUtil, DocumentListPage, FormControllersPage } from '@alfresco/adf-testing'; import { BrowserActions, BrowserVisibility, DateUtil, DocumentListPage, FormControllersPage } from '@alfresco/adf-testing';
import { $$, browser, by, element, ElementFinder, protractor } from 'protractor'; import { $$, browser, by, element, ElementArrayFinder, ElementFinder, protractor } from 'protractor';
import { DropActions } from '../../actions/drop.actions'; import { DropActions } from '../../actions/drop.actions';
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page'; import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
import { FolderDialogPage } from './dialog/folder-dialog.page'; import { FolderDialogPage } from './dialog/folder-dialog.page';
@ -86,7 +86,9 @@ export class ContentServicesPage {
markedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star')); markedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star'));
notMarkedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border')); notMarkedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border'));
multiSelectToggle: ElementFinder = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) ')); multiSelectToggle: ElementFinder = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) '));
selectAllCheckbox: ElementFinder = element(by.css('.adf-checkbox-sr-only'));
selectionModeDropdown: ElementFinder = element(by.css('.mat-select[aria-label="Selection Mode"]')); selectionModeDropdown: ElementFinder = element(by.css('.mat-select[aria-label="Selection Mode"]'));
selectedNodesList: ElementArrayFinder = element.all(by.css('.app-content-service-settings li'));
siteListDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='site-my-files-option']`))); siteListDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='site-my-files-option']`)));
sortingDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="grid-view-sorting"]'))); sortingDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="grid-view-sorting"]')));
@ -373,9 +375,9 @@ export class ContentServicesPage {
await this.createLibraryDialog.waitForDialogToOpen(); await this.createLibraryDialog.waitForDialogToOpen();
} }
async createNewFolder(folder: string): Promise<void> { async createNewFolder(folderName: string): Promise<void> {
await this.clickOnCreateNewFolder(); await this.clickOnCreateNewFolder();
await this.createFolderDialog.addFolderName(folder); await this.createFolderDialog.addFolderName(folderName);
await this.createFolderDialog.clickOnCreateUpdateButton(); await this.createFolderDialog.clickOnCreateUpdateButton();
} }
@ -436,9 +438,9 @@ export class ContentServicesPage {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton); await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
} }
async uploadFolder(folder): Promise<void> { async uploadFolder(folderName: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton); await BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
await this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folder))); await this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folderName)));
await BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton); await BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
} }
@ -519,14 +521,14 @@ export class ContentServicesPage {
await BrowserVisibility.waitUntilElementIsVisible(this.dragAndDrop); await BrowserVisibility.waitUntilElementIsVisible(this.dragAndDrop);
} }
async dragAndDropFile(file): Promise<void> { async dragAndDropFile(file: string): Promise<void> {
await this.checkDragAndDropDIsDisplayed(); await this.checkDragAndDropDIsDisplayed();
await this.dragAndDropAction.dropFile(this.dragAndDrop, file); await this.dragAndDropAction.dropFile(this.dragAndDrop, file);
} }
async dragAndDropFolder(folder): Promise<void> { async dragAndDropFolder(folderName: string): Promise<void> {
await this.checkDragAndDropDIsDisplayed(); await this.checkDragAndDropDIsDisplayed();
await this.dragAndDropAction.dropFolder(this.dragAndDrop, folder); await this.dragAndDropAction.dropFolder(this.dragAndDrop, folderName);
} }
async checkLockIsDisplayedForElement(name): Promise<void> { async checkLockIsDisplayedForElement(name): Promise<void> {
@ -642,6 +644,12 @@ export class ContentServicesPage {
await BrowserActions.closeMenuAndDialogs(); await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.multiSelectToggle); await BrowserActions.click(this.multiSelectToggle);
} }
async multiSelectToggleIsEnabled(): Promise<boolean> {
return this.multiSelectToggle.isEnabled();
}
async clickSelectAllCheckbox(): Promise<void> {
await BrowserActions.click(this.selectAllCheckbox);
}
getRowByName(rowName): ElementFinder { getRowByName(rowName): ElementFinder {
return this.contentList.dataTable.getRow(this.columns.name, rowName); return this.contentList.dataTable.getRow(this.columns.name, rowName);
@ -661,7 +669,23 @@ export class ContentServicesPage {
async chooseSelectionMode(option: string): Promise<void> { async chooseSelectionMode(option: string): Promise<void> {
const dropdownPage = new DropdownPage(this.selectionModeDropdown); const dropdownPage = new DropdownPage(this.selectionModeDropdown);
await dropdownPage.clickDropdown(); await dropdownPage.selectDropdownOption(option);
await dropdownPage.selectOption(option);
} }
async getItemSelected(): Promise<string> {
return BrowserActions.getArrayText(this.selectedNodesList);
}
async selectItemWithCheckbox(itemName: string): Promise<void> {
const item: ElementFinder = element(by.css(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`));
await BrowserVisibility.waitUntilElementIsVisible(item);
await BrowserActions.click(item);
}
async unSelectItemWithCheckbox(itemName: string): Promise<void> {
const item: ElementFinder = element(by.css(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`));
await BrowserVisibility.waitUntilElementIsVisible(item);
await BrowserActions.click(item);
}
} }

View File

@ -19,8 +19,6 @@ import { by, element, ElementFinder, protractor } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class ProcessDetailsPage { export class ProcessDetailsPage {
// Process Details
processTitle: ElementFinder = element(by.css('mat-card-title[class="mat-card-title"]')); processTitle: ElementFinder = element(by.css('mat-card-title[class="mat-card-title"]'));
processDetailsMessage: ElementFinder = element(by.css('adf-process-instance-details div[class="ng-star-inserted"]')); processDetailsMessage: ElementFinder = element(by.css('adf-process-instance-details div[class="ng-star-inserted"]'));
processStatusField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-status"]')); processStatusField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-status"]'));
@ -33,18 +31,13 @@ export class ProcessDetailsPage {
processDescription: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-description"]')); processDescription: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-description"]'));
showDiagramButtonDisabled: ElementFinder = element(by.css('button[id="show-diagram-button"][disabled]')); showDiagramButtonDisabled: ElementFinder = element(by.css('button[id="show-diagram-button"][disabled]'));
propertiesList: ElementFinder = element(by.css('div[class="adf-property-list"]')); propertiesList: ElementFinder = element(by.css('div[class="adf-property-list"]'));
// Show Diagram
showDiagramButton: ElementFinder = element(by.id('show-diagram-button')); showDiagramButton: ElementFinder = element(by.id('show-diagram-button'));
diagramCanvas: ElementFinder = element(by.css('svg[xmlns="http://www.w3.org/2000/svg"]')); diagramCanvas: ElementFinder = element(by.css('svg[xmlns="http://www.w3.org/2000/svg"]'));
backButton: ElementFinder = element(by.css('app-show-diagram button[class="mat-mini-fab mat-accent"]')); backButton: ElementFinder = element(by.css('app-show-diagram button[class="mat-mini-fab mat-accent"]'));
// Comments
commentInput: ElementFinder = element(by.id('comment-input')); commentInput: ElementFinder = element(by.id('comment-input'));
// Audit Log
auditLogButton: ElementFinder = element(by.css('button[adf-process-audit]')); auditLogButton: ElementFinder = element(by.css('button[adf-process-audit]'));
auditLogEmptyListMessage: ElementFinder = element(by.css('.app-empty-list-header')); auditLogEmptyListMessage: ElementFinder = element(by.css('.app-empty-list-header'));
// Cancel Process button
cancelProcessButton: ElementFinder = element(by.css('div[data-automation-id="header-status"] > button')); cancelProcessButton: ElementFinder = element(by.css('div[data-automation-id="header-status"] > button'));
// Tasks
activeTask: ElementFinder = element(by.css('div[data-automation-id="active-tasks"]')); activeTask: ElementFinder = element(by.css('div[data-automation-id="active-tasks"]'));
startForm: ElementFinder = element(by.css('div[data-automation-id="start-form"]')); startForm: ElementFinder = element(by.css('div[data-automation-id="start-form"]'));
completedTask: ElementFinder = element(by.css('div[data-automation-id="completed-tasks"]')); completedTask: ElementFinder = element(by.css('div[data-automation-id="completed-tasks"]'));

View File

@ -75,36 +75,40 @@ describe('Start Process Component', () => {
describe('Provider: BPM', () => { describe('Provider: BPM', () => {
beforeAll(async () => { beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({ try {
provider: 'BPM', this.alfrescoJsApi = new AlfrescoApi({
hostBpm: browser.params.testConfig.adf_aps.host provider: 'BPM',
}); hostBpm: browser.params.testConfig.adf_aps.host
});
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant());
tenantId = newTenant.id; tenantId = newTenant.id;
procUserModel = new User({ tenantId: tenantId }); procUserModel = new User({tenantId: tenantId});
secondProcUserModel = new User({ tenantId: tenantId }); secondProcUserModel = new User({tenantId: tenantId});
await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(procUserModel); await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(procUserModel);
await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(secondProcUserModel); await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(secondProcUserModel);
this.alfrescoJsApiUserTwo = new AlfrescoApi({ this.alfrescoJsApiUserTwo = new AlfrescoApi({
provider: 'BPM', provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host hostBpm: browser.params.testConfig.adf_aps.host
}); });
await this.alfrescoJsApiUserTwo.login(secondProcUserModel.email, secondProcUserModel.password); await this.alfrescoJsApiUserTwo.login(secondProcUserModel.email, secondProcUserModel.password);
const appCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, app.file_location); const appCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, app.file_location);
simpleAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, simpleApp.file_location); simpleAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, simpleApp.file_location);
dateFormAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, dateFormApp.file_location); dateFormAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, dateFormApp.file_location);
appId = appCreated.id; appId = appCreated.id;
} catch (error) {
throw new Error(`API call failed in beforeAll: ${error}`);
}
}); });
afterAll(async () => { afterAll(async () => {
@ -535,8 +539,7 @@ describe('Start Process Component', () => {
await contentServicesPage.checkContextActionIsVisible('Start Process'); await contentServicesPage.checkContextActionIsVisible('Start Process');
await contentServicesPage.pressContextMenuActionNamed('Start Process'); await contentServicesPage.pressContextMenuActionNamed('Start Process');
await selectAppsDialog.checkSelectAppsDialogIsDisplayed(); await selectAppsDialog.checkSelectAppsDialogIsDisplayed();
await selectAppsDialog.clickDropdownAppsButton(); await selectAppsDialog.selectApp('start process app');
await selectAppsDialog.clickAppsOption();
await selectAppsDialog.clickContinueButton(); await selectAppsDialog.clickContinueButton();
await startProcessPage.enterProcessName('Test Process'); await startProcessPage.enterProcessName('Test Process');
@ -550,7 +553,6 @@ describe('Start Process Component', () => {
await processFiltersPage.clickCompletedFilterButton(); await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Test Process'); await processFiltersPage.selectFromProcessList('Test Process');
await expect(await processDetailsPage.getEmptyMessage()).toBe('This list is empty'); await expect(await processDetailsPage.getEmptyMessage()).toBe('This list is empty');
}); });
}); });

View File

@ -499,10 +499,6 @@ export class ViewerPage {
await this.formControllersPage.enableToggle(this.showTabWithIconAndLabelSwitch); await this.formControllersPage.enableToggle(this.showTabWithIconAndLabelSwitch);
} }
async checkDownloadButtonDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.downloadButton);
}
async checkDownloadButtonIsNotDisplayed(): Promise<void> { async checkDownloadButtonIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.downloadButton); await BrowserVisibility.waitUntilElementIsNotVisible(this.downloadButton);
} }
@ -544,6 +540,16 @@ export class ViewerPage {
await BrowserVisibility.waitUntilElementIsNotVisible(this.uploadButton); await BrowserVisibility.waitUntilElementIsNotVisible(this.uploadButton);
} }
async checkPreviewFileDefaultOptionsAreDisplayed(): Promise<void> {
await this.checkToolbarIsDisplayed();
await this.checkMoreActionsDisplayed();
await this.checkPrintButtonIsDisplayed();
await this.checkDownloadButtonIsDisplayed();
await this.checkFullScreenButtonIsDisplayed();
await this.checkLeftSideBarButtonIsDisplayed();
await this.checkInfoButtonIsDisplayed();
}
async disableMoreActions(): Promise<void> { async disableMoreActions(): Promise<void> {
await this.formControllersPage.disableToggle(this.moreActionsSwitch); await this.formControllersPage.disableToggle(this.moreActionsSwitch);
} }

View File

@ -18,35 +18,34 @@
import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { by, element, ElementFinder } from 'protractor'; import { by, element, ElementFinder } from 'protractor';
import { BrowserActions } from '../../core/utils/browser-actions'; import { BrowserActions } from '../../core/utils/browser-actions';
import { DropdownPage } from '../../material/pages/dropdown.page';
export class SelectAppsDialog { export class SelectAppsDialog {
selectAppsDialog: ElementFinder = element(by.css('mat-dialog-container[aria-labelledby="adf-select-app-dialog-title"]')); selectAppsDialog: ElementFinder = element(by.css('mat-dialog-container[aria-labelledby="adf-select-app-dialog-title"]'));
title: ElementFinder = element(by.id('adf-select-app-dialog-title')); title: ElementFinder = element(by.id('adf-select-app-dialog-title'));
dropdownAppsButton: ElementFinder = element(by.id('adf-select-app-dialog-dropdown')); appsDropdown = new DropdownPage(element(by.id('adf-select-app-dialog-dropdown')));
appsOption: ElementFinder = element(by.css('.mat-option span'));
continueButton: ElementFinder = element(by.css('adf-select-apps-dialog .mat-button-wrapper')); continueButton: ElementFinder = element(by.css('adf-select-apps-dialog .mat-button-wrapper'));
async checkSelectAppsDialogIsDisplayed(): Promise<void> { async checkSelectAppsDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.selectAppsDialog); await BrowserVisibility.waitUntilElementIsVisible(this.selectAppsDialog);
} }
async selectApp(appName: string): Promise<void> {
await this.appsDropdown.selectDropdownOption(appName);
}
async getTitle(): Promise<string> { async getTitle(): Promise<string> {
return BrowserActions.getText(this.title); return BrowserActions.getText(this.title);
} }
async clickDropdownAppsButton(): Promise<void> { async clickAppsDropdown(): Promise<void> {
await BrowserActions.click(this.dropdownAppsButton); await this.appsDropdown.clickDropdown();
} }
async clickContinueButton(): Promise<void> { async clickContinueButton(): Promise<void> {
await BrowserActions.click(this.continueButton); await BrowserActions.click(this.continueButton);
} }
async clickAppsOption(): Promise<void> {
await BrowserActions.click(this.appsOption);
}
async checkSelectAppsDialogIsNotDisplayed(): Promise<void> { async checkSelectAppsDialogIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectAppsDialog); await BrowserVisibility.waitUntilElementIsNotVisible(this.selectAppsDialog);
} }