mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[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:
parent
6bf8c17771
commit
e5efe74e5e
@ -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);
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -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,37 +51,43 @@ 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);
|
||||
@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -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++) {
|
||||
|
@ -93,14 +93,10 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
@ -130,22 +125,16 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
|
||||
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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,6 +72,8 @@ describe('Start Process Component', () => {
|
||||
'name': browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_name
|
||||
});
|
||||
|
||||
describe('Provider: BPM', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
@ -458,4 +472,86 @@ describe('Start Process Component', () => {
|
||||
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');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -17,3 +17,4 @@
|
||||
|
||||
export * from './form-fields.page';
|
||||
export * from './start-process-dialog.page';
|
||||
export * from './select-apps-dialog.page';
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user