mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Remove demo shell test and make cloud a bit more stable (#6781)
* remove demo shell test and make cloud a bit more stable * fix lint * Update restore-content-directive.e2e.ts * Update restore-content-directive.e2e.ts * Update restore-content-directive.e2e.ts * try fix attach * Update .travis.yml * sleep... * remove about e2e demo shell.... * fix * lint fix * configure * refactor buuild * names and remove demo shell build from libs * fix new build approach * fix * fix * . * uncomment * . * . * fix * fix * . * fix * lock update * fix demo shell errors * use replay subject * fix some console log error * suffix problem * split process e2e * not need to check everywhere the pagination e2e * split content * fix * fix * fix * fix * reorg # Conflicts: # .travis.yml
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ModelsActions } from '../../actions/APS/models.actions';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Modify applications', () => {
|
||||
|
||||
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
|
||||
const appToBeDeleted = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
const replacingApp = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const processServicesPage = new ProcessServicesPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const modelActions = new ModelsActions(apiService);
|
||||
const apps = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
|
||||
let firstApp, appVersionToBeDeleted;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
const user = await usersActions.createUser();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
|
||||
firstApp = await applicationService.importPublishDeployApp(app.file_path);
|
||||
appVersionToBeDeleted = await applicationService.importPublishDeployApp(appToBeDeleted.file_path);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
await processServicesPage.checkApsContainer();
|
||||
});
|
||||
|
||||
it('[C260198] Should the app be displayed on dashboard when is deployed on APS', async () => {
|
||||
await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
|
||||
await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
|
||||
await expect(await 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 () => {
|
||||
await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
|
||||
await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
|
||||
await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
|
||||
|
||||
await apps.importNewVersionAppDefinitionPublishDeployApp(replacingApp.file_location, firstApp.id);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
|
||||
await processServicesPage.checkApsContainer();
|
||||
|
||||
await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.FAVORITE);
|
||||
await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
|
||||
await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
|
||||
});
|
||||
|
||||
it('[C260220] Should the app not be displayed on dashboard after it was deleted in APS', async () => {
|
||||
await processServicesPage.checkAppIsDisplayed(app.title);
|
||||
|
||||
await modelActions.deleteEntireModel(firstApp.id);
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
|
||||
await processServicesPage.checkApsContainer();
|
||||
await 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 () => {
|
||||
await processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
|
||||
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
|
||||
|
||||
await apps.importNewVersionAppDefinitionPublishDeployApp(replacingApp.file_location, appVersionToBeDeleted.id);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
|
||||
await processServicesPage.getBackgroundColor(appToBeDeleted.title);
|
||||
|
||||
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
|
||||
|
||||
await modelActions.deleteVersionModel(appVersionToBeDeleted.id);
|
||||
await modelActions.deleteVersionModel(appVersionToBeDeleted.id);
|
||||
await apps.publishDeployApp(appVersionToBeDeleted.id);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
|
||||
await processServicesPage.checkApsContainer();
|
||||
await processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
|
||||
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
|
||||
});
|
||||
|
||||
it('[C260207] Should the app be updated when is edited in APS', async () => {
|
||||
const newDescription = 'new description';
|
||||
|
||||
await expect(await processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
|
||||
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
|
||||
await expect(await processServicesPage.getDescription(appToBeDeleted.title)).toEqual(appToBeDeleted.description);
|
||||
|
||||
const appDefinition = {
|
||||
'appDefinition': {
|
||||
'id': appVersionToBeDeleted.id, 'name': appToBeDeleted.title,
|
||||
'description': newDescription, 'definition': {
|
||||
'models': [firstApp.definition.models[0]], 'theme': 'theme-4',
|
||||
'icon': 'glyphicon-user'
|
||||
}
|
||||
}, 'publish': true
|
||||
};
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.updateAppDefinition(appVersionToBeDeleted.id, appDefinition);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
|
||||
await expect(await processServicesPage.getDescription(appToBeDeleted.title)).toEqual(newDescription);
|
||||
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.RED);
|
||||
await expect(await processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,213 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
ContentNodeSelectorDialogPage,
|
||||
ExternalNodeSelectorDialogPage,
|
||||
IntegrationService,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions,
|
||||
Widget,
|
||||
SearchService,
|
||||
Logger
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Attach File - Content service', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const widget = new Widget();
|
||||
const taskPage = new TasksPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const externalNodeSelector = new ExternalNodeSelectorDialogPage();
|
||||
|
||||
const apiServiceExternal = new ApiService({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf_external_acs.host,
|
||||
authType: 'BASIC'
|
||||
});
|
||||
const usersActionsExternal = new UsersActions(apiServiceExternal);
|
||||
|
||||
const apiService = new ApiService({ provider: 'ALL' });
|
||||
const integrationService = new IntegrationService(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const searchService = new SearchService(apiService);
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const pdfFileOne = {
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path
|
||||
};
|
||||
|
||||
const pdfFileTwo = {
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_path
|
||||
};
|
||||
|
||||
const externalFile = 'Project Overview.ppt';
|
||||
const csIntegrations = ['adf dev', 'adf master'];
|
||||
let user: UserModel;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ALL');
|
||||
try {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiServiceExternal.loginWithProfile('admin');
|
||||
await usersActionsExternal.createUser(user);
|
||||
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[0],
|
||||
host: browser.params.testConfig.appConfig.ecmHost
|
||||
});
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[1],
|
||||
host: browser.params.testConfig.adf_external_acs.host
|
||||
});
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await searchService.isSearchable(pdfFileTwo.name);
|
||||
await searchService.isSearchable(externalFile);
|
||||
} catch (error) {
|
||||
console.error('Preconditions failed check if the external env is up and running');
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(user.username, user.password);
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C315268] Attach file - Able to upload more than one file (both ACS and local)', async () => {
|
||||
const name = 'Attach local and acs file';
|
||||
await taskPage.createTask({ name, formName: app.UPLOAD_FILE_FORM_CS.formName });
|
||||
|
||||
await widget.attachFileWidget().attachFile(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileOne.location);
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileOne.name);
|
||||
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
|
||||
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await searchService.isSearchable(pdfFileTwo.name);
|
||||
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
|
||||
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
});
|
||||
|
||||
it('[C246522] Attach file - Local file', async () => {
|
||||
const name = 'Attach local file';
|
||||
await taskPage.createTask({ name, formName: app.UPLOAD_FILE_FORM_CS.formName });
|
||||
|
||||
await widget.attachFileWidget().attachFile(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileOne.location);
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileOne.name);
|
||||
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
});
|
||||
|
||||
it('[C286516][C299040] Able to upload a file when user has more than two alfresco repositories', async () => {
|
||||
const name = 'Attach file - multiple repo';
|
||||
Logger.log('Step 1 - create task ' + name);
|
||||
await taskPage.createTask({ name, formName: app.UPLOAD_FILE_FORM_CS.formName });
|
||||
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
|
||||
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await searchService.isSearchable(pdfFileTwo.name);
|
||||
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(true);
|
||||
await expect(await widget.attachFileWidget().removeFileEnabled()).toBe(true);
|
||||
Logger.log('Step 2 - upload file ' + pdfFileTwo.name);
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[1]);
|
||||
|
||||
await externalNodeSelector.waitForLogInDialog();
|
||||
Logger.log(`Step 3 - login with user:${user.username}`);
|
||||
await externalNodeSelector.login(user.username, user.password);
|
||||
|
||||
await searchService.isSearchable(externalFile);
|
||||
Logger.log('Step 4 - search and click external file ' + externalFile);
|
||||
await externalNodeSelector.searchAndSelectResult(externalFile, externalFile);
|
||||
await externalNodeSelector.clickMoveCopyButton();
|
||||
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
Logger.log('Step 5 - download ');
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(true);
|
||||
await expect(await widget.attachFileWidget().removeFileEnabled()).toBe(true);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().removeFileEnabled()).toBe(true);
|
||||
Logger.log('Step 6 - download ');
|
||||
await taskPage.taskDetails().clickCompleteFormTask();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
Logger.log('Step 7 - go filter completed ');
|
||||
await taskPage.tasksListPage().selectRow(name);
|
||||
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(true);
|
||||
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,103 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
UserModel,
|
||||
UsersActions,
|
||||
ViewerPage,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
const app = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const widget = new Widget();
|
||||
const taskPage = new TasksPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
|
||||
let user: UserModel;
|
||||
const pdfFile = new FileModel({ 'name': browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name });
|
||||
const wordFile = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_path
|
||||
});
|
||||
const appFields = app.form_fields;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
await apiService.login(user.username, user.password);
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C274690] Should be able to open a file attached to a start form', async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
|
||||
const newTask = await taskPage.createNewTask();
|
||||
await newTask.addName('View file');
|
||||
await newTask.selectForm(app.formName);
|
||||
await newTask.clickStartButton();
|
||||
|
||||
await widget.attachFileWidget().attachFile(appFields.attachFile_id, pdfFile.location);
|
||||
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name);
|
||||
|
||||
await widget.attachFileWidget().viewFile(pdfFile.name);
|
||||
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
|
||||
await viewerPage.checkCloseButtonIsDisplayed();
|
||||
await viewerPage.clickCloseButton();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('View file');
|
||||
});
|
||||
|
||||
it('[C260418] Uploading single file form', async () => {
|
||||
const name = 'View Doc file';
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.createTask({ name, formName: app.formName });
|
||||
|
||||
await widget.attachFileWidget().attachFile(appFields.attachFile_id, wordFile.location);
|
||||
await widget.attachFileWidget().checkUploadIsNotVisible(appFields.attachFile_id);
|
||||
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, wordFile.name);
|
||||
await taskPage.taskDetails().clickCompleteFormTask();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(name);
|
||||
await widget.attachFileWidget().checkUploadIsNotVisible(appFields.attachFile_id);
|
||||
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, wordFile.name);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,122 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
ContentNodeSelectorDialogPage,
|
||||
IntegrationService,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
UserModel,
|
||||
UsersActions,
|
||||
UploadActions,
|
||||
Widget,
|
||||
SearchService
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Attach Folder', () => {
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP;
|
||||
|
||||
const apiService = new ApiService({ provider: 'ALL' });
|
||||
const searchService = new SearchService(apiService);
|
||||
const integrationService = new IntegrationService(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const widget = new Widget();
|
||||
const taskPage = new TasksPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
|
||||
let user: UserModel;
|
||||
const folderName = StringUtil.generateRandomString(5);
|
||||
|
||||
beforeAll(async () => {
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ALL');
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: 'adf dev',
|
||||
host: browser.params.testConfig.appConfig.ecmHost
|
||||
});
|
||||
await apiService.login(user.username, user.password);
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
await new UploadActions(apiService).createFolder(folderName, '-my-');
|
||||
await searchService.isSearchable(folderName);
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C246534] Attach folder - ACS', async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.createTask({ name: 'Attach folder', formName: app.UPLOAD_FOLDER_FORM_CS.formName });
|
||||
|
||||
const contentFileWidget = widget.attachFolderWidget();
|
||||
await contentFileWidget.clickWidget(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id);
|
||||
|
||||
await searchService.isSearchable(folderName);
|
||||
await contentNodeSelector.searchAndSelectResult(folderName, folderName);
|
||||
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
|
||||
|
||||
await searchService.isSearchable('Meeting Notes');
|
||||
await contentNodeSelector.searchAndSelectResult('Meeting Notes', 'Meeting Notes');
|
||||
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
|
||||
|
||||
await contentNodeSelector.clickCancelButton();
|
||||
await widget.attachFolderWidget().checkFolderIsNotAttached(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, folderName);
|
||||
|
||||
await contentFileWidget.clickWidget(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id);
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
|
||||
await contentNodeSelector.searchAndSelectResult(folderName, folderName);
|
||||
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
|
||||
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await widget.attachFolderWidget().checkFolderIsAttached(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, folderName);
|
||||
await widget.attachFolderWidget().removeFolder(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, folderName);
|
||||
await taskPage.formFields().checkWidgetIsVisible(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id);
|
||||
await widget.attachFolderWidget().checkFolderIsNotAttached(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, folderName);
|
||||
|
||||
await contentFileWidget.clickWidget(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id);
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
|
||||
await searchService.isSearchable(folderName);
|
||||
await contentNodeSelector.searchAndSelectResult(folderName, folderName);
|
||||
await contentNodeSelector.checkCancelButtonIsEnabled();
|
||||
await contentNodeSelector.checkCopyMoveButtonIsEnabled();
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await taskPage.taskDetails().clickCompleteFormTask();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,122 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, FormFields, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AttachFormPage } from './../pages/attach-form.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Attach Form Component', () => {
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const taskDetailsPage = new TaskDetailsPage();
|
||||
const attachFormPage = new AttachFormPage();
|
||||
const formFields = new FormFields();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
|
||||
const formTextField = app.form_fields.form_fieldId;
|
||||
let user, tenantId, appModel;
|
||||
|
||||
const testNames = {
|
||||
taskName: 'Test Task',
|
||||
formTitle: 'Select Form To Attach',
|
||||
formName: 'Simple form',
|
||||
widgetTitle: 'textfield',
|
||||
formFieldValue: 'Test value'
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
user = await usersActions.createUser();
|
||||
|
||||
tenantId = user.tenantId;
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
|
||||
appModel = await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: testNames.taskName }));
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appModel.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C280047] Should be able to view the attach-form component after creating a standalone task', async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(testNames.taskName);
|
||||
|
||||
await taskPage.taskDetails().checkStandaloneNoFormMessageIsDisplayed();
|
||||
await taskPage.taskDetails().checkAttachFormButtonIsDisplayed();
|
||||
await taskPage.taskDetails().checkCompleteTaskButtonIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C280048] Should be able to view the attach-form component after clicking cancel button', async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(testNames.taskName);
|
||||
|
||||
await taskPage.taskDetails().clickAttachFormButton();
|
||||
await attachFormPage.checkDefaultFormTitleIsDisplayed(testNames.formTitle);
|
||||
await attachFormPage.checkFormDropdownIsDisplayed();
|
||||
await attachFormPage.checkCancelButtonIsDisplayed();
|
||||
await attachFormPage.checkAttachFormButtonIsDisabled();
|
||||
await attachFormPage.selectAttachFormOption(testNames.formName);
|
||||
|
||||
await formFields.checkWidgetIsReadOnlyMode(testNames.widgetTitle);
|
||||
|
||||
await attachFormPage.clickCancelButton();
|
||||
await taskPage.taskDetails().checkAttachFormButtonIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C280017] Should be able to attach a form on a standalone task and complete', async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(testNames.taskName);
|
||||
|
||||
await taskDetailsPage.clickAttachFormButton();
|
||||
await attachFormPage.selectAttachFormOption(testNames.formName);
|
||||
await attachFormPage.clickAttachFormButton();
|
||||
|
||||
await formFields.setFieldValue(by.id, formTextField, testNames.formFieldValue);
|
||||
await formFields.completeForm();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(testNames.taskName);
|
||||
|
||||
await expect(await formFields.getFieldValue(formTextField)).toEqual(testNames.formFieldValue);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,197 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Checklist component', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const processServices = new ProcessServicesPage();
|
||||
const checklistDialog = new ChecklistDialog();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel;
|
||||
|
||||
const tasks = ['no checklist created task', 'checklist number task', 'remove running checklist', 'remove completed checklist', 'hierarchy'];
|
||||
const checklists = ['cancelCheckList', 'dialogChecklist', 'addFirstChecklist', 'addSecondChecklist'];
|
||||
const removeChecklist = ['removeFirstRunningChecklist', 'removeSecondRunningChecklist', 'removeFirstCompletedChecklist', 'removeSecondCompletedChecklist'];
|
||||
const hierarchyChecklist = ['checklistOne', 'checklistTwo', 'checklistOneChild', 'checklistTwoChild'];
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
|
||||
for (let i = 0; i < tasks.length; i++) {
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[i] }));
|
||||
}
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
});
|
||||
|
||||
it('[C279976] Should no checklist be created when no title is typed', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton()).clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistDialogIsNotDisplayed();
|
||||
await taskPage.checkNoChecklistIsDisplayed();
|
||||
await expect(await taskPage.getNumberOfChecklists()).toEqual('0');
|
||||
});
|
||||
|
||||
it('[C279975] Should no checklist be created when clicking on Cancel button on checklist dialog', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(checklists[0]);
|
||||
await checklistDialog.clickCancelButton();
|
||||
await taskPage.checkChecklistDialogIsNotDisplayed();
|
||||
await taskPage.checkNoChecklistIsDisplayed();
|
||||
await expect(await taskPage.getNumberOfChecklists()).toEqual('0');
|
||||
});
|
||||
|
||||
it('[C261025] Should Checklist dialog be displayed when clicking on add checklist button', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton());
|
||||
await taskPage.checkChecklistDialogIsDisplayed();
|
||||
await expect(await taskPage.usingCheckListDialog().getDialogTitle()).toEqual('New Check');
|
||||
await expect(await taskPage.usingCheckListDialog().getNameFieldPlaceholder()).toEqual('Name');
|
||||
await taskPage.usingCheckListDialog().checkAddChecklistButtonIsEnabled();
|
||||
await checklistDialog.checkCancelButtonIsEnabled();
|
||||
await taskPage.usingCheckListDialog().clickCancelButton();
|
||||
});
|
||||
|
||||
it('[C261026] Should Checklist number increase when a new checklist is added', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[1]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(checklists[2]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistIsDisplayed(checklists[2]);
|
||||
await expect(await taskPage.getNumberOfChecklists()).toEqual('1');
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(checklists[3]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistIsDisplayed(checklists[3]);
|
||||
await taskPage.checkChecklistIsDisplayed(checklists[2]);
|
||||
await expect(await taskPage.getNumberOfChecklists()).toEqual('2');
|
||||
});
|
||||
|
||||
it('[C279980] Should checklist be removed when clicking on remove button', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[2]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton());
|
||||
await taskPage.checkChecklistDialogIsDisplayed();
|
||||
await checklistDialog.addName(removeChecklist[0]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistIsDisplayed(removeChecklist[0]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(removeChecklist[1]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistIsDisplayed(removeChecklist[1]);
|
||||
|
||||
await taskPage.removeChecklists(removeChecklist[1]);
|
||||
await taskPage.checkChecklistIsDisplayed(removeChecklist[0]);
|
||||
await taskPage.checkChecklistIsNotDisplayed(removeChecklist[1]);
|
||||
});
|
||||
|
||||
it('[C261027] Should not be able to remove a completed Checklist when clicking on remove button', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[3]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(removeChecklist[2]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistIsDisplayed(removeChecklist[2]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(removeChecklist[3]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistIsDisplayed(removeChecklist[3]);
|
||||
|
||||
await taskPage.tasksListPage().selectRow(removeChecklist[3]);
|
||||
await taskPage.completeTaskNoForm();
|
||||
await taskPage.tasksListPage().checkContentIsNotDisplayed(removeChecklist[3]);
|
||||
|
||||
await taskPage.tasksListPage().selectRow(tasks[3]);
|
||||
await taskPage.checkChecklistIsDisplayed(removeChecklist[2]);
|
||||
await taskPage.checkChecklistIsDisplayed(removeChecklist[3]);
|
||||
await expect(await taskPage.getNumberOfChecklists()).toEqual('2');
|
||||
|
||||
await taskPage.checkChecklistsRemoveButtonIsNotDisplayed(removeChecklist[3]);
|
||||
});
|
||||
|
||||
it('[C261028] Should all checklists of a task be completed when the task is completed', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[4]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(hierarchyChecklist[0]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(hierarchyChecklist[1]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
|
||||
await taskPage.tasksListPage().selectRow(hierarchyChecklist[0]);
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(hierarchyChecklist[2]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistIsDisplayed(hierarchyChecklist[2]);
|
||||
|
||||
await taskPage.tasksListPage().selectRow(hierarchyChecklist[1]);
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(hierarchyChecklist[3]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
await taskPage.checkChecklistIsDisplayed(hierarchyChecklist[3]);
|
||||
|
||||
await taskPage.tasksListPage().selectRow(tasks[4]);
|
||||
await taskPage.completeTaskNoForm();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[1]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[2]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[3]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,162 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
DatePickerCalendarPage,
|
||||
DateUtil,
|
||||
LoginPage,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Dynamic Table', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const datePicker = new DatePickerCalendarPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const widget = new Widget();
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let user, tenantId, appId;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
tenantId = user.tenantId;
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
describe('Date Picker', () => {
|
||||
const app = browser.params.resources.Files.DYNAMIC_TABLE_APP;
|
||||
|
||||
const randomText = {
|
||||
date: '12/12/2012',
|
||||
wrongDate: 'HELLO WORLD',
|
||||
wrongDateTime: 'Test',
|
||||
dateTime: '15/07/2019 23:55',
|
||||
error: `Invalid 'columnDate' format.`,
|
||||
requiredError: `Field 'columnDate' is required.`
|
||||
};
|
||||
const currentDate = DateUtil.formatDate('DD-MM-YYYY');
|
||||
const rowPosition = 0;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appId = importedApp.id;
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.login(user.username, user.password);
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
});
|
||||
|
||||
it('[C286277] Should have a datepicker and a mask for DateTime field', async () => {
|
||||
await widget.dynamicTable().clickAddRow();
|
||||
await widget.dynamicTable().clickColumnDateTime();
|
||||
|
||||
await expect(await widget.dynamicTable().addRandomStringOnDateTime(randomText.wrongDateTime)).toBe('');
|
||||
});
|
||||
|
||||
it('[C286279] Should be able to save row with Date field', async () => {
|
||||
await widget.dynamicTable().clickAddRow();
|
||||
await widget.dynamicTable().addRandomStringOnDate(randomText.wrongDate);
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(randomText.error);
|
||||
|
||||
await widget.dynamicTable().clickDateWidget();
|
||||
await datePicker.selectTodayDate();
|
||||
await datePicker.checkDatePickerIsNotDisplayed();
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await widget.dynamicTable().getTableRow(rowPosition);
|
||||
await expect(await widget.dynamicTable().getTableCellText(rowPosition, 1)).toBe(currentDate);
|
||||
});
|
||||
|
||||
it('[C311456] Should be able to delete date that is not mandatory and save the Dynamic Table', async () => {
|
||||
await widget.dynamicTable().clickAddRow();
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(randomText.requiredError);
|
||||
|
||||
await widget.dynamicTable().clickDateWidget();
|
||||
await datePicker.selectTodayDate();
|
||||
await datePicker.checkDatePickerIsNotDisplayed();
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await widget.dynamicTable().getTableRow(rowPosition);
|
||||
await expect(await widget.dynamicTable().getTableCellText(rowPosition, 1)).toBe(currentDate);
|
||||
await expect(await widget.dynamicTable().getTableCellText(rowPosition, 2)).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Required Dropdown', () => {
|
||||
const app = browser.params.resources.Files.APP_DYNAMIC_TABLE_DROPDOWN;
|
||||
const dropdown = widget.dropdown();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appId = importedApp.id;
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.login(user.username, user.password);
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickProcessButton();
|
||||
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
});
|
||||
|
||||
it('[C286519] Should be able to save row with required dropdown column', async () => {
|
||||
const dropdownOption = 'Option 1';
|
||||
await widget.dynamicTable().clickAddRow();
|
||||
await dropdown.selectOption(dropdownOption);
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await widget.dynamicTable().checkItemIsPresent(dropdownOption);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,96 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, FormPage, LoginPage, UsersActions, Widget } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
describe('Form Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const formPage = new FormPage();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let tenantId, user;
|
||||
|
||||
const fields = {
|
||||
dateWidgetId: 'label7',
|
||||
numberWidgetId: 'label4',
|
||||
amountWidgetId: 'label11'
|
||||
};
|
||||
|
||||
const message = {
|
||||
test: 'Text Test',
|
||||
warningNumberAndAmount: 'Use a different number format',
|
||||
warningDate: 'D-M-YYYY',
|
||||
errorLogNumber: 'Error Label4 Use a different number format',
|
||||
errorLogDate: 'Error Label7 D-M-YYYY',
|
||||
errorLogAmount: 'Error Label11 Use a different number format',
|
||||
errorLabel: 'Error Label4'
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
user = await usersActions.createUser();
|
||||
|
||||
tenantId = user.tenantId;
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
|
||||
await navigationBarPage.navigateToProcessServicesFormPage();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C286505] Should be able to display errors under the Error Log section', async () => {
|
||||
await widget.numberWidget().getNumberFieldLabel(fields.numberWidgetId);
|
||||
await widget.numberWidget().setFieldValue(fields.numberWidgetId, message.test);
|
||||
await formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
|
||||
await formPage.checkErrorLogMessage(message.errorLogNumber);
|
||||
|
||||
await widget.dateWidget().checkLabelIsVisible(fields.dateWidgetId);
|
||||
await widget.dateWidget().setDateInput(fields.dateWidgetId, message.test);
|
||||
|
||||
await formPage.saveForm();
|
||||
await formPage.checkErrorMessageForWidgetIsDisplayed(message.warningDate);
|
||||
await formPage.checkErrorLogMessage(message.errorLogDate);
|
||||
|
||||
await widget.amountWidget().getAmountFieldLabel(fields.amountWidgetId);
|
||||
await widget.amountWidget().setFieldValue(fields.amountWidgetId, message.test);
|
||||
await formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
|
||||
await formPage.checkErrorLogMessage(message.errorLogAmount);
|
||||
|
||||
await widget.amountWidget().removeFromAmountWidget(fields.amountWidgetId);
|
||||
await formPage.checkErrorMessageIsNotDisplayed(message.errorLogAmount);
|
||||
|
||||
await widget.dateWidget().clearDateInput(fields.dateWidgetId);
|
||||
await widget.numberWidget().clearFieldValue(fields.numberWidgetId);
|
||||
await formPage.checkErrorMessageForWidgetIsNotDisplayed(message.warningDate);
|
||||
await formPage.checkErrorMessageIsNotDisplayed(message.errorLogDate);
|
||||
await formPage.checkErrorLogMessage(message.errorLabel);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,110 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
StartProcessPage,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
|
||||
describe('Form widgets - People ', () => {
|
||||
|
||||
const app = browser.params.resources.Files.APP_WITH_USER_WIDGET;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
const startProcess = new StartProcessPage();
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
const taskDetails = new TaskDetailsPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (await (await new NavigationBarPage().navigateToProcessServicesPage()).goToApp(appModel.name)).clickProcessButton();
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
|
||||
await widget.peopleWidget().checkPeopleFieldIsDisplayed();
|
||||
await widget.peopleWidget().fillPeopleField(processUserModel.firstName);
|
||||
await widget.peopleWidget().selectUserFromDropdown();
|
||||
});
|
||||
|
||||
it('[C286577] Should be able to start a process with people widget', async () => {
|
||||
await startProcess.clickFormStartProcessButton();
|
||||
await processDetailsPage.activeTask.click();
|
||||
|
||||
const taskId = await taskDetails.getId();
|
||||
const taskForm: any = await apiService.getInstance().activiti.taskApi.getTaskForm(taskId);
|
||||
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
|
||||
await expect(userEmail).toEqual(processUserModel.email);
|
||||
});
|
||||
|
||||
it('[C286576] Should be able to see user in completed task', async () => {
|
||||
await startProcess.enterProcessName(app.processName);
|
||||
await startProcess.clickFormStartProcessButton();
|
||||
|
||||
await processDetailsPage.activeTask.click();
|
||||
await taskDetails.checkCompleteFormButtonIsDisplayed();
|
||||
await taskDetails.clickCompleteFormTask();
|
||||
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await processFiltersPage.clickCompletedFilterButton();
|
||||
await processFiltersPage.selectFromProcessList(app.processName);
|
||||
|
||||
await processDetailsPage.completedTask.click();
|
||||
|
||||
const taskId = await taskDetails.getId();
|
||||
const taskForm: any = await apiService.getInstance().activiti.taskApi.getTaskForm(taskId);
|
||||
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
|
||||
await expect(userEmail).toEqual(processUserModel.email);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,244 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import FormDefinitionModel = require('../../models/APS/FormDefinitionModel');
|
||||
|
||||
const formInstance = new FormDefinitionModel();
|
||||
|
||||
describe('Form widgets', () => {
|
||||
|
||||
const taskPage = new TasksPage();
|
||||
const loginPage = new LoginPage();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
const newTask = 'First task';
|
||||
let processUserModel;
|
||||
let appModelWidget;
|
||||
|
||||
describe('Form widgets', () => {
|
||||
|
||||
const appWidget = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
|
||||
const appFields = appWidget.form_fields;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
appModelWidget = await applicationsService.importPublishDeployApp(appWidget.file_path);
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToApp(appModelWidget.name);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
const task = await taskPage.createNewTask();
|
||||
await task.addName(newTask);
|
||||
await task.addDescription('Description');
|
||||
await task.selectForm(appWidget.formName);
|
||||
await task.clickStartButton();
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(newTask);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const response = await taskPage.taskDetails().getId();
|
||||
|
||||
const formDefinition = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(response);
|
||||
formInstance.setFields(formDefinition.fields);
|
||||
formInstance.setAllWidgets(formDefinition.fields);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await new NavigationBarPage().clickLogoutButton();
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await apiService.getInstance().logout();
|
||||
});
|
||||
|
||||
it('[C272778] Should display text and multi-line in form', async () => {
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.text_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).name);
|
||||
await expect(await taskPage.formFields().getFieldValue(appFields.text_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).value || '');
|
||||
|
||||
await expect(await widget.multilineTextWidget().getFieldValue(appFields.multiline_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).value || '');
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.multiline_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).name);
|
||||
});
|
||||
|
||||
it('[C272779] Should display number and amount in form', async () => {
|
||||
await expect(await taskPage.formFields().getFieldValue(appFields.number_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).value || '');
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.number_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).name);
|
||||
|
||||
await expect(await taskPage.formFields().getFieldValue(appFields.amount_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).value || '');
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.amount_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).name);
|
||||
});
|
||||
|
||||
it('[C272780] Should display attach file and attach folder in form', async () => {
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.attachFolder_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.attachFolder_id).name);
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.attachFile_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.attachFile_id).name);
|
||||
});
|
||||
|
||||
it('[C272781] Should display date and date & time in form', async () => {
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.date_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.date_id).name);
|
||||
await expect(await taskPage.formFields().getFieldValue(appFields.date_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.date_id).value || '');
|
||||
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.dateTime_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dateTime_id).name);
|
||||
await expect(await taskPage.formFields().getFieldValue(appFields.dateTime_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.dateTime_id).value || '');
|
||||
});
|
||||
|
||||
it('[C272782] Should display people and group in form', async () => {
|
||||
await expect(await taskPage.formFields().getFieldValue(appFields.people_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).value || '');
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.people_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).name);
|
||||
|
||||
await expect(await taskPage.formFields().getFieldValue(appFields.group_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).value || '');
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.group_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).name);
|
||||
});
|
||||
|
||||
it('[C272783] Should display displayText and displayValue in form', async () => {
|
||||
await expect(await widget.displayTextWidget().getFieldLabel(appFields.displayText_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displayText_id).value);
|
||||
await expect(await widget.displayValueWidget().getFieldLabel(appFields.displayValue_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displayValue_id).value || 'Display value' || '');
|
||||
await expect(await widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displayValue_id).value || '');
|
||||
});
|
||||
|
||||
it('[C272784] Should display typeahead and header in form', async () => {
|
||||
await expect(await widget.headerWidget().getFieldLabel(appFields.header_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.header_id).name);
|
||||
await expect(await taskPage.formFields().getFieldValue(appFields.typeAhead_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).value || '');
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.typeAhead_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).name);
|
||||
});
|
||||
|
||||
it('[C272785] Should display checkbox and radio button in form', async () => {
|
||||
const radioOption = 1;
|
||||
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.checkbox_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.checkbox_id).name);
|
||||
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.radioButtons_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).name);
|
||||
await expect(await widget.radioWidget().getSpecificOptionLabel(appFields.radioButtons_id, radioOption))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).options[radioOption - 1].name);
|
||||
});
|
||||
|
||||
it('[C268149] Should display hyperlink, dropdown and dynamic table in form', async () => {
|
||||
await expect(await widget.hyperlink().getFieldText(appFields.hyperlink_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).hyperlinkUrl || '');
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.hyperlink_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).name);
|
||||
|
||||
await expect(await taskPage.formFields().getFieldLabel(appFields.dropdown_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).name);
|
||||
await expect(widget.dropdown().getSelectedOptionText(appFields.dropdown_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).value);
|
||||
|
||||
await expect(await widget.dynamicTable().getFieldLabel(appFields.dynamicTable_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).name);
|
||||
await expect(await widget.dynamicTable().getColumnName(appFields.dynamicTable_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).columnDefinitions[0].name);
|
||||
});
|
||||
});
|
||||
|
||||
describe('with fields involving other people', () => {
|
||||
const app = browser.params.resources.Files.FORM_ADF;
|
||||
let process;
|
||||
const appFields = app.form_fields;
|
||||
let appModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
process = await processUtil.startProcessOfApp(appModel.name);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToApp(appModel.name);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260405] Value fields configured with process variables', async () => {
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
await taskPage.formFields().setValueInInputById('label', 'value 1');
|
||||
await taskPage.formFields().completeForm();
|
||||
/* cspell:disable-next-line */
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
|
||||
await expect(await widget.displayTextWidget().getFieldText(appFields.displayText_id))
|
||||
.toContain('value 1');
|
||||
await expect(await widget.textWidget().getFieldValue(appFields.text_id))
|
||||
.toEqual('value 1');
|
||||
await expect(await widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
|
||||
.toEqual('value 1');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,230 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('People component', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const taskPage = new TasksPage();
|
||||
const processServices = new ProcessServicesPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel, assigneeUserModel, secondAssigneeUserModel;
|
||||
const peopleTitle = 'People this task is shared with ';
|
||||
|
||||
const tasks = ['no people involved task', 'remove people task', 'can not complete task', 'multiple users', 'completed filter'];
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
assigneeUserModel = await usersActions.createUser();
|
||||
secondAssigneeUserModel = await usersActions.createUser(new UserModel({ tenantId: assigneeUserModel.tenantId }));
|
||||
processUserModel = await usersActions.createUser(new UserModel({ tenantId: assigneeUserModel.tenantId }));
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[0] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[1] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[2] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[3] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[4] }));
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C279989] Should no people be involved when no user is typed', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
await taskPage.taskDetails().clickInvolvePeopleButton();
|
||||
await taskPage.taskDetails().clickAddInvolvedUserButton();
|
||||
await taskPage.taskDetails().checkNoPeopleIsInvolved();
|
||||
});
|
||||
|
||||
it('[C279990] Should no people be involved when clicking on Cancel button', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
|
||||
await taskDetails.clickInvolvePeopleButton();
|
||||
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
|
||||
await taskPage.taskDetails().clickCancelInvolvePeopleButton();
|
||||
await taskPage.taskDetails().checkNoPeopleIsInvolved();
|
||||
});
|
||||
|
||||
it('[C261029] Should People dialog be displayed when clicking on add people button', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
|
||||
await taskDetails.clickInvolvePeopleButton();
|
||||
await expect(await taskPage.taskDetails().getInvolvePeopleHeader()).toEqual('Add people and groups');
|
||||
await expect(await taskPage.taskDetails().getInvolvePeoplePlaceholder()).toEqual('Search user');
|
||||
|
||||
await taskDetails.checkAddPeopleButtonIsEnabled();
|
||||
await taskDetails.checkCancelButtonIsEnabled();
|
||||
await taskDetails.clickCancelInvolvePeopleButton();
|
||||
});
|
||||
|
||||
it('[C279991] Should not be able to involve a user when is the creator of the task', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
await taskDetails.clickInvolvePeopleButton();
|
||||
await taskDetails.typeUser(processUserModel.firstName + ' ' + processUserModel.lastName);
|
||||
await taskDetails.noUserIsDisplayedInSearchInvolvePeople(processUserModel.firstName + ' ' + processUserModel.lastName);
|
||||
await taskPage.taskDetails().clickAddInvolvedUserButton();
|
||||
await taskPage.taskDetails().checkNoPeopleIsInvolved();
|
||||
});
|
||||
|
||||
it('[C261030] Should involved user be removed when clicking on remove button', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
await taskDetails.clickInvolvePeopleButton();
|
||||
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
|
||||
await taskPage.taskDetails().clickAddInvolvedUserButton();
|
||||
|
||||
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual(assigneeUserModel.email);
|
||||
await taskPage.taskDetails().removeInvolvedUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskPage.taskDetails().checkNoPeopleIsInvolved();
|
||||
});
|
||||
|
||||
it('[C280013] Should not be able to complete a task by a involved user', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[1]);
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
await taskDetails.clickInvolvePeopleButton();
|
||||
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskPage.taskDetails().clickAddInvolvedUserButton();
|
||||
|
||||
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual(assigneeUserModel.email);
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(assigneeUserModel.username, assigneeUserModel.password);
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[1]);
|
||||
|
||||
await taskPage.completeTaskNoFormNotDisplayed();
|
||||
});
|
||||
|
||||
it('[C261031] Should be able to involve multiple users to a task', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[2]);
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
await taskPage.taskDetails().clickInvolvePeopleButton();
|
||||
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskPage.taskDetails().clickAddInvolvedUserButton();
|
||||
|
||||
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual(assigneeUserModel.email);
|
||||
await expect(await taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(1)');
|
||||
|
||||
const taskDetails2 = await taskPage.taskDetails();
|
||||
await taskDetails2.clickInvolvePeopleButton();
|
||||
await taskDetails2.typeUser(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName);
|
||||
await taskDetails2.selectUserToInvolve(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName);
|
||||
await taskDetails2.checkUserIsSelected(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName);
|
||||
|
||||
await taskPage.taskDetails().clickAddInvolvedUserButton();
|
||||
|
||||
await expect(await taskPage.taskDetails().getInvolvedUserEmail(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName))
|
||||
.toEqual(secondAssigneeUserModel.email);
|
||||
await expect(await taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(2)');
|
||||
});
|
||||
|
||||
it('[C280014] Should involved user see the task in completed filters when the task is completed', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[3]);
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
await taskDetails.clickInvolvePeopleButton();
|
||||
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
|
||||
|
||||
await taskPage.taskDetails().clickAddInvolvedUserButton();
|
||||
|
||||
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual(assigneeUserModel.email);
|
||||
|
||||
await taskPage.completeTaskNoForm();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(tasks[3]);
|
||||
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual(assigneeUserModel.email);
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(assigneeUserModel.username, assigneeUserModel.password);
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[3]);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsNotDisplayed(tasks[3]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,101 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
StartProcessPage,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { ProcessListPage } from './../pages/process-list.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Stencil', () => {
|
||||
|
||||
const app = browser.params.resources.Files.STENCIL_PROCESS;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const startProcessPage = new StartProcessPage();
|
||||
const processListDemoPage = new ProcessListDemoPage();
|
||||
const processListPage = new ProcessListPage();
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let user: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
await applicationsService.importPublishDeployApp(app.file_path);
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
});
|
||||
|
||||
it('[C245648] Can start an app with custom stencil included', async () => {
|
||||
const name = 'test stencil process';
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
|
||||
await startProcessPage.startProcess(name, app.processName);
|
||||
await processListDemoPage.checkProcessIsDisplayed(name);
|
||||
await processFiltersPage.selectFromProcessList(name);
|
||||
|
||||
await processDetailsPage.activeTask.click();
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
await taskPage.taskDetails().clickCompleteTask();
|
||||
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await processFiltersPage.checkNoContentMessage();
|
||||
|
||||
await processFiltersPage.clickCompletedFilterButton();
|
||||
await processListDemoPage.checkProcessIsDisplayed(name);
|
||||
|
||||
await processServiceTabBarPage.clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(app.taskName);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user