[AAE-1797] added e2e automated tests (#5509)

* added e2e automation - [C260064] Should download only the last selection when changing pages in Single mode

* [AAE-1797] added e2e automated test- start a process within ACS

* refactoring with dropdownPage

* spellcheck refactoring
This commit is contained in:
Alexandra Abrudan 2020-02-28 15:06:24 +00:00 committed by GitHub
parent 6bf8c17771
commit e5efe74e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 713 additions and 444 deletions

View File

@ -264,7 +264,6 @@ 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];
});
beforeEach(async () => {
@ -274,7 +273,6 @@ describe('Document List Component - Actions', () => {
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
});
afterAll(async () => {
@ -282,7 +280,6 @@ describe('Document List Component - Actions', () => {
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
it('[C260132] Move action on folder with - Load more', async () => {
@ -379,7 +376,6 @@ describe('Document List Component - Actions', () => {
await contentServicesPage.getDocumentList().waitForTableBody();
await contentServicesPage.doubleClickRow('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
});
});

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginPage, UploadActions, PaginationPage } from '@alfresco/adf-testing';
import { LoginPage, UploadActions, PaginationPage, LocalStorageUtil, FileBrowserUtil } 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';
@ -23,6 +23,8 @@ import { FolderModel } from '../../models/ACS/folder.model';
import { Util } from '../../util/util';
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 - Pagination', () => {
const pagination = {
@ -40,6 +42,8 @@ describe('Document List - Pagination', () => {
fifteenValue: 15,
twenty: '20',
twentyValue: 20,
twentyOne: '21',
twentyOneValue: 21,
default: '25'
};
@ -47,41 +51,47 @@ describe('Document List - Pagination', () => {
const contentServicesPage = new ContentServicesPage();
const paginationPage = new PaginationPage();
const navigationBarPage = new NavigationBarPage();
const uploadDialog = new UploadDialogPage();
const acsUser = new AcsUserModel();
const newFolderModel = new FolderModel({ name: 'newFolder' });
let fileNames = [];
const nrOfFiles = 20;
const numberOfFilesAfterUpload = 21;
let currentPage = 1;
let secondSetOfFiles = [];
const secondSetNumber = 25;
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
const folderThreeModel = new FolderModel({ name: 'folderThree' });
const numberOfSubFolders = 6;
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const docxFileModel = new FileModel({
'name': browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
beforeAll(async () => {
fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension);
secondSetOfFiles = Util.generateSequenceFiles(10, secondSetNumber + 9, pagination.secondSetBase, pagination.extension);
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);
const folderThreeUploadedModel = await uploadActions.createFolder(folderThreeModel.name, '-my-');
const newFolderUploadedModel = await uploadActions.createFolder(newFolderModel.name, '-my-');
await uploadActions.createEmptyFiles(fileNames, newFolderUploadedModel.entry.id);
await uploadActions.createEmptyFiles(secondSetOfFiles, folderThreeUploadedModel.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
@ -89,14 +99,11 @@ describe('Document List - Pagination', () => {
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
});
await contentServicesPage.checkDocumentListElementsAreDisplayed();
});
it('[C260062] Should use default pagination settings', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(newFolderModel.name);
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);
@ -107,12 +114,10 @@ describe('Document List - Pagination', () => {
});
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 contentServicesPage.openFolder(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -124,20 +129,17 @@ describe('Document List - Pagination', () => {
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -145,8 +147,7 @@ describe('Document List - Pagination', () => {
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -154,8 +155,7 @@ describe('Document List - Pagination', () => {
await expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -163,8 +163,7 @@ describe('Document List - Pagination', () => {
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -172,8 +171,7 @@ describe('Document List - Pagination', () => {
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
await browser.refresh();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
@ -181,12 +179,10 @@ describe('Document List - Pagination', () => {
it('[C260067] Should be able to set Items per page to 10', async () => {
currentPage = 1;
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -194,8 +190,7 @@ describe('Document List - Pagination', () => {
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -212,13 +207,11 @@ describe('Document List - Pagination', () => {
it('[C260065] Should be able to set Items per page to 15', async () => {
currentPage = 1;
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -226,8 +219,8 @@ describe('Document List - Pagination', () => {
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
currentPage++;
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -240,13 +233,10 @@ describe('Document List - Pagination', () => {
});
it('[C91320] Pagination should preserve sorting', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
@ -254,46 +244,37 @@ describe('Document List - Pagination', () => {
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
});
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 contentServicesPage.openFolder(newFolderModel.name);
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.createAndOpenNewFolder(folderTwoModel.name);
await contentServicesPage.checkPaginationIsNotDisplayed();
await contentServicesPage.deleteSubFolderUnderRoot(newFolderModel.name, folderTwoModel.name);
});
it('[C260071] Should be able to change pagination when having 25 files', async () => {
currentPage = 1;
await contentServicesPage.doubleClickRow(folderThreeModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(folderThreeModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -302,8 +283,7 @@ describe('Document List - Pagination', () => {
currentPage++;
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -312,8 +292,7 @@ describe('Document List - Pagination', () => {
currentPage = 1;
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
@ -322,12 +301,91 @@ describe('Document List - Pagination', () => {
currentPage++;
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
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);
});
it('[C216321] Should be able to modify the supported page size value', async () => {
await paginationPage.clickItemsPerPageDropdown();
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']);
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 21]));
await contentServicesPage.goToDocumentList();
await browser.refresh();
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await paginationPage.clickItemsPerPageDropdown();
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual([ '5', '10', '15', '21' ]);
await paginationPage.clickItemsPerPageDropdown();
await paginationPage.selectItemsPerPage(itemsPerPage.twentyOne);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twentyOne);
await browser.refresh();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyOneValue + ' of ' + numberOfFilesAfterUpload);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyOneValue);
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20]));
await browser.refresh();
await paginationPage.clickItemsPerPageDropdown();
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']);
});
it('[C272767] Should propagate the option chosen regarding displaying items per page to files/folders inside a folder', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
for (let i = 0; i < numberOfSubFolders; i++) {
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
}
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders);
await paginationPage.clickOnNextPage();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + numberOfSubFolders + ' of ' + numberOfSubFolders);
await contentServicesPage.openFolder('subfolder6');
for (let i = 0; i < numberOfSubFolders; i++) {
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
}
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders);
await expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
await expect(await paginationPage.getTotalPages()).toEqual('of 2');
await contentServicesPage.deleteSubFolderUnderRoot(newFolderModel.name, folderTwoModel.name);
});
it('[C260064] Should download only the last selection when changing pages in Single mode', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.openFolder(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
for (let i = 0; i < numberOfSubFolders; i++) {
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
}
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + numberOfSubFolders);
await contentServicesPage.chooseSelectionMode('Single');
await contentServicesPage.selectFolder('subfolder1');
await paginationPage.clickOnNextPage();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + numberOfSubFolders + ' of ' + numberOfSubFolders);
await contentServicesPage.selectFolderWithCommandKey('subfolder6');
await contentServicesPage.clickDownloadButton();
await expect(await FileBrowserUtil.isFileDownloaded('subfolder6.zip')
).toBe(true, `subfolder6 not downloaded`);
await contentServicesPage.deleteSubFolderUnderRoot(newFolderModel.name, folderTwoModel.name);
});
});

View File

@ -74,7 +74,7 @@ describe('Enable infinite scrolling', () => {
deleteUploaded = await uploadActions.createFolder('deleteFolder', '-my-');
await uploadActions.createEmptyFiles(deleteFileNames, deleteUploaded.entry.id);
});
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
@ -83,7 +83,7 @@ describe('Enable infinite scrolling', () => {
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
});
});
it('[C260484] Should be possible to enable infinite scrolling', async () => {
await contentServicesPage.doubleClickRow(folderModel.name);
@ -95,9 +95,7 @@ describe('Enable infinite scrolling', () => {
});
it('[C268165] Delete folder when infinite scrolling is enabled', async () => {
await contentServicesPage.doubleClickRow(deleteUploaded.entry.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(deleteUploaded.entry.name);
await contentServicesPage.enableInfiniteScrolling();
await infinitePaginationPage.clickLoadMoreButton();
for (let i = 0; i < nrOfDeletedFiles; i++) {

View File

@ -90,17 +90,13 @@ describe('Pagination - returns to previous page when current is empty', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
});
});
it('[C274710] Should redirect to previous page when current is emptied', async () => {
await contentServicesPage.doubleClickRow(folderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(folderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
@ -110,8 +106,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
@ -126,26 +121,20 @@ describe('Pagination - returns to previous page when current is empty', () => {
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
});
});
it('[C297494] Should display content when navigating to a non-empty folder not in the first page', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.doubleClickRow(parentFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.openFolder(parentFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await contentServicesPage.doubleClickRow(lastFolderResponse.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFileInfo.name);

View File

@ -86,6 +86,7 @@ export class ContentServicesPage {
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'));
multiSelectToggle: ElementFinder = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) '));
selectionModeDropdown: ElementFinder = element(by.css('.mat-select[aria-label="Selection Mode"]'));
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"]')));
@ -258,6 +259,11 @@ export class ContentServicesPage {
return BrowserActions.getText(this.recentFileIcon);
}
async checkDocumentListElementsAreDisplayed(): Promise<void> {
await this.checkAcsContainer();
await this.waitForTableBody();
}
async checkAcsContainer(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder);
}
@ -334,6 +340,10 @@ export class ContentServicesPage {
await this.contentList.doubleClickRow(nodeName);
}
async selectRow(nodeName): Promise<void> {
await this.contentList.selectRow(nodeName);
}
async clickOnCreateNewFolder(): Promise<void> {
await BrowserActions.click(this.createFolderButton);
}
@ -363,12 +373,23 @@ export class ContentServicesPage {
await this.createLibraryDialog.waitForDialogToOpen();
}
async createNewFolder(folder): Promise<void> {
async createNewFolder(folder: string): Promise<void> {
await this.clickOnCreateNewFolder();
await this.createFolderDialog.addFolderName(folder);
await this.createFolderDialog.clickOnCreateUpdateButton();
}
async createAndOpenNewFolder(folderName: string): Promise<void> {
await this.createNewFolder(folderName);
await this.checkContentIsDisplayed(folderName);
await this.openFolder(folderName);
}
async openFolder(folderName: string): Promise<void> {
await this.doubleClickRow(folderName);
await this.checkDocumentListElementsAreDisplayed();
}
async checkContentIsDisplayed(content): Promise<void> {
await this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content);
}
@ -383,6 +404,17 @@ export class ContentServicesPage {
await this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content);
}
async deleteAndCheckFolderNotDisplayed(folderName: string): Promise<void> {
await this.deleteContent(folderName);
await this.checkContentIsNotDisplayed(folderName);
}
async deleteSubFolderUnderRoot(folderName: string, subFolderName: string): Promise<void> {
await this.goToDocumentList();
await this.openFolder(folderName);
await this.deleteAndCheckFolderNotDisplayed(subFolderName);
}
async getActiveBreadcrumb(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.activeBreadcrumb);
return this.activeBreadcrumb.getAttribute('title');
@ -615,4 +647,21 @@ export class ContentServicesPage {
return this.contentList.dataTable.getRow(this.columns.name, rowName);
}
async selectFolder(folderName: string): Promise<void> {
const folderSelected: ElementFinder = element(by.css(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`));
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
await BrowserActions.click(folderSelected);
}
async selectFolderWithCommandKey(folderName: string): Promise<void> {
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
await this.selectRow(folderName);
await browser.actions().sendKeys(protractor.Key.NULL).perform();
}
async chooseSelectionMode(option: string): Promise<void> {
const dropdownPage = new DropdownPage(this.selectionModeDropdown);
await dropdownPage.clickDropdown();
await dropdownPage.selectOption(option);
}
}

View File

@ -41,6 +41,7 @@ export class ProcessDetailsPage {
commentInput: ElementFinder = element(by.id('comment-input'));
// Audit Log
auditLogButton: ElementFinder = element(by.css('button[adf-process-audit]'));
auditLogEmptyListMessage: ElementFinder = element(by.css('.app-empty-list-header'));
// Cancel Process button
cancelProcessButton: ElementFinder = element(by.css('div[data-automation-id="header-status"] > button'));
// Tasks
@ -131,6 +132,10 @@ export class ProcessDetailsPage {
await BrowserActions.click(this.auditLogButton);
}
getEmptyMessage(): Promise<string> {
return BrowserActions.getText(this.auditLogEmptyListMessage);
}
async clickCancelProcessButton(): Promise<void> {
await BrowserActions.click(this.cancelProcessButton);
}

View File

@ -16,7 +16,13 @@
*/
import CONSTANTS = require('../util/constants');
import { FileBrowserUtil, LoginPage, StartProcessDialog, StringUtil, Widget } from '@alfresco/adf-testing';
import {
FileBrowserUtil,
LoginPage, SelectAppsDialog,
StartProcessDialog,
StringUtil,
Widget
} from '@alfresco/adf-testing';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { browser } from 'protractor';
import { AppsActions } from '../actions/APS/apps.actions';
@ -30,9 +36,12 @@ import { ProcessFiltersPage } from '../pages/adf/process-services/process-filter
import { ProcessServicesPage } from '../pages/adf/process-services/process-services.page';
import { ProcessServiceTabBarPage } from '../pages/adf/process-services/process-service-tab-bar.page';
import { StartProcessPage } from '../pages/adf/process-services/start-process.page';
import { ContentServicesPage } from '../pages/adf/content-services.page';
import { UsersActions } from '../actions/users.actions';
import { AcsUserModel } from '../models/ACS/acs-user.model';
import { UploadDialogPage } from '../pages/adf/dialog/upload-dialog.page';
describe('Start Process Component', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const processServicesPage = new ProcessServicesPage();
@ -42,11 +51,14 @@ describe('Start Process Component', () => {
const processDetailsPage = new ProcessDetailsPage();
const attachmentListPage = new AttachmentListPage();
const startProcessDialog = new StartProcessDialog();
const contentServicesPage = new ContentServicesPage();
const selectAppsDialog = new SelectAppsDialog();
const apps = new AppsActions();
const widget = new Widget();
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
const simpleApp = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
const dateFormApp = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
const startProcessAttachFileApp = browser.params.resources.Files.START_PROCESS_ATTACH_FILE;
let appId, procUserModel, secondProcUserModel, tenantId, simpleAppCreated, dateFormAppCreated;
const processModelWithSe = 'process_with_se', processModelWithoutSe = 'process_without_se';
const processName255Characters = StringUtil.generateRandomString(255);
@ -60,402 +72,486 @@ describe('Start Process Component', () => {
'name': browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_name
});
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
});
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant());
tenantId = newTenant.id;
procUserModel = new User({ tenantId: tenantId });
secondProcUserModel = new User({ tenantId: tenantId });
await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(procUserModel);
await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(secondProcUserModel);
this.alfrescoJsApiUserTwo = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
});
await this.alfrescoJsApiUserTwo.login(secondProcUserModel.email, secondProcUserModel.password);
const appCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, app.file_location);
simpleAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, simpleApp.file_location);
dateFormAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, dateFormApp.file_location);
appId = appCreated.id;
});
afterAll(async () => {
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(simpleAppCreated.id);
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(dateFormAppCreated.id);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
});
describe(' Once logged with user without apps', () => {
beforeEach(async () => {
await loginPage.loginToProcessServicesUsingUserModel(procUserModel);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
});
it('[C260458] Should NOT be able to start a process without process model', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.checkNoProcessMessage();
});
});
describe(' Once logged with user with app', () => {
describe('Provider: BPM', () => {
beforeAll(async () => {
await loginPage.loginToProcessServicesUsingUserModel(secondProcUserModel);
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
});
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant());
tenantId = newTenant.id;
procUserModel = new User({ tenantId: tenantId });
secondProcUserModel = new User({ tenantId: tenantId });
await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(procUserModel);
await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(secondProcUserModel);
this.alfrescoJsApiUserTwo = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
});
await this.alfrescoJsApiUserTwo.login(secondProcUserModel.email, secondProcUserModel.password);
const appCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, app.file_location);
simpleAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, simpleApp.file_location);
dateFormAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, dateFormApp.file_location);
appId = appCreated.id;
});
beforeEach(async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
afterAll(async () => {
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(simpleAppCreated.id);
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(dateFormAppCreated.id);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
});
it('[C260441] Should display start process form and default name when creating a new process', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
describe(' Once logged with user without apps', () => {
beforeEach(async () => {
await loginPage.loginToProcessServicesUsingUserModel(procUserModel);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
});
it('[C260458] Should NOT be able to start a process without process model', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.checkNoProcessMessage();
});
});
it('[C260445] Should require process definition and be possible to click cancel button', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('');
await browser.actions().sendKeys('v\b\b').perform(); // clear doesn't trigger the validator
await startProcessPage.checkStartProcessButtonIsDisabled();
await startProcessPage.clickCancelProcessButton();
await processFiltersPage.checkNoContentMessage();
});
describe(' Once logged with user with app', () => {
it('[C260444] Should require process name', async () => {
await processServicesPage.goToApp(app.title);
beforeAll(async () => {
await loginPage.loginToProcessServicesUsingUserModel(secondProcUserModel);
});
await processServiceTabBarPage.clickProcessButton();
beforeEach(async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
});
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
it('[C260441] Should display start process form and default name when creating a new process', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
});
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
await startProcessPage.deleteDefaultName();
it('[C260445] Should require process definition and be possible to click cancel button', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('');
await browser.actions().sendKeys('v\b\b').perform(); // clear doesn't trigger the validator
await startProcessPage.checkStartProcessButtonIsDisabled();
await startProcessPage.clickCancelProcessButton();
await processFiltersPage.checkNoContentMessage();
});
await browser.sleep(1000);
it('[C260444] Should require process name', async () => {
await processServicesPage.goToApp(app.title);
await startProcessPage.checkStartProcessButtonIsDisabled();
await startProcessPage.clickProcessDropdownArrow();
await startProcessPage.checkOptionIsDisplayed(processModelWithSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
});
await processServiceTabBarPage.clickProcessButton();
it('[C260443] Should be possible to start a process without start event', async () => {
await processServicesPage.goToApp(app.title);
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await processServiceTabBarPage.clickProcessButton();
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
await startProcessPage.deleteDefaultName();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await browser.sleep(1000);
await expect(await startProcessPage.checkSelectProcessPlaceholderIsDisplayed()).toBe('');
await startProcessPage.checkStartProcessButtonIsDisabled();
await startProcessPage.clickProcessDropdownArrow();
await startProcessPage.checkOptionIsDisplayed(processModelWithSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
});
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
it('[C260443] Should be possible to start a process without start event', async () => {
await processServicesPage.goToApp(app.title);
await expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
await processServiceTabBarPage.clickProcessButton();
await startProcessPage.checkStartProcessButtonIsEnabled();
});
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
it('[C260449] Should be possible to start a process with start event', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Test');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processDetailsPage.checkDetailsAreDisplayed();
const processId = await processDetailsPage.getId();
const response = await this.alfrescoJsApi.activiti.processApi.getProcessInstance(processId);
await expect(await startProcessPage.checkSelectProcessPlaceholderIsDisplayed()).toBe('');
await expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
await expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
await expect(await processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESS_CATEGORY);
await expect(await processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_BUSINESS_KEY);
await expect(await processDetailsPage.getCreatedBy()).toEqual(`${response.startedBy.firstName} ${response.startedBy.lastName}`);
await expect(await processDetailsPage.getId()).toEqual(response.id);
await expect(await processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESS_DESCRIPTION);
await expect(await processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(response.name);
});
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
it('[C286503] Should NOT display any process definition when typing a non-existent one', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('nonexistent');
await startProcessPage.checkNoProcessDefinitionOptionIsDisplayed();
await startProcessPage.checkStartProcessButtonIsDisabled();
});
await expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
it('[C286504] Should display proper options when typing a part of existent process definitions', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
await startProcessPage.checkStartProcessButtonIsEnabled();
});
it('[C286508] Should display only one option when typing an existent process definition', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition(processModelWithoutSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkOptionIsNotDisplayed(processModelWithSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
it('[C260449] Should be possible to start a process with start event', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Test');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processDetailsPage.checkDetailsAreDisplayed();
const processId = await processDetailsPage.getId();
const response = await this.alfrescoJsApi.activiti.processApi.getProcessInstance(processId);
it('[C286509] Should select automatically the processDefinition when the app contains only one', async () => {
await processServicesPage.goToApp(simpleApp.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(simpleApp.title);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
await expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
await expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
await expect(await processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESS_CATEGORY);
await expect(await processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_BUSINESS_KEY);
await expect(await processDetailsPage.getCreatedBy()).toEqual(`${response.startedBy.firstName} ${response.startedBy.lastName}`);
await expect(await processDetailsPage.getId()).toEqual(response.id);
await expect(await processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESS_DESCRIPTION);
await expect(await processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(response.name);
});
it('[C286511] Should be able to type the process definition and start a process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Type');
await startProcessPage.typeProcessDefinition(processModelWithoutSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.clickStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Type');
});
it('[C286503] Should NOT display any process definition when typing a non-existent one', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('nonexistent');
await startProcessPage.checkNoProcessDefinitionOptionIsDisplayed();
await startProcessPage.checkStartProcessButtonIsDisabled();
});
it('[C286513] Should be able to use down arrow key when navigating throw suggestions', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
it('[C286504] Should display proper options when typing a part of existent process definitions', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
await startProcessPage.pressDownArrowAndEnter();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
});
it('[C286508] Should display only one option when typing an existent process definition', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition(processModelWithoutSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkOptionIsNotDisplayed(processModelWithSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
it('[C286514] Should the process definition input be cleared when clicking on options drop down ', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.selectOption(processModelWithoutSe);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.clickProcessDropdownArrow();
it('[C286509] Should select automatically the processDefinition when the app contains only one', async () => {
await processServicesPage.goToApp(simpleApp.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(simpleApp.title);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
await expect(await startProcessPage.getProcessDefinitionValue()).toBe('');
});
it('[C286511] Should be able to type the process definition and start a process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Type');
await startProcessPage.typeProcessDefinition(processModelWithoutSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.clickStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Type');
});
it('[C260453] Should be possible to add a comment on an active process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Comment Process');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process');
await processDetailsPage.addComment('comment1');
await processDetailsPage.checkCommentIsDisplayed('comment1');
});
it('[C286513] Should be able to use down arrow key when navigating throw suggestions', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
it('[C260454] Should be possible to download audit log file', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Audit Log');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Audit Log');
await processDetailsPage.clickAuditLogButton();
await startProcessPage.pressDownArrowAndEnter();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
});
await expect(await FileBrowserUtil.isFileDownloaded(auditLogFile)).toBe(true);
});
it('[C286514] Should the process definition input be cleared when clicking on options drop down ', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.selectOption(processModelWithoutSe);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.clickProcessDropdownArrow();
it('Should be able to attach a file using the button', async () => {
await processServicesPage.goToApp(app.title);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe('');
});
await processServiceTabBarPage.clickProcessButton();
it('[C260453] Should be possible to add a comment on an active process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Comment Process');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process');
await processDetailsPage.addComment('comment1');
await processDetailsPage.checkCommentIsDisplayed('comment1');
});
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
it('[C260454] Should be possible to download audit log file', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Audit Log');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Audit Log');
await processDetailsPage.clickAuditLogButton();
await startProcessPage.enterProcessName('Attach File');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await expect(await FileBrowserUtil.isFileDownloaded(auditLogFile)).toBe(true);
});
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Attach File');
it('Should be able to attach a file using the button', async () => {
await processServicesPage.goToApp(app.title);
await attachmentListPage.clickAttachFileButton(jpgFile.location);
await attachmentListPage.checkFileIsAttached(jpgFile.name);
});
await processServiceTabBarPage.clickProcessButton();
it('[C260451] Should be possible to display process diagram', async () => {
await processServicesPage.goToApp(app.title);
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await processServiceTabBarPage.clickProcessButton();
await startProcessPage.enterProcessName('Attach File');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Attach File');
await startProcessPage.enterProcessName('Show Diagram');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await attachmentListPage.clickAttachFileButton(jpgFile.location);
await attachmentListPage.checkFileIsAttached(jpgFile.name);
});
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Show Diagram');
it('[C260451] Should be possible to display process diagram', async () => {
await processServicesPage.goToApp(app.title);
await processDetailsPage.clickShowDiagram();
});
await processServiceTabBarPage.clickProcessButton();
it('[C260452] Should redirect user when clicking on active/completed task', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Active Task');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Active Task');
await processDetailsPage.clickOnActiveTask();
await processDetailsPage.checkActiveTaskTitleIsDisplayed();
});
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
it('[C260457] Should display process in Completed when cancelled', async () => {
await loginPage.loginToProcessServicesUsingUserModel(secondProcUserModel);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Cancel Process');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Cancel Process');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Cancel Process');
await processDetailsPage.checkShowDiagramIsDisabled();
});
await startProcessPage.enterProcessName('Show Diagram');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
it('[C260461] Should be possible to add a comment on a completed/canceled process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Comment Process 2');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process 2');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process 2');
await processDetailsPage.addComment('goodbye');
await processDetailsPage.checkCommentIsDisplayed('goodbye');
});
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Show Diagram');
it('[C260467] Should NOT be possible to attach a file on a completed process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('File');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('File');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('File');
await attachmentListPage.checkAttachFileButtonIsNotDisplayed();
});
await processDetailsPage.clickShowDiagram();
});
it('[C291781] Should be displayed an error message if process name exceed 255 characters', async () => {
await processServicesPage.goToApp(app.title);
it('[C260452] Should redirect user when clicking on active/completed task', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Active Task');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Active Task');
await processDetailsPage.clickOnActiveTask();
await processDetailsPage.checkActiveTaskTitleIsDisplayed();
});
await processServiceTabBarPage.clickProcessButton();
it('[C260457] Should display process in Completed when cancelled', async () => {
await loginPage.loginToProcessServicesUsingUserModel(secondProcUserModel);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Cancel Process');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Cancel Process');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Cancel Process');
await processDetailsPage.checkShowDiagramIsDisabled();
});
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
it('[C260461] Should be possible to add a comment on a completed/canceled process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Comment Process 2');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process 2');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process 2');
await processDetailsPage.addComment('goodbye');
await processDetailsPage.checkCommentIsDisplayed('goodbye');
});
await startProcessPage.enterProcessName(processName255Characters);
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
it('[C260467] Should NOT be possible to attach a file on a completed process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('File');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('File');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('File');
await attachmentListPage.checkAttachFileButtonIsNotDisplayed();
});
await startProcessPage.enterProcessName(processNameBiggerThen255Characters);
await startProcessPage.checkValidationErrorIsDisplayed(lengthValidationError);
await startProcessPage.checkStartProcessButtonIsDisabled();
});
it('[C291781] Should be displayed an error message if process name exceed 255 characters', async () => {
await processServicesPage.goToApp(app.title);
it('[C261039] Advanced date time widget', async () => {
await processServicesPage.goToApp(dateFormApp.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('DateFormProcess');
await startProcessPage.formFields().checkWidgetIsVisible('testdate');
await widget.dateWidget().setDateInput('testdate', '15-7-2019');
await startProcessPage.checkStartFormProcessButtonIsEnabled();
await startProcessPage.clickFormStartProcessButton();
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('DateFormProcess');
await processDetailsPage.clickOnStartForm();
await startProcessDialog.checkStartProcessDialogIsDisplayed();
await expect(await startProcessDialog.getTitle()).toBe('Start Form');
await expect(await (await widget.dateWidget()).getDateInput('testdate')).toBe('15-7-2019');
await startProcessDialog.clickCloseButton();
await startProcessDialog.checkStartProcessDialogIsNotDisplayed();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName(processName255Characters);
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
await startProcessPage.enterProcessName(processNameBiggerThen255Characters);
await startProcessPage.checkValidationErrorIsDisplayed(lengthValidationError);
await startProcessPage.checkStartProcessButtonIsDisabled();
});
it('[C261039] Advanced date time widget', async () => {
await processServicesPage.goToApp(dateFormApp.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('DateFormProcess');
await startProcessPage.formFields().checkWidgetIsVisible('testdate');
await widget.dateWidget().setDateInput('testdate', '15-7-2019');
await startProcessPage.checkStartFormProcessButtonIsEnabled();
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('DateFormProcess');
await processDetailsPage.clickOnStartForm();
await startProcessDialog.checkStartProcessDialogIsDisplayed();
await expect(await startProcessDialog.getTitle()).toBe('Start Form');
await expect(await (await widget.dateWidget()).getDateInput('testdate')).toBe('15-7-2019');
await startProcessDialog.clickCloseButton();
await startProcessDialog.checkStartProcessDialogIsNotDisplayed();
});
});
});
describe('Provider: ALL', () => {
const uploadDialog = new UploadDialogPage();
let processUserModel, contentUserModel;
const imageUploaded = new FileModel({
'name': browser.params.resources.Files.PROFILE_IMAGES.ECM.file_name,
'location': browser.params.resources.Files.PROFILE_IMAGES.ECM.file_location
});
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ALL',
hostEcm: browser.params.testConfig.adf_acs.host,
hostBpm: browser.params.testConfig.adf_aps.host
});
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
processUserModel = await users.createTenantAndUser(this.alfrescoJsApi);
contentUserModel = new AcsUserModel({
'id': processUserModel.email,
'password': processUserModel.password,
'firstName': processUserModel.firstName,
'lastName': processUserModel.lastName,
'email': processUserModel.email
});
await this.alfrescoJsApi.core.peopleApi.addPerson(contentUserModel);
this.alfrescoJsBPMAdminUser = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
});
await this.alfrescoJsBPMAdminUser.login(processUserModel.email, processUserModel.password);
const appCreated = await apps.importPublishDeployApp(this.alfrescoJsBPMAdminUser, startProcessAttachFileApp.file_location);
appId = appCreated.id;
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C260490] Should be able to start a Process within ACS', async () => {
await loginPage.loginToAllUsingUserModel(contentUserModel);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await contentServicesPage.uploadFile(imageUploaded.location);
await contentServicesPage.checkContentIsDisplayed(imageUploaded.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(imageUploaded.name);
await contentServicesPage.getDocumentList().rightClickOnRow(imageUploaded.name);
await contentServicesPage.checkContextActionIsVisible('Start Process');
await contentServicesPage.pressContextMenuActionNamed('Start Process');
await selectAppsDialog.checkSelectAppsDialogIsDisplayed();
await selectAppsDialog.clickDropdownAppsButton();
await selectAppsDialog.clickAppsOption();
await selectAppsDialog.clickContinueButton();
await startProcessPage.enterProcessName('Test Process');
await attachmentListPage.checkFileIsAttached(imageUploaded.name);
await startProcessPage.clickFormStartProcessButton();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(startProcessAttachFileApp.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Test Process');
await expect(await processDetailsPage.getEmptyMessage()).toBe('This list is empty');
});
});
});

View File

@ -51,6 +51,12 @@ exports.Files = {
description: "Description for app",
processName: "Process3576"
},
START_PROCESS_ATTACH_FILE: {
file_location: "/resources/apps/Start_process_attach_file.zip",
title: "start process app",
description: "Description for app",
processName: "start process file"
},
TEST_ASSIGNEE: {
file_location: "/resources/apps/Assignee.zip",

View File

@ -24,6 +24,8 @@ export class PaginationPage {
pageSelectorDropDown: ElementFinder = element(by.css('div[class*="adf-pagination__page-selector"]'));
pageSelectorArrow: ElementFinder = element(by.css('button[data-automation-id="page-selector"]'));
itemsPerPage: ElementFinder = element(by.css('span[class="adf-pagination__max-items"]'));
itemsPerPageOpenDropdown: ElementFinder = element(by.css('.adf-pagination__perpage-block button'));
itemsPerPageOptions: Locator = by.css('.adf-pagination__page-selector .mat-menu-item');
currentPage: ElementFinder = element(by.css('span[class="adf-pagination__current-page"]'));
totalPages: ElementFinder = element(by.css('span[class="adf-pagination__total-pages"]'));
paginationRange: ElementFinder = element(by.css('span[class="adf-pagination__range"]'));
@ -53,6 +55,10 @@ export class PaginationPage {
await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorArrow);
}
async clickItemsPerPageDropdown(): Promise<void> {
await BrowserActions.click(this.itemsPerPageOpenDropdown);
}
async checkPaginationIsNotDisplayed() {
await BrowserVisibility.waitUntilElementIsVisible(this.paginationSectionEmpty);
}
@ -99,6 +105,18 @@ export class PaginationPage {
return initialList;
}
async getItemsPerPageDropdownOptions() {
await BrowserVisibility.waitUntilElementIsVisible(element.all(this.itemsPerPageOptions).first());
const initialList = [];
await element.all(this.itemsPerPageOptions).each(async (currentOption) => {
const text = await BrowserActions.getText(currentOption);
if (text !== '') {
initialList.push(text);
}
});
return initialList;
}
async checkNextPageButtonIsDisabled(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.nextButtonDisabled);
}

View File

@ -17,3 +17,4 @@
export * from './form-fields.page';
export * from './start-process-dialog.page';
export * from './select-apps-dialog.page';

View File

@ -0,0 +1,53 @@
/*!
* @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 { BrowserVisibility } from '../../core/utils/browser-visibility';
import { by, element, ElementFinder } from 'protractor';
import { BrowserActions } from '../../core/utils/browser-actions';
export class SelectAppsDialog {
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'));
dropdownAppsButton: ElementFinder = 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'));
async checkSelectAppsDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.selectAppsDialog);
}
async getTitle(): Promise<string> {
return BrowserActions.getText(this.title);
}
async clickDropdownAppsButton(): Promise<void> {
await BrowserActions.click(this.dropdownAppsButton);
}
async clickContinueButton(): Promise<void> {
await BrowserActions.click(this.continueButton);
}
async clickAppsOption(): Promise<void> {
await BrowserActions.click(this.appsOption);
}
async checkSelectAppsDialogIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectAppsDialog);
}
}