mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3259] [ADF-3363] e2e login and card metadata (#3612)
* remember me * add login component e2e test * add success route test * add change logo check * redirect url after logout e2e * move redirection test in a separate file * login component tslint * cardview e2e * fix login test * add test case number * move version test in a separate file * clean unused elements * metadata part 1 * tslint fix * fix metadata test * remove fit * fix formatting file viewerPage * multi propety test * metadata and login improvements * fix data automation fix * metadata permission e2e * fix tslint problems * improve selector * stabilize search component test * stabilize test step 1 * fix tag test add config timeout * tentative * delay after download * change meatdata test * stabilize metadata * use smaller file for not extension related test * stabilize test step 2 * exclude failing test * timeout fix * split in multiple task e2e * trick travis * trigger build * fix command issue * fix save screenshot * fix run subfolder * test timeout increase
This commit is contained in:
committed by
Eugenio Romano
parent
66f534b32c
commit
b2cb93468d
148
e2e/process-services/apps-section.e2e.ts
Normal file
148
e2e/process-services/apps-section.e2e.ts
Normal file
@@ -0,0 +1,148 @@
|
||||
/*!
|
||||
* @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 NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
import Util = require('../util/util');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { ModelsActions } from '../actions/APS/models.actions';
|
||||
import AppPublish = require('../models/APS/AppPublish');
|
||||
|
||||
describe('Modify applications', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let navigationBarPage = new NavigationBarPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let app = resources.Files.APP_WITH_PROCESSES;
|
||||
let appTobeDeleted = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let replacingApp = resources.Files.WIDGETS_SMOKE_TEST;
|
||||
let apps = new AppsActions();
|
||||
let modelActions = new ModelsActions();
|
||||
let firstApp, appVersionToBeDeleted;
|
||||
|
||||
beforeAll(async(done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
let user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
|
||||
firstApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
appVersionToBeDeleted = await apps.importPublishDeployApp(this.alfrescoJsApi, appTobeDeleted.file_location);
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260198] Should the app be displayed on dashboard when is deployed on APS', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
|
||||
expect(processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
|
||||
expect(processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
|
||||
expect(processServicesPage.getDescription(app.title)).toEqual(app.description);
|
||||
});
|
||||
|
||||
it('[C260213] Should a new version of the app be displayed on dashboard when is replaced by importing another app in APS', async() => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
|
||||
expect(processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
|
||||
expect(processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
|
||||
expect(processServicesPage.getDescription(app.title)).toEqual(app.description);
|
||||
|
||||
browser.controlFlow().execute(() => {
|
||||
return apps.importNewVersionAppDefinitionPublishDeployApp(this.alfrescoJsApi, replacingApp.file_location, firstApp.id);
|
||||
});
|
||||
|
||||
browser.refresh();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
|
||||
expect(processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.FAVORITE);
|
||||
expect(processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
|
||||
expect(processServicesPage.getDescription(app.title)).toEqual(app.description);
|
||||
});
|
||||
|
||||
it('[C260220] Should the app not be displayed on dashboard after it was deleted in APS', async() => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
|
||||
processServicesPage.checkAppIsDisplayed(app.title);
|
||||
|
||||
browser.controlFlow().execute(() => {
|
||||
return modelActions.deleteEntireModel(this.alfrescoJsApi, firstApp.id);
|
||||
});
|
||||
|
||||
browser.refresh();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.checkAppIsNotDisplayed(app.title);
|
||||
});
|
||||
|
||||
it('[C260215] Should the penultimate version of an app be displayed on dashboard when the last version is deleted in APS', async() => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
|
||||
processServicesPage.checkAppIsDisplayed(appTobeDeleted.title);
|
||||
expect(processServicesPage.getBackgroundColor(appTobeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
|
||||
|
||||
browser.controlFlow().execute(() => {
|
||||
return apps.importNewVersionAppDefinitionPublishDeployApp(this.alfrescoJsApi, replacingApp.file_location, appVersionToBeDeleted.id);
|
||||
});
|
||||
|
||||
browser.refresh();
|
||||
|
||||
processServicesPage.getBackgroundColor(appTobeDeleted.title);
|
||||
|
||||
expect(processServicesPage.getBackgroundColor(appTobeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
|
||||
|
||||
browser.controlFlow().execute(async() => {
|
||||
await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
|
||||
await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
|
||||
await apps.publishDeployApp(this.alfrescoJsApi, appVersionToBeDeleted.id);
|
||||
});
|
||||
|
||||
browser.refresh();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.checkAppIsDisplayed(appTobeDeleted.title);
|
||||
expect(processServicesPage.getBackgroundColor(appTobeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
|
||||
});
|
||||
|
||||
});
|
104
e2e/process-services/attach-file-widget.e2e.ts
Normal file
104
e2e/process-services/attach-file-widget.e2e.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
/*!
|
||||
* @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 TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import ViewerPage = require('../pages/adf/viewerPage');
|
||||
import UsingWidget = require('../pages/adf/process_services/widgets/usingWidget');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let viewerPage = new ViewerPage();
|
||||
let usingWidget = new UsingWidget();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let taskPage = new TasksPage();
|
||||
|
||||
let processUserModel;
|
||||
let app = resources.Files.WIDGETS_SMOKE_TEST;
|
||||
let pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name });
|
||||
let appFields = app.form_fields;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
let apps = new AppsActions();
|
||||
|
||||
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);
|
||||
|
||||
await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
|
||||
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C274690] Task List attachment - View file', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
|
||||
taskPage.createNewTask()
|
||||
.addName('View file')
|
||||
.addForm(app.formName)
|
||||
.clickStartButton()
|
||||
.then(() => {
|
||||
usingWidget.usingAttachFileWidget().attachFile(appFields.attachfile_id, pdfFile.location);
|
||||
usingWidget.usingAttachFileWidget().checkFileIsAttached(appFields.attachfile_id, pdfFile.name);
|
||||
|
||||
usingWidget.usingAttachFileWidget().viewFile(pdfFile.name);
|
||||
viewerPage.checkFileContent('1', pdfFile.firstPageText);
|
||||
viewerPage.checkCloseButtonIsDisplayed();
|
||||
viewerPage.clickCloseButton();
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList('View file');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
91
e2e/process-services/attachment-list-process.e2e.ts
Normal file
91
e2e/process-services/attachment-list-process.e2e.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
/*!
|
||||
* @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 ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
|
||||
describe('Attachment list', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let attachmentListPage = new AttachmentListPage();
|
||||
let processFiltersPage = new ProcessFiltersPage();
|
||||
|
||||
let processUserModel;
|
||||
let app = resources.Files.APP_WITH_PROCESSES;
|
||||
let pngFile = new FileModel({
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name
|
||||
});
|
||||
let pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name });
|
||||
|
||||
beforeAll(async(done) => {
|
||||
let users = new UsersActions();
|
||||
let apps = new AppsActions();
|
||||
|
||||
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);
|
||||
|
||||
await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C277296] Attach a file to task app - process list', function () {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.startProcess().selectFromProcessDropdown(app.process_se_name).clickFormStartProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('My Default Name');
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
attachmentListPage.clickAttachFileButton(pdfFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
attachmentListPage.checkFileIsAttached(pdfFile.name);
|
||||
});
|
||||
|
||||
it('[C277299] Attach a file to custom app - process list', function () {
|
||||
processServicesPage.goToProcessServices().goToApp(app.title).clickProcessButton();
|
||||
processFiltersPage.startProcess().selectFromProcessDropdown(app.process_se_name).clickFormStartProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('My Default Name');
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
attachmentListPage.clickAttachFileButton(pdfFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
attachmentListPage.checkFileIsAttached(pdfFile.name);
|
||||
});
|
||||
});
|
97
e2e/process-services/empty_process_list_component.e2e.ts
Normal file
97
e2e/process-services/empty_process_list_component.e2e.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
/*!
|
||||
* @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 TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
|
||||
import ProcessDetailsPage = require('../pages/adf/process_services/processDetailsPage');
|
||||
import ProcessListPage = require('../pages/adf/process_services/processListPage');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
describe('Empty Process List Test', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let navigationBarPage = new NavigationBarPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let processFiltersPage = new ProcessFiltersPage();
|
||||
let processDetailsPage = new ProcessDetailsPage();
|
||||
let processListPage = new ProcessListPage();
|
||||
|
||||
let appA = resources.Files.APP_WITH_PROCESSES;
|
||||
let appB = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
let user;
|
||||
|
||||
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);
|
||||
|
||||
user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
|
||||
await apps.importPublishDeployApp(this.alfrescoJsApi, appA.file_location);
|
||||
await apps.importPublishDeployApp(this.alfrescoJsApi, appB.file_location);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260494] Should add process to list when a process is created', () => {
|
||||
loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(appA.title).clickProcessButton();
|
||||
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
|
||||
expect(processListPage.checkProcessDetailsMessagee()).toEqual('No process details found');
|
||||
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
processListPage.openProcessDropdown();
|
||||
processListPage.selectProcessDropdown(1);
|
||||
processListPage.startProcess();
|
||||
expect(processFiltersPage.numberOfProcessRows()).toEqual(1);
|
||||
|
||||
processDetailsPage.checkProcessDetailsCard();
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(appB.title).clickProcessButton();
|
||||
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
|
||||
expect(processListPage.checkProcessDetailsMessagee()).toEqual('No process details found');
|
||||
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
processListPage.openProcessDropdown();
|
||||
processListPage.selectProcessDropdown(0);
|
||||
processListPage.startProcess();
|
||||
expect(processFiltersPage.numberOfProcessRows()).toEqual(1);
|
||||
processDetailsPage.checkProcessDetailsCard();
|
||||
});
|
||||
|
||||
});
|
211
e2e/process-services/form_widgets_component.e2e.ts
Normal file
211
e2e/process-services/form_widgets_component.e2e.ts
Normal file
@@ -0,0 +1,211 @@
|
||||
/*!
|
||||
* @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 TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import UsingWidget = require('../pages/adf/process_services/widgets/usingWidget');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import FormDefinitionModel = require('../models/APS/FormDefinitionModel');
|
||||
import Task = require('../models/APS/Task');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
let formInstance = new FormDefinitionModel();
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
describe('Form widgets', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let processUserModel;
|
||||
let app = resources.Files.WIDGETS_SMOKE_TEST;
|
||||
let appFields = app.form_fields;
|
||||
let taskPage = new TasksPage();
|
||||
let appModel;
|
||||
let newTask = 'First task';
|
||||
let usingWidget = new UsingWidget();
|
||||
let alfrescoJsApi;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
let appsActions = new AppsActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, app.file_location);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('Check text, multiline widgets - label, value and displayed', () => {
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name)
|
||||
.clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(newTask).addDescription('Description').addForm(app.formName).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(newTask);
|
||||
taskPage.usingFormFields().checkFormIsDisplayed();
|
||||
expect(taskPage.usingTaskDetails().getTitle()).toEqual('Activities');
|
||||
})
|
||||
.then(() => {
|
||||
return alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
})
|
||||
.then( (response) => {
|
||||
return alfrescoJsApi.activiti.taskFormsApi.getTaskForm(response.data[0].id);
|
||||
})
|
||||
.then((formDefinition) => {
|
||||
formInstance.setFields(formDefinition.fields);
|
||||
formInstance.setAllWidgets(formDefinition.fields);
|
||||
return formInstance;
|
||||
})
|
||||
.then(() => {
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.text_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).name);
|
||||
expect(taskPage.usingFormFields().getFieldValue(appFields.text_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).value || '');
|
||||
|
||||
expect(usingWidget.usingMultilineTextWidget().getFieldValue(appFields.multiline_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).value || '');
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.multiline_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).name);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('Check number, amount widgets - label, value and displayed', () => {
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldValue(appFields.number_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).value || '');
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.number_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).name);
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldValue(appFields.amount_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).value || '');
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.amount_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).name);
|
||||
});
|
||||
|
||||
it('Check attachfolder, attachfile widgets - label and displayed', () => {
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.attachfolder_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.attachfolder_id).name);
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.attachfile_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.attachfile_id).name);
|
||||
});
|
||||
|
||||
it('Check date, date & time widgets - label, value and displayed', () => {
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.date_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.date_id).name);
|
||||
expect(taskPage.usingFormFields().getFieldValue(appFields.date_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.date_id).value || '');
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.dateTime_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dateTime_id).name);
|
||||
expect(taskPage.usingFormFields().getFieldValue(appFields.dateTime_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.dateTime_id).value || '');
|
||||
});
|
||||
|
||||
it('Check people, group widgets - label, value and displayed', () => {
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldValue(appFields.people_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).value || '');
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.people_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).name);
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldValue(appFields.group_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).value || '');
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.group_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).name);
|
||||
});
|
||||
|
||||
it('Check displayText, displayValue widgets - value and displayed', () => {
|
||||
|
||||
expect(usingWidget.usingDisplayTextWidget().getFieldLabel(appFields.displaytext_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displaytext_id).value);
|
||||
expect(usingWidget.usingDisplayValueWidget().getFieldLabel(appFields.displayvalue_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displayvalue_id).value || 'Unknown type: readonly');
|
||||
});
|
||||
|
||||
it('Check typeahead, header widgets - label, value and displayed', () => {
|
||||
|
||||
expect(usingWidget.usingHeaderWidget().getFieldLabel(appFields.header_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.header_id).name);
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldValue(appFields.typeahead_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.typeahead_id).value || '');
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.typeahead_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.typeahead_id).name);
|
||||
});
|
||||
|
||||
it('Check checkbox, radiobuttons widgets - label, value and displayed', () => {
|
||||
let radioOption = 1;
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.checkbox_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.checkbox_id).name);
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.radiobuttons_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.radiobuttons_id).name);
|
||||
expect(usingWidget.usingRadioWidget().getSpecificOptionLabel(appFields.radiobuttons_id, radioOption))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.radiobuttons_id).options[radioOption - 1].name);
|
||||
});
|
||||
|
||||
it('Check hyperlink, dropdown, dynamictable widgets - label, value and displayed', () => {
|
||||
|
||||
expect(usingWidget.usingHyperlink().getFieldText(appFields.hyperlink_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).hyperlinkUrl || '');
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.hyperlink_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).name);
|
||||
|
||||
expect(taskPage.usingFormFields().getFieldLabel(appFields.dropdown_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).name);
|
||||
expect(usingWidget.usingDropdown().getSelectedOptionText(appFields.dropdown_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).value);
|
||||
|
||||
expect(usingWidget.usingDynamicTable().getFieldLabel(appFields.dynamictable_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dynamictable_id).name);
|
||||
expect(usingWidget.usingDynamicTable().getColumnName(appFields.dynamictable_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dynamictable_id).columnDefinitions[0].name);
|
||||
});
|
||||
|
||||
});
|
@@ -0,0 +1,104 @@
|
||||
/*!
|
||||
* @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();
|
||||
});
|
||||
});
|
95
e2e/process-services/pagination_tasklist_addingTasks.e2e.ts
Normal file
95
e2e/process-services/pagination_tasklist_addingTasks.e2e.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
/*!
|
||||
* @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 TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import PaginationPage = require('../pages/adf/paginationPage');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
describe('Items per page set to 15 and adding of tasks', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let taskPage = new TasksPage();
|
||||
let paginationPage = new PaginationPage();
|
||||
|
||||
let processUserModel;
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let currentPage = 1, nrOfTasks = 25, totalPages = 2;
|
||||
|
||||
let itemsPerPage = {
|
||||
fifteen: '15',
|
||||
fifteenValue: 15
|
||||
};
|
||||
|
||||
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 < nrOfTasks; i++) {
|
||||
await apps.startProcess(this.alfrescoJsApi, resultApp);
|
||||
}
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('Items per page set to 15 and adding of tasks', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.fifteenValue);
|
||||
currentPage++;
|
||||
paginationPage.clickOnNextPage();
|
||||
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
});
|
||||
|
||||
});
|
194
e2e/process-services/process_attachmentList_actionMenu.e2e.ts
Normal file
194
e2e/process-services/process_attachmentList_actionMenu.e2e.ts
Normal file
@@ -0,0 +1,194 @@
|
||||
/*!
|
||||
* @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 ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
|
||||
import ProcessDetailsPage = require('../pages/adf/process_services/processDetailsPage.js');
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
import ViewerPage = require('../pages/adf/viewerPage.js');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util.js');
|
||||
|
||||
import path = require('path');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
|
||||
describe('Attachment list action menu for processes', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let processFiltersPage = new ProcessFiltersPage();
|
||||
let processDetailsPage = new ProcessDetailsPage();
|
||||
let attachmentListPage = new AttachmentListPage();
|
||||
let viewerPage = new ViewerPage();
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let pngFile = new FileModel({
|
||||
location: resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
name: resources.Files.ADF_DOCUMENTS.PNG.file_name
|
||||
});
|
||||
|
||||
let downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name);
|
||||
let tenantId, appId;
|
||||
let processName = {
|
||||
active: 'Active Process',
|
||||
completed: 'Completed Process',
|
||||
taskApp: 'Task App Name',
|
||||
emptyList: 'Empty List',
|
||||
dragDrop: 'Drag and Drop'
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
let user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
|
||||
tenantId = user.tenantId;
|
||||
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
|
||||
let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
appId = importedApp.id;
|
||||
|
||||
await apps.startProcess(this.alfrescoJsApi, importedApp, processName.completed);
|
||||
await apps.startProcess(this.alfrescoJsApi, importedApp, processName.active);
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', processName.taskApp);
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', processName.emptyList);
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', processName.dragDrop);
|
||||
|
||||
await loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260228] Option menu functionality - Active Process', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(app.title).clickProcessButton();
|
||||
|
||||
processFiltersPage.selectFromProcessList(processName.active);
|
||||
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.viewFile(pngFile.name);
|
||||
|
||||
viewerPage.checkFileNameIsDisplayed(pngFile.name);
|
||||
viewerPage.clickCloseButton();
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList(processName.active);
|
||||
|
||||
attachmentListPage.doubleClickFile(pngFile.name);
|
||||
|
||||
viewerPage.checkFileNameIsDisplayed(pngFile.name);
|
||||
viewerPage.clickCloseButton();
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList(processName.active);
|
||||
|
||||
attachmentListPage.downloadFile(pngFile.name);
|
||||
|
||||
browser.driver.sleep(500);
|
||||
|
||||
expect(Util.fileExists(downloadedPngFile, 20)).toBe(true);
|
||||
|
||||
attachmentListPage.removeFile(pngFile.name);
|
||||
attachmentListPage.checkFileIsRemoved(pngFile.name);
|
||||
});
|
||||
|
||||
it('[C279886] Option menu functionality - Completed Process', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(app.title).clickProcessButton();
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList(processName.completed);
|
||||
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
|
||||
processDetailsPage.clickCancelProcessButton();
|
||||
|
||||
processFiltersPage.clickCompletedFilterButton();
|
||||
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
|
||||
attachmentListPage.checkAttachFileButtonIsNotDisplayed();
|
||||
attachmentListPage.viewFile(pngFile.name);
|
||||
|
||||
viewerPage.checkFileNameIsDisplayed(pngFile.name);
|
||||
viewerPage.clickCloseButton();
|
||||
|
||||
processFiltersPage.clickCompletedFilterButton();
|
||||
|
||||
attachmentListPage.downloadFile(pngFile.name);
|
||||
|
||||
browser.driver.sleep(500);
|
||||
|
||||
expect(Util.fileExists(downloadedPngFile, 20)).toBe(true);
|
||||
|
||||
attachmentListPage.removeFile(pngFile.name);
|
||||
attachmentListPage.checkFileIsRemoved(pngFile.name);
|
||||
});
|
||||
|
||||
it('[C277296] Upload file - ProcessList - Task APP', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList(processName.taskApp);
|
||||
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
});
|
||||
|
||||
it('[C260235] Empty list component', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList(processName.emptyList);
|
||||
|
||||
attachmentListPage.checkEmptyAttachmentList();
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
attachmentListPage.removeFile(pngFile.name);
|
||||
attachmentListPage.checkFileIsRemoved(pngFile.name);
|
||||
attachmentListPage.checkEmptyAttachmentList();
|
||||
});
|
||||
|
||||
});
|
126
e2e/process-services/process_filters_component.e2e.ts
Normal file
126
e2e/process-services/process_filters_component.e2e.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
/*!
|
||||
* @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 TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import StartProcessPage = require('../pages/adf/process_services/startProcessPage');
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
|
||||
import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage');
|
||||
import ProcessDetailsPage = require('../pages/adf/process_services/processDetailsPage');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
describe('Process Filters Test', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let navigationBarPage = new NavigationBarPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let startProcessPage = new StartProcessPage();
|
||||
let processFiltersPage = new ProcessFiltersPage();
|
||||
let appNavigationBarPage = new AppNavigationBarPage();
|
||||
let processDetailsPage = new ProcessDetailsPage();
|
||||
|
||||
let app = resources.Files.APP_WITH_DATE_FIELD_FORM;
|
||||
|
||||
let processTitle = {
|
||||
running: 'Test_running',
|
||||
completed: 'Test_completed'
|
||||
};
|
||||
let processFilter = {
|
||||
running: 'Running',
|
||||
all: 'All',
|
||||
completed: 'Completed'
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
let user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
|
||||
await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
|
||||
await loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('Navigate to Running filter', () => {
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
|
||||
startProcessPage.enterProcessName(processTitle.completed);
|
||||
startProcessPage.selectFromProcessDropdown(app.process_title);
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
|
||||
processDetailsPage.clickCancelProcessButton();
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.goToApp(app.title);
|
||||
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
|
||||
startProcessPage.enterProcessName(processTitle.running);
|
||||
startProcessPage.selectFromProcessDropdown(app.process_title);
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilter.running);
|
||||
processFiltersPage.selectFromProcessList(processTitle.running);
|
||||
|
||||
processDetailsPage.checkProcessDetailsCard();
|
||||
});
|
||||
|
||||
it('Navigate to All filter', () => {
|
||||
processFiltersPage.clickAllFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilter.all);
|
||||
processFiltersPage.selectFromProcessList(processTitle.running);
|
||||
processFiltersPage.selectFromProcessList(processTitle.completed);
|
||||
processDetailsPage.checkProcessDetailsCard();
|
||||
});
|
||||
|
||||
it('Navigate to Completed filter', () => {
|
||||
processFiltersPage.clickCompletedFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
|
||||
processFiltersPage.selectFromProcessList(processTitle.completed);
|
||||
processDetailsPage.checkProcessDetailsCard();
|
||||
});
|
||||
});
|
355
e2e/process-services/processlist_pagination.e2e.ts
Normal file
355
e2e/process-services/processlist_pagination.e2e.ts
Normal file
@@ -0,0 +1,355 @@
|
||||
/*!
|
||||
* @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 Util = require('../util/util');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
describe('Process List - Pagination', function () {
|
||||
|
||||
let itemsPerPage = {
|
||||
five: '5',
|
||||
fiveValue: 5,
|
||||
ten: '10',
|
||||
tenValue: 10,
|
||||
fifteen: '15',
|
||||
fifteenValue: 15,
|
||||
twenty: '20',
|
||||
twentyValue: 20,
|
||||
default: '25'
|
||||
};
|
||||
|
||||
let processFilterRunning = 'Running';
|
||||
|
||||
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 = 20;
|
||||
let page, totalPages, processNameBase = 'process';
|
||||
let processNames = Util.generateSeqeunceFiles(10, nrOfProcesses + 9, processNameBase, '');
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
xit('[C261042] Default pagination', function () {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.checkNoContentMessage();
|
||||
paginationPage.checkPaginationIsNotDisplayed();
|
||||
|
||||
page = 1;
|
||||
totalPages = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
xit('[C261043] Items per page set to 15', function () {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
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();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
});
|
||||
|
||||
xit('[C261044] Items per page set to 10', function () {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
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.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
});
|
||||
|
||||
it('[C261047] Items per page set to 20', function () {
|
||||
page = 1;
|
||||
totalPages = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
});
|
||||
|
||||
it('[C261045] 5 Items per page', function () {
|
||||
page = 1;
|
||||
totalPages = 4;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.five * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
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.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.five * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.five * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.five * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
});
|
||||
|
||||
it('[C261049] Page number dropdown', function () {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
paginationPage.clickOnPageDropdown();
|
||||
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
page = 2;
|
||||
paginationPage.clickOnPageDropdownOption('2');
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
paginationPage.clickOnPageDropdown();
|
||||
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
page = 1;
|
||||
paginationPage.clickOnPageDropdownOption('1');
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
xit('[C261048] Sorting by Name', function () {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
processFiltersPage.sortByName(true);
|
||||
processFiltersPage.waitForTableBody();
|
||||
processFiltersPage.getAllRowsNameColumn().then(function (list) {
|
||||
expect(JSON.stringify(list) === JSON.stringify(processNames)).toEqual(true);
|
||||
});
|
||||
processFiltersPage.sortByName(false);
|
||||
processFiltersPage.getAllRowsNameColumn().then(function (list) {
|
||||
processNames.reverse();
|
||||
expect(JSON.stringify(list) === JSON.stringify(processNames)).toEqual(true);
|
||||
});
|
||||
});
|
||||
});
|
98
e2e/process-services/sort_tasklist_pagination.e2e.ts
Normal file
98
e2e/process-services/sort_tasklist_pagination.e2e.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
/*!
|
||||
* @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 TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import PaginationPage = require('../pages/adf/paginationPage');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
describe('Task List Pagination - Sorting', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let taskPage = new TasksPage();
|
||||
let paginationPage = new PaginationPage();
|
||||
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let nrOfTasks = 20, processUserModel;
|
||||
let taskNameBase = 'Task';
|
||||
let taskNames = Util.generateSeqeunceFiles(10, nrOfTasks + 9, taskNameBase, '');
|
||||
|
||||
let itemsPerPage = {
|
||||
five: '5',
|
||||
fiveValue: 5,
|
||||
ten: '10',
|
||||
tenValue: 10,
|
||||
twenty: '20',
|
||||
twentyValue: 20
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
|
||||
for (let i = 0; i < nrOfTasks; i++) {
|
||||
this.alfrescoJsApi.activiti.taskApi.createNewTask({name: taskNames[i]});
|
||||
}
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260308] Sorting by Name', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
taskPage.usingFiltersPage().sortByName(true);
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
taskPage.usingFiltersPage().getAllRowsNameColumn().then(function (list) {
|
||||
expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
|
||||
});
|
||||
taskPage.usingFiltersPage().sortByName(false);
|
||||
taskPage.usingFiltersPage().getAllRowsNameColumn().then(function (list) {
|
||||
taskNames.reverse();
|
||||
expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
346
e2e/process-services/start_process_component.e2e.ts
Normal file
346
e2e/process-services/start_process_component.e2e.ts
Normal file
@@ -0,0 +1,346 @@
|
||||
/*!
|
||||
* @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 Util = require('../util/util');
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import CONSTANTS = require('../util/constants');
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import StartProcessPage = require('../pages/adf/process_services/startProcessPage');
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
|
||||
import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage');
|
||||
import ProcessDetailsPage = require('../pages/adf/process_services/processDetailsPage');
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
|
||||
import User = require('../models/APS/User');
|
||||
import AppPublish = require('../models/APS/AppPublish');
|
||||
import Tenant = require('../models/APS/Tenant');
|
||||
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
|
||||
describe('Start Process Component', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let navigationBarPage = new NavigationBarPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let startProcessPage = new StartProcessPage();
|
||||
let processFiltersPage = new ProcessFiltersPage();
|
||||
let appNavigationBarPage = new AppNavigationBarPage();
|
||||
let processDetailsPage = new ProcessDetailsPage();
|
||||
let attachmentListPage = new AttachmentListPage();
|
||||
let app = resources.Files.APP_WITH_PROCESSES;
|
||||
let appId, procUserModel, secondProcUserModel, tenantId;
|
||||
|
||||
let auditLogFile = path.join('../e2e/download/', 'Audit.pdf');
|
||||
|
||||
let jpgFile = new FileModel({
|
||||
'location': resources.Files.ADF_DOCUMENTS.JPG.file_location,
|
||||
'name': resources.Files.ADF_DOCUMENTS.JPG.file_name
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
let 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: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApiUserTwo.login(secondProcUserModel.email, secondProcUserModel.password);
|
||||
|
||||
let pathFile = path.join(TestConfig.main.rootPath + app.file_location);
|
||||
let file = fs.createReadStream(pathFile);
|
||||
|
||||
let appCreated = await this.alfrescoJsApiUserTwo.activiti.appsApi.importAppDefinition(file);
|
||||
|
||||
appId = appCreated.id;
|
||||
|
||||
let publishApp = await this.alfrescoJsApiUserTwo.activiti.appsApi.publishAppDefinition(appId, new AppPublish());
|
||||
|
||||
await this.alfrescoJsApiUserTwo.activiti.appsApi.deployAppDefinitions({ appDefinitions: [{ id: publishApp.appDefinition.id }] });
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(procUserModel);
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
done();
|
||||
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(appId);
|
||||
|
||||
// await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(secondModelId);
|
||||
//
|
||||
// await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(modelId);
|
||||
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('Check start a process without a process model included', () => {
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp('Task App');
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.checkNoProcessMessage();
|
||||
});
|
||||
|
||||
it('Check Start Process within Task App', () => {
|
||||
loginPage.loginToProcessServicesUsingUserModel(secondProcUserModel);
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp('Task App');
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
expect(startProcessPage.getDefaultName()).toEqual('My Default Name');
|
||||
});
|
||||
|
||||
it('Name of the process is required', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.selectFromProcessDropdown('process_without_se');
|
||||
startProcessPage.deleteDefaultName('My Default Name');
|
||||
startProcessPage.checkStartProcessButtonIsDisabled();
|
||||
});
|
||||
|
||||
it('Process Definition is required and cancel button is clicked', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp('Task App');
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.selectFromProcessDropdown('Choose one...');
|
||||
startProcessPage.checkStartProcessButtonIsDisabled();
|
||||
startProcessPage.clickCancelProcessButton();
|
||||
processFiltersPage.checkNoContentMessage();
|
||||
});
|
||||
|
||||
it('Check Start Process within an app without a start event', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.selectFromProcessDropdown('process_without_se');
|
||||
expect(startProcessPage.getDefaultName()).toEqual('My Default Name');
|
||||
startProcessPage.checkStartProcessButtonIsEnabled();
|
||||
});
|
||||
|
||||
xit('Start a process within an app with a start event', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.enterProcessName('Test');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton()
|
||||
.then(() => {
|
||||
processDetailsPage.getId()
|
||||
.then(function (result) {
|
||||
return this.alfrescoJsApi.activiti.processApi.getProcessInstance(result);
|
||||
})
|
||||
.then(function (response) {
|
||||
expect(processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESSSTATUS.RUNNING);
|
||||
expect(processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESSENDDATE);
|
||||
expect(processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESSCATEGORY);
|
||||
expect(processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESSBUSINESSKEY);
|
||||
expect(processDetailsPage.getCreatedBy()).toEqual(response.getStartedBy().getEntireName());
|
||||
expect(processDetailsPage.getCreated()).toEqual(dateFormat(CONSTANTS.PROCESSDATEFORMAT));
|
||||
expect(processDetailsPage.getId()).toEqual(response.getId());
|
||||
expect(processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESSDESCRIPTION);
|
||||
expect(processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(response.getName());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Add a comment on an active process', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.enterProcessName('Comment Process');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Comment Process');
|
||||
processDetailsPage.addComment('comment1');
|
||||
processDetailsPage.checkCommentIsDisplayed('comment1');
|
||||
});
|
||||
|
||||
it('Click Audit Log button', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.enterProcessName('Audit Log');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Audit Log');
|
||||
processDetailsPage.clickAuditLogButton();
|
||||
expect(Util.fileExists(auditLogFile, 10)).toBe(true);
|
||||
});
|
||||
|
||||
it('Add a file in the attachment list using the button', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
|
||||
startProcessPage.enterProcessName('Attach File');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Attach File');
|
||||
|
||||
attachmentListPage.clickAttachFileButton(jpgFile.location);
|
||||
attachmentListPage.checkFileIsAttached(jpgFile.name);
|
||||
});
|
||||
|
||||
it('Click Show Diagram', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
|
||||
startProcessPage.enterProcessName('Show Diagram');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Show Diagram');
|
||||
|
||||
processDetailsPage.clickShowDiagram();
|
||||
});
|
||||
|
||||
it('Click on an active task', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.enterProcessName('Active Task');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Active Task');
|
||||
processDetailsPage.clickOnActiveTask();
|
||||
processDetailsPage.checkActiveTaskTitleIsDisplayed(app.task_name);
|
||||
});
|
||||
|
||||
it('Click Cancel process button', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.enterProcessName('Cancel Process');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Cancel Process');
|
||||
processDetailsPage.clickCancelProcessButton();
|
||||
processFiltersPage.clickCompletedFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Cancel Process');
|
||||
processDetailsPage.checkShowDiagramIsDisabled();
|
||||
});
|
||||
|
||||
it('Add a comment on a complete process', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.enterProcessName('Comment Process 2');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Comment Process 2');
|
||||
processDetailsPage.clickCancelProcessButton();
|
||||
processFiltersPage.clickCompletedFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Comment Process 2');
|
||||
processDetailsPage.addComment('goodbye');
|
||||
processDetailsPage.checkCommentIsDisplayed('goodbye');
|
||||
});
|
||||
|
||||
it('Cannot attach a file on a completed process', () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
appNavigationBarPage.clickProcessButton();
|
||||
processFiltersPage.clickCreateProcessButton();
|
||||
processFiltersPage.clickNewProcessDropdown();
|
||||
startProcessPage.enterProcessName('File');
|
||||
startProcessPage.selectFromProcessDropdown('process_with_se');
|
||||
startProcessPage.clickFormStartProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('File');
|
||||
processDetailsPage.clickCancelProcessButton();
|
||||
processFiltersPage.clickCompletedFilterButton();
|
||||
processFiltersPage.selectFromProcessList('File');
|
||||
attachmentListPage.checkAttachFileButtonIsNotDisplayed();
|
||||
});
|
||||
});
|
220
e2e/process-services/start_task_custom_app.e2e.ts
Normal file
220
e2e/process-services/start_task_custom_app.e2e.ts
Normal file
@@ -0,0 +1,220 @@
|
||||
/*!
|
||||
* @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 TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import Task = require('../models/APS/Task');
|
||||
import Tenant = require('../models/APS/Tenant');
|
||||
|
||||
import TaskModel = require('../models/APS/TaskModel');
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import FormModel = require('../models/APS/FormModel');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
describe('Start Task - Custom App', () => {
|
||||
|
||||
let TASKDATAFORMAT = 'mmm dd yyyy';
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let attachmentListPage = new AttachmentListPage();
|
||||
let processUserModel, assigneeUserModel;
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let formTextField = app.form_fields.form_fieldId;
|
||||
let formFieldValue = 'First value ';
|
||||
let taskPage = new TasksPage();
|
||||
let firstComment = 'comm1', firstChecklist = 'checklist1';
|
||||
let tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
|
||||
let showHeaderTask = 'Show Header';
|
||||
let appModel;
|
||||
let pngFile = new FileModel({
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant());
|
||||
|
||||
assigneeUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id);
|
||||
|
||||
processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id);
|
||||
|
||||
await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
|
||||
appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('Modifying task', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[0])
|
||||
.addForm(app.formName).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[0]);
|
||||
taskPage.usingTaskDetails().clickInvolvePeopleButton()
|
||||
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
|
||||
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
|
||||
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
taskPage.usingTaskDetails().clickAddInvolvedUserButton();
|
||||
expect(taskPage.usingTaskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual(assigneeUserModel.email);
|
||||
taskPage.usingTaskDetails().selectActivityTab().addComment(firstComment)
|
||||
.checkCommentIsDisplayed(firstComment);
|
||||
taskPage.clickOnAddChecklistButton().addName(firstChecklist).clickCreateChecklistButton();
|
||||
taskPage.checkChecklistIsDisplayed(firstChecklist);
|
||||
taskPage.usingTaskDetails().selectDetailsTab();
|
||||
});
|
||||
});
|
||||
|
||||
it('Information box', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[1]).addDescription('Description')
|
||||
.addForm(app.formName).clickStartButton()
|
||||
.then(() => {
|
||||
expect(taskPage.usingTaskDetails().getTitle()).toEqual('Activities');
|
||||
})
|
||||
.then(() => {
|
||||
return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
})
|
||||
.then((response) => {
|
||||
let taskModel = new TaskModel(response.data[0]);
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(taskModel.getName());
|
||||
|
||||
expect(taskPage.usingTaskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASKDATAFORMAT));
|
||||
expect(taskPage.usingTaskDetails().getId()).toEqual(taskModel.getId());
|
||||
expect(taskPage.usingTaskDetails().getDescription()).toEqual(taskModel.getDescription());
|
||||
expect(taskPage.usingTaskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
|
||||
expect(taskPage.usingTaskDetails().getCategory())
|
||||
.toEqual(taskModel.getCategory() === null ? CONSTANTS.TASKDETAILS.NO_CATEGORY : taskModel.getCategory());
|
||||
expect(taskPage.usingTaskDetails().getDueDate())
|
||||
.toEqual(taskModel.getDueDate() === null ? CONSTANTS.TASKDETAILS.NO_DATE : taskModel.getDueDate());
|
||||
expect(taskPage.usingTaskDetails().getParentName())
|
||||
.toEqual(taskModel.getParentTaskName() === null ? CONSTANTS.TASKDETAILS.NO_PARENT : taskModel.getParentTaskName());
|
||||
expect(taskPage.usingTaskDetails().getStatus()).toEqual(CONSTANTS.TASKSTATUS.RUNNING);
|
||||
|
||||
return this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(response.data[0].id);
|
||||
})
|
||||
.then((response) => {
|
||||
let formModel = new FormModel(response);
|
||||
expect(taskPage.usingTaskDetails().getFormName())
|
||||
.toEqual(formModel.getName() === null ? CONSTANTS.TASKDETAILS.NO_FORM : formModel.getName());
|
||||
});
|
||||
});
|
||||
|
||||
it('Start task with no form', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[2]).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[2]);
|
||||
taskPage.usingFormFields().noFormIsDisplayed();
|
||||
expect(taskPage.usingTaskDetails().getFormName()).toEqual(CONSTANTS.TASKDETAILS.NO_FORM);
|
||||
});
|
||||
});
|
||||
|
||||
it('Start task buttons', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().checkStartButtonIsDisabled().addName(tasks[3])
|
||||
.checkStartButtonIsEnabled().clickCancelButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsNotDisplayedInTasksList(tasks[3]);
|
||||
expect(taskPage.usingFiltersPage().getActiveFilter()).toEqual(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
});
|
||||
});
|
||||
|
||||
it('Refreshing the form', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask()
|
||||
.addForm(app.formName).addName(tasks[4]).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[4]);
|
||||
expect(taskPage.usingFormFields().setFieldValue(by.id, formTextField, formFieldValue)
|
||||
.getFieldValue(formTextField)).toEqual(formFieldValue);
|
||||
taskPage.usingFormFields().refreshForm().checkFieldValue(by.id, formTextField, '');
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[4]);
|
||||
taskPage.usingFormFields().setFieldValue(by.id, formTextField, formFieldValue)
|
||||
.checkFieldValue(by.id, formTextField, formFieldValue);
|
||||
taskPage.usingFormFields().saveForm().checkFieldValue(by.id, formTextField, formFieldValue);
|
||||
});
|
||||
});
|
||||
|
||||
it('Assign User', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[5])
|
||||
.addAssignee(assigneeUserModel.firstName).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskListIsLoaded();
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[5]).selectTaskFromTasksList(tasks[5]);
|
||||
taskPage.checkTaskTitle(tasks[5]);
|
||||
expect(taskPage.usingTaskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
});
|
||||
});
|
||||
|
||||
it('Attach a file', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[6]).clickStartButton()
|
||||
.then(() => {
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(showHeaderTask).clickStartButton();
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(showHeaderTask).selectTaskFromTasksList(showHeaderTask);
|
||||
|
||||
taskPage.usingTaskDetails().usingTaskDetailsToggles().disableShowHeader();
|
||||
taskPage.usingTaskDetails().taskInfoDrawerIsNotDisplayed();
|
||||
|
||||
taskPage.usingTaskDetails().usingTaskDetailsToggles().enableShowHeader();
|
||||
taskPage.usingTaskDetails().taskInfoDrawerIsDisplayed();
|
||||
});
|
||||
});
|
222
e2e/process-services/start_task_task_app.e2e.ts
Normal file
222
e2e/process-services/start_task_task_app.e2e.ts
Normal file
@@ -0,0 +1,222 @@
|
||||
/*!
|
||||
* @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 TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import Tenant = require('../models/APS/Tenant');
|
||||
import Task = require('../models/APS/Task');
|
||||
import TaskModel = require('../models/APS/TaskModel');
|
||||
import FormModel = require('../models/APS/FormModel');
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
|
||||
let TASKDATAFORMAT = 'mmm dd yyyy';
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let attachmentListPage = new AttachmentListPage();
|
||||
let processUserModel, assigneeUserModel;
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let formTextField = app.form_fields.form_fieldId;
|
||||
let formFieldValue = 'First value ';
|
||||
let taskPage = new TasksPage();
|
||||
let formModel;
|
||||
let firstComment = 'comm1', firstChecklist = 'checklist1';
|
||||
let tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
|
||||
let showHeaderTask = 'Show Header';
|
||||
let jpgFile = new FileModel({
|
||||
'location': resources.Files.ADF_DOCUMENTS.JPG.file_location,
|
||||
'name': resources.Files.ADF_DOCUMENTS.JPG.file_name
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant());
|
||||
|
||||
assigneeUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id);
|
||||
|
||||
processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id);
|
||||
|
||||
let pathFile = path.join(TestConfig.main.rootPath + app.file_location);
|
||||
let file = fs.createReadStream(pathFile);
|
||||
|
||||
await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
|
||||
await this.alfrescoJsApi.activiti.appsApi.importAppDefinition(file);
|
||||
|
||||
await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: showHeaderTask});
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('Modifying task', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[0])
|
||||
.addForm(app.formName).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[0]);
|
||||
taskPage.usingTaskDetails().clickInvolvePeopleButton()
|
||||
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
|
||||
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
|
||||
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
taskPage.usingTaskDetails().clickAddInvolvedUserButton();
|
||||
expect(taskPage.usingTaskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual(assigneeUserModel.email);
|
||||
taskPage.usingTaskDetails().selectActivityTab().addComment(firstComment)
|
||||
.checkCommentIsDisplayed(firstComment);
|
||||
taskPage.clickOnAddChecklistButton().addName(firstChecklist).clickCreateChecklistButton();
|
||||
taskPage.checkChecklistIsDisplayed(firstChecklist);
|
||||
taskPage.usingTaskDetails().selectDetailsTab();
|
||||
});
|
||||
});
|
||||
|
||||
it('Information box', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[1]).addDescription('Description')
|
||||
.addForm(app.formName).clickStartButton()
|
||||
.then(() => {
|
||||
expect(taskPage.usingTaskDetails().getTitle()).toEqual('Activities');
|
||||
})
|
||||
.then(() => {
|
||||
return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
})
|
||||
.then((response) => {
|
||||
let taskModel = new TaskModel(response.data[0]);
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(taskModel.getName());
|
||||
expect(taskPage.usingTaskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASKDATAFORMAT));
|
||||
expect(taskPage.usingTaskDetails().getId()).toEqual(taskModel.getId());
|
||||
expect(taskPage.usingTaskDetails().getDescription()).toEqual(taskModel.getDescription());
|
||||
expect(taskPage.usingTaskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
|
||||
expect(taskPage.usingTaskDetails().getCategory())
|
||||
.toEqual(taskModel.getCategory() === null ? CONSTANTS.TASKDETAILS.NO_CATEGORY : taskModel.getCategory());
|
||||
expect(taskPage.usingTaskDetails().getDueDate())
|
||||
.toEqual(taskModel.getDueDate() === null ? CONSTANTS.TASKDETAILS.NO_DATE : taskModel.getDueDate());
|
||||
expect(taskPage.usingTaskDetails().getParentName())
|
||||
.toEqual(taskModel.getParentTaskName() === null ? CONSTANTS.TASKDETAILS.NO_PARENT : taskModel.getParentTaskName());
|
||||
expect(taskPage.usingTaskDetails().getStatus()).toEqual(CONSTANTS.TASKSTATUS.RUNNING);
|
||||
return this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(response.data[0].id);
|
||||
})
|
||||
.then(function (response) {
|
||||
formModel = new FormModel(response);
|
||||
expect(taskPage.usingTaskDetails().getFormName())
|
||||
.toEqual(formModel.getName() === null ? CONSTANTS.TASKDETAILS.NO_FORM : formModel.getName());
|
||||
});
|
||||
});
|
||||
|
||||
it('Start task with no form', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[2]).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[2]);
|
||||
taskPage.usingFormFields().noFormIsDisplayed();
|
||||
expect(taskPage.usingTaskDetails().getFormName()).toEqual(CONSTANTS.TASKDETAILS.NO_FORM);
|
||||
});
|
||||
});
|
||||
|
||||
it('Start task buttons', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().checkStartButtonIsDisabled().addName(tasks[3])
|
||||
.checkStartButtonIsEnabled().clickCancelButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsNotDisplayedInTasksList(tasks[3]);
|
||||
expect(taskPage.usingFiltersPage().getActiveFilter()).toEqual(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
});
|
||||
});
|
||||
|
||||
it('Refreshing the form', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask()
|
||||
.addForm(app.formName).addName(tasks[4]).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[4]);
|
||||
expect(taskPage.usingFormFields().setFieldValue(by.id, formTextField, formFieldValue)
|
||||
.getFieldValue(formTextField)).toEqual(formFieldValue);
|
||||
taskPage.usingFormFields().refreshForm().checkFieldValue(by.id, formTextField, '');
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[4]);
|
||||
taskPage.usingFormFields().setFieldValue(by.id, formTextField, formFieldValue)
|
||||
.checkFieldValue(by.id, formTextField, formFieldValue);
|
||||
taskPage.usingFormFields().saveForm().checkFieldValue(by.id, formTextField, formFieldValue);
|
||||
});
|
||||
});
|
||||
|
||||
it('Assign User', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[5])
|
||||
.addAssignee(assigneeUserModel.firstName).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.usingTasksListPage().checkTaskListIsLoaded();
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[5]).selectTaskFromTasksList(tasks[5]);
|
||||
taskPage.checkTaskTitle(tasks[5]);
|
||||
expect(taskPage.usingTaskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
});
|
||||
});
|
||||
|
||||
it('Attach a file', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(tasks[6]).clickStartButton()
|
||||
.then(() => {
|
||||
attachmentListPage.clickAttachFileButton(jpgFile.location);
|
||||
attachmentListPage.checkFileIsAttached(jpgFile.name);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C260420] Should Information box be hidden when showHeaderContent property is set on false', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(showHeaderTask).selectTaskFromTasksList(showHeaderTask);
|
||||
|
||||
taskPage.usingTaskDetails().usingTaskDetailsToggles().disableShowHeader();
|
||||
taskPage.usingTaskDetails().taskInfoDrawerIsNotDisplayed();
|
||||
|
||||
taskPage.usingTaskDetails().usingTaskDetailsToggles().enableShowHeader();
|
||||
taskPage.usingTaskDetails().taskInfoDrawerIsDisplayed();
|
||||
});
|
||||
});
|
178
e2e/process-services/task_attachmentList_actionMenu.e2e.ts
Normal file
178
e2e/process-services/task_attachmentList_actionMenu.e2e.ts
Normal file
@@ -0,0 +1,178 @@
|
||||
/*!
|
||||
* @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 TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
import ViewerPage = require('../pages/adf/viewerPage.js');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util.js');
|
||||
|
||||
import path = require('path');
|
||||
import fs = require('fs');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
|
||||
describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let taskPage = new TasksPage();
|
||||
let attachmentListPage = new AttachmentListPage();
|
||||
let viewerPage = new ViewerPage();
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let pngFile = new FileModel({
|
||||
location: resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
name: resources.Files.ADF_DOCUMENTS.PNG.file_name
|
||||
});
|
||||
let downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name);
|
||||
let tenantId, appId;
|
||||
let taskName = {
|
||||
active: 'Active Task',
|
||||
completed: 'Completed Task',
|
||||
taskApp: 'Task App Name',
|
||||
emptyList: 'Empty List'
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
let user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
|
||||
tenantId = user.tenantId;
|
||||
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
|
||||
let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
appId = importedApp.id;
|
||||
|
||||
await loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async(done) => {
|
||||
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C277311] Should be able to View /Download /Remove from Attachment List on an active task', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(app.title).clickTasksButton();
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(taskName.active).clickStartButton();
|
||||
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.viewFile(pngFile.name);
|
||||
|
||||
viewerPage.checkFileNameIsDisplayed(pngFile.name);
|
||||
viewerPage.clickCloseButton();
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
|
||||
attachmentListPage.doubleClickFile(pngFile.name);
|
||||
|
||||
viewerPage.checkFileNameIsDisplayed(pngFile.name);
|
||||
viewerPage.clickCloseButton();
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
|
||||
attachmentListPage.downloadFile(pngFile.name);
|
||||
|
||||
browser.driver.sleep(500);
|
||||
|
||||
expect(Util.fileExists(downloadedPngFile, 20)).toBe(true);
|
||||
|
||||
attachmentListPage.removeFile(pngFile.name);
|
||||
attachmentListPage.checkFileIsRemoved(pngFile.name);
|
||||
});
|
||||
|
||||
it('[C260236] Should be able to View /Download /Remove from Attachment List on a completed task', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(app.title).clickTasksButton();
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(taskName.completed).clickStartButton();
|
||||
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
|
||||
taskPage.completeTaskNoForm();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.COMPL_TASKS);
|
||||
taskPage.usingTasksListPage().selectTaskFromTasksList(taskName.completed);
|
||||
|
||||
attachmentListPage.checkAttachFileButtonIsNotDisplayed();
|
||||
attachmentListPage.viewFile(pngFile.name);
|
||||
|
||||
viewerPage.checkFileNameIsDisplayed(pngFile.name);
|
||||
viewerPage.clickCloseButton();
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.COMPL_TASKS);
|
||||
taskPage.usingTasksListPage().selectTaskFromTasksList(taskName.completed);
|
||||
|
||||
attachmentListPage.downloadFile(pngFile.name);
|
||||
|
||||
browser.driver.sleep(500);
|
||||
|
||||
expect(Util.fileExists(downloadedPngFile, 20)).toBe(true);
|
||||
|
||||
attachmentListPage.removeFile(pngFile.name);
|
||||
attachmentListPage.checkFileIsRemoved(pngFile.name);
|
||||
});
|
||||
|
||||
it('[C260225] Should be able to upload a file in the Attachment list on Task App', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(taskName.taskApp).clickStartButton();
|
||||
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
});
|
||||
|
||||
it('[C279884] Should be able to view the empty attachment list for tasks', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(taskName.emptyList).clickStartButton();
|
||||
|
||||
attachmentListPage.checkEmptyAttachmentList();
|
||||
attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
attachmentListPage.removeFile(pngFile.name);
|
||||
attachmentListPage.checkFileIsRemoved(pngFile.name);
|
||||
attachmentListPage.checkEmptyAttachmentList();
|
||||
});
|
||||
|
||||
});
|
206
e2e/process-services/task_list_pagination.e2e.ts
Normal file
206
e2e/process-services/task_list_pagination.e2e.ts
Normal file
@@ -0,0 +1,206 @@
|
||||
/*!
|
||||
* @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 TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import PaginationPage = require('../pages/adf/paginationPage');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
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('Task List Pagination', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let taskPage = new TasksPage();
|
||||
let paginationPage = new PaginationPage();
|
||||
|
||||
let processUserModel, processUserModelEmpty;
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let currentPage = 1, nrOfTasks = 20, totalPages;
|
||||
|
||||
let itemsPerPage = {
|
||||
five: '5',
|
||||
fiveValue: 5,
|
||||
ten: '10',
|
||||
tenValue: 10,
|
||||
fifteen: '15',
|
||||
fifteenValue: 15,
|
||||
twenty: '20',
|
||||
twentyValue: 20,
|
||||
default: '25'
|
||||
};
|
||||
|
||||
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);
|
||||
processUserModelEmpty = 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 < nrOfTasks; i++) {
|
||||
await apps.startProcess(this.alfrescoJsApi, resultApp);
|
||||
}
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('Pagination at first 20 started tasks', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.default);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(nrOfTasks);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
|
||||
});
|
||||
|
||||
it('Items per page set to 5', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.clickOnNextPage();
|
||||
currentPage++;
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.clickOnNextPage();
|
||||
currentPage++;
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.clickOnNextPage();
|
||||
currentPage++;
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.fiveValue);
|
||||
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
});
|
||||
|
||||
it('Items per page set to 10', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.clickOnNextPage();
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.twentyValue + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.tenValue);
|
||||
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
});
|
||||
|
||||
it('Items per page set to 15', () => {
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.fifteenValue);
|
||||
paginationPage.clickOnNextPage();
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.twentyValue + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.fiveValue);
|
||||
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
});
|
||||
|
||||
it('[C261006] Page number dropdown', () => {
|
||||
currentPage = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
paginationPage.clickOnPageDropdown();
|
||||
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
currentPage = 2;
|
||||
paginationPage.clickOnPageDropdownOption('2');
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
paginationPage.clickOnPageDropdown();
|
||||
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
currentPage = 1;
|
||||
paginationPage.clickOnPageDropdownOption('1');
|
||||
taskPage.usingTasksListPage().waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
|
||||
expect(taskPage.getAllDisplayedRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
it('Pagination in an empty task list', () => {
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModelEmpty);
|
||||
|
||||
processServicesPage.goToProcessServices().goToTaskApp();
|
||||
paginationPage.checkPaginationIsNotDisplayed();
|
||||
});
|
||||
|
||||
});
|
77
e2e/process-services/z-finish.e2e.ts
Normal file
77
e2e/process-services/z-finish.e2e.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import TestConfig = require('../test.config');
|
||||
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
|
||||
let buildNumber = process.env.TRAVIS_BUILD_NUMBER;
|
||||
let saveScreenshot = process.env.SAVE_SCREENSHOT;
|
||||
|
||||
describe('Save screenshot at the end', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
if (saveScreenshot === 'true') {
|
||||
if (!buildNumber) {
|
||||
buildNumber = Date.now();
|
||||
}
|
||||
|
||||
let alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
let files = fs.readdirSync(path.join(__dirname, '../../e2e-output/screenshots'));
|
||||
|
||||
if (files && files.length > 0) {
|
||||
alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
let folder = await alfrescoJsApi.nodes.addNode('-my-', {
|
||||
'name': 'process-services',
|
||||
'relativePath': 'Buiild-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'nodeType': 'cm:folder'
|
||||
}, {}, {});
|
||||
|
||||
for (const fileName of files) {
|
||||
|
||||
let pathFile = path.join(__dirname, '../../e2e-output/screenshots', fileName);
|
||||
let file = fs.createReadStream(pathFile);
|
||||
|
||||
await alfrescoJsApi.upload.uploadFile(
|
||||
file,
|
||||
'',
|
||||
folder.entry.id,
|
||||
null,
|
||||
{
|
||||
'name': file.name,
|
||||
'nodeType': 'cm:content'
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('screenshot need it', () => {
|
||||
expect(true).toEqual(true);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user