mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
* Upload button e2e * improve test organization * add dev option in test run * Create desktop.ini * upload component automation final step * remove fdescribe * ignore downloads folder * exclude pagination
105 lines
4.4 KiB
TypeScript
105 lines
4.4 KiB
TypeScript
/*!
|
|
* @license
|
|
* Copyright 2016 Alfresco Software, Ltd.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
import LoginPage = require('./pages/adf/loginPage');
|
|
import ProcessServicesPage = require('./pages/adf/process_services/processServicesPage');
|
|
import PaginationPage = require('./pages/adf/paginationPage');
|
|
import ProcessFiltersPage = require('./pages/adf/process_services/processFiltersPage');
|
|
import ProcessDetailsPage = require('./pages/adf/process_services/processDetailsPage');
|
|
|
|
import TestConfig = require('./test.config');
|
|
import resources = require('./util/resources');
|
|
|
|
import AlfrescoApi = require('alfresco-js-api-node');
|
|
import { AppsActions } from './actions/APS/apps.actions';
|
|
import { UsersActions } from './actions/users.actions';
|
|
|
|
describe('Process List - Pagination when adding processes', () => {
|
|
|
|
let itemsPerPage = {
|
|
fifteen: '15',
|
|
fifteenValue: 15
|
|
};
|
|
|
|
let loginPage = new LoginPage();
|
|
let processServicesPage = new ProcessServicesPage();
|
|
let paginationPage = new PaginationPage();
|
|
let processFiltersPage = new ProcessFiltersPage();
|
|
let processDetailsPage = new ProcessDetailsPage();
|
|
|
|
let processUserModel;
|
|
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
|
let nrOfProcesses = 25;
|
|
let page, totalPages;
|
|
|
|
beforeAll(async (done) => {
|
|
let apps = new AppsActions();
|
|
let users = new UsersActions();
|
|
|
|
this.alfrescoJsApi = new AlfrescoApi({
|
|
provider: 'BPM',
|
|
hostBpm: TestConfig.adf.url
|
|
});
|
|
|
|
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
|
|
|
processUserModel = await users.createTenantAndUser(this.alfrescoJsApi);
|
|
|
|
await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
|
|
|
let resultApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
|
|
|
for (let i = 0; i < nrOfProcesses; i++) {
|
|
await apps.startProcess(this.alfrescoJsApi, resultApp);
|
|
}
|
|
|
|
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
|
|
|
done();
|
|
});
|
|
|
|
it('[C261046] Items per page set to 15 and adding of processes', () => {
|
|
totalPages = 2;
|
|
page = 1;
|
|
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
|
processDetailsPage.checkProcessTitleIsDisplayed();
|
|
processFiltersPage.waitForTableBody();
|
|
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
|
|
processDetailsPage.checkProcessTitleIsDisplayed();
|
|
processFiltersPage.waitForTableBody();
|
|
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
|
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
|
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
|
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of ' + nrOfProcesses);
|
|
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
|
|
paginationPage.checkNextPageButtonIsEnabled();
|
|
paginationPage.checkPreviousPageButtonIsDisabled();
|
|
|
|
page++;
|
|
paginationPage.clickOnNextPage();
|
|
processDetailsPage.checkProcessTitleIsDisplayed();
|
|
processFiltersPage.waitForTableBody();
|
|
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
|
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
|
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
|
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
|
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
|
|
paginationPage.checkNextPageButtonIsDisabled();
|
|
paginationPage.checkPreviousPageButtonIsEnabled();
|
|
});
|
|
});
|