mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
@@ -17,10 +17,10 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ModelsActions, createApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AppDefinitionsApi } from '@alfresco/js-api';
|
||||
import { AppDefinitionRepresentation, AppDefinitionsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Modify applications', () => {
|
||||
|
||||
@@ -39,7 +39,8 @@ describe('Modify applications', () => {
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const appsApi = new AppDefinitionsApi(apiService.getInstance());
|
||||
|
||||
let firstApp; let appVersionToBeDeleted;
|
||||
let firstApp: AppDefinitionRepresentation;
|
||||
let appVersionToBeDeleted: AppDefinitionRepresentation;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -131,7 +132,7 @@ describe('Modify applications', () => {
|
||||
name: appToBeDeleted.title,
|
||||
description: newDescription,
|
||||
definition: {
|
||||
models: [firstApp.definition.models[0]],
|
||||
models: [firstApp['definition'].models[0]],
|
||||
theme: 'theme-4',
|
||||
icon: 'glyphicon-user'
|
||||
}
|
||||
|
@@ -15,16 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService, ApplicationsUtil, LoginPage, TaskUtil, 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 { createApiService, ApplicationsUtil, LoginPage, TaskUtil, UsersActions, UserModel } 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 CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Checklist component', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -38,11 +37,16 @@ describe('Checklist component', () => {
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
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 removeChecklist = [
|
||||
'removeFirstRunningChecklist',
|
||||
'removeSecondRunningChecklist',
|
||||
'removeFirstCompletedChecklist',
|
||||
'removeSecondCompletedChecklist'
|
||||
];
|
||||
const hierarchyChecklist = ['checklistOne', 'checklistTwo', 'checklistOneChild', 'checklistTwoChild'];
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -54,19 +58,18 @@ describe('Checklist component', () => {
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
for (let i = 0; i < tasks.length; i++) {
|
||||
await taskUtil.createStandaloneTask(tasks[i]);
|
||||
for (const item of tasks) {
|
||||
await taskUtil.createStandaloneTask(item);
|
||||
}
|
||||
|
||||
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]);
|
||||
@@ -93,7 +96,7 @@ describe('Checklist component', () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[0]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton());
|
||||
await await taskPage.clickOnAddChecklistButton();
|
||||
await taskPage.checkChecklistDialogIsDisplayed();
|
||||
await expect(await taskPage.usingCheckListDialog().getDialogTitle()).toEqual('New Check');
|
||||
await expect(await taskPage.usingCheckListDialog().getNameFieldPlaceholder()).toEqual('Name');
|
||||
@@ -122,7 +125,7 @@ describe('Checklist component', () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
|
||||
await taskPage.tasksListPage().selectRow(tasks[2]);
|
||||
|
||||
await (await taskPage.clickOnAddChecklistButton());
|
||||
await await taskPage.clickOnAddChecklistButton();
|
||||
await taskPage.checkChecklistDialogIsDisplayed();
|
||||
await checklistDialog.addName(removeChecklist[0]);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
|
@@ -15,21 +15,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
ApplicationsUtil,
|
||||
DatePickerCalendarPage,
|
||||
DateUtil,
|
||||
LoginPage, ModelsActions,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
UsersActions,
|
||||
Widget
|
||||
Widget,
|
||||
UserModel
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
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();
|
||||
@@ -41,18 +43,20 @@ describe('Dynamic Table', () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
let user; let tenantId; let appId;
|
||||
let user: UserModel;
|
||||
let tenantId: number;
|
||||
let appId: number;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
tenantId = user.tenantId;
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Date Picker', () => {
|
||||
const app = browser.params.resources.Files.DYNAMIC_TABLE_APP;
|
||||
|
@@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService, FormPage, LoginPage, UsersActions, Widget } from '@alfresco/adf-testing';
|
||||
import { createApiService, FormPage, LoginPage, UserModel, 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();
|
||||
@@ -28,7 +27,8 @@ describe('Form Component', () => {
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let tenantId; let user;
|
||||
let tenantId: number;
|
||||
let user: UserModel;
|
||||
|
||||
const fields = {
|
||||
dateWidgetId: 'label7',
|
||||
@@ -92,5 +92,5 @@ describe('Form Component', () => {
|
||||
await formPage.checkErrorMessageForWidgetIsNotDisplayed(message.warningDate);
|
||||
await formPage.checkErrorMessageIsNotDisplayed(message.errorLogDate);
|
||||
await formPage.checkErrorLogMessage(message.errorLabel);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -1,45 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { TogglePage } from '@alfresco/adf-testing';
|
||||
import { $ } from 'protractor';
|
||||
|
||||
export class AppSettingsTogglesPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
|
||||
showDetailsHeaderToggle = $('#adf-show-header');
|
||||
showTaskFilterIconsToggle = $('#adf-show-task-filter-icon');
|
||||
showProcessFilterIconsToggle = $('#adf-show-process-filter-icon');
|
||||
|
||||
async enableShowHeader(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.showDetailsHeaderToggle);
|
||||
}
|
||||
|
||||
async disableShowHeader(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.showDetailsHeaderToggle);
|
||||
}
|
||||
|
||||
async enableTaskFiltersIcon(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.showTaskFilterIconsToggle);
|
||||
}
|
||||
|
||||
async enableProcessFiltersIcon(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.showProcessFilterIconsToggle);
|
||||
}
|
||||
|
||||
}
|
@@ -26,7 +26,7 @@ export class ProcessDetailsPage {
|
||||
propertiesList = TestElement.byCss('.adf-property-list');
|
||||
showDiagramButton = TestElement.byId('show-diagram-button');
|
||||
diagramCanvas = TestElement.byCss('svg[xmlns="http://www.w3.org/2000/svg"]');
|
||||
backButton = TestElement.byCss('app-show-diagram button.mat-mini-fab.mat-accent');
|
||||
backButton = TestElement.byCss('#btn-diagram-back');
|
||||
commentInput = TestElement.byId('comment-input');
|
||||
auditLogButton = TestElement.byCss('button[adf-process-audit]');
|
||||
cancelProcessButton = TestElement.byCss('div[data-automation-id="header-status"] > button');
|
||||
|
@@ -19,16 +19,13 @@ import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcess
|
||||
import { $, $$ } from 'protractor';
|
||||
|
||||
export class ProcessFiltersPage {
|
||||
|
||||
dataTable = new DataTableComponentPage();
|
||||
createProcessButton = $('.app-processes-menu button[data-automation-id="create-button"] > span');
|
||||
newProcessButton = $('div > button[data-automation-id="btn-start-process"]');
|
||||
processesPage = $('#app-processes-menu');
|
||||
accordionMenu = $('.app-processes-menu mat-accordion');
|
||||
buttonWindow = $('div > button[data-automation-id="btn-start-process"] > div');
|
||||
noContentMessage = $$('.adf-empty-content__title').first();
|
||||
rows = $$('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]');
|
||||
processIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
|
||||
startProcessEl = $('adf-start-process .adf-start-process');
|
||||
|
||||
getButtonFilterLocatorByName = (name: string) => $(`button[data-automation-id='${name}_filter']`);
|
||||
@@ -57,7 +54,6 @@ export class ProcessFiltersPage {
|
||||
|
||||
async clickCreateProcessButton(): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.accordionMenu);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.processesPage);
|
||||
await BrowserActions.click(this.createProcessButton);
|
||||
}
|
||||
@@ -81,11 +77,6 @@ export class ProcessFiltersPage {
|
||||
await BrowserActions.click(processName);
|
||||
}
|
||||
|
||||
async checkFilterIsHighlighted(filterName: string): Promise<void> {
|
||||
const processNameHighlighted = $(`adf-process-instance-filters .adf-active button[data-automation-id='${filterName}_filter']`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(processNameHighlighted);
|
||||
}
|
||||
|
||||
async numberOfProcessRows(): Promise<number> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(await this.rows.first());
|
||||
return this.rows.count();
|
||||
@@ -95,53 +86,13 @@ export class ProcessFiltersPage {
|
||||
await this.dataTable.waitForTableBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the list by name column.
|
||||
*
|
||||
* @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant
|
||||
*/
|
||||
async sortByName(sortOrder: string) {
|
||||
await this.dataTable.sortByColumn(sortOrder, 'name');
|
||||
}
|
||||
|
||||
async getAllRowsNameColumn() {
|
||||
return this.dataTable.getAllRowsColumnValues('Name');
|
||||
}
|
||||
|
||||
async checkFilterIsDisplayed(name: string): Promise<void> {
|
||||
const filterName = await this.getButtonFilterLocatorByName(name);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
}
|
||||
|
||||
async checkFilterHasNoIcon(name: string): Promise<void> {
|
||||
const filterName = await this.getButtonFilterLocatorByName(name);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(filterName.$(this.processIcon));
|
||||
}
|
||||
|
||||
async getFilterIcon(name: string): Promise<string> {
|
||||
const filterName = await this.getButtonFilterLocatorByName(name);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
const icon = filterName.$(this.processIcon);
|
||||
return BrowserActions.getText(icon);
|
||||
}
|
||||
|
||||
async checkFilterIsNotDisplayed(name: string): Promise<void> {
|
||||
const filterName = await this.getButtonFilterLocatorByName(name);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(filterName);
|
||||
}
|
||||
|
||||
async checkProcessesSortedByNameAsc(): Promise<void> {
|
||||
const list = await this.getAllRowsNameColumn();
|
||||
for (let i = 1; i < list.length; i++) {
|
||||
await expect(JSON.stringify(list[i]) > JSON.stringify(list[i - 1])).toEqual(true);
|
||||
}
|
||||
}
|
||||
|
||||
async checkProcessesSortedByNameDesc(): Promise<void> {
|
||||
const list = await this.getAllRowsNameColumn();
|
||||
for (let i = 1; i < list.length; i++) {
|
||||
await expect(JSON.stringify(list[i]) < JSON.stringify(list[i - 1])).toEqual(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ export class ProcessListDemoPage {
|
||||
await this.stateDropdown.selectDropdownOption(stateOption);
|
||||
}
|
||||
|
||||
async addAppId(appId: string): Promise<void> {
|
||||
async addAppId(appId: string | number): Promise<void> {
|
||||
await BrowserActions.click(this.appIdInput);
|
||||
await this.appIdInput.sendKeys(protractor.Key.ENTER);
|
||||
await this.appIdInput.clear();
|
||||
|
@@ -23,7 +23,6 @@ export class ProcessServiceTabBarPage {
|
||||
tasksButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first();
|
||||
processButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first();
|
||||
reportsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first();
|
||||
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
|
||||
reportsButtonSelected = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first();
|
||||
|
||||
async clickTasksButton(): Promise<void> {
|
||||
@@ -36,11 +35,6 @@ export class ProcessServiceTabBarPage {
|
||||
await browser.sleep(500);
|
||||
}
|
||||
|
||||
async clickSettingsButton(): Promise<void> {
|
||||
await BrowserActions.click(this.settingsButton);
|
||||
await browser.sleep(500);
|
||||
}
|
||||
|
||||
async clickReportsButton(): Promise<void> {
|
||||
await BrowserActions.click(this.reportsButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.reportsButtonSelected);
|
||||
|
@@ -47,7 +47,7 @@ export class ProcessServicesPage {
|
||||
return new ProcessServiceTabBarPage();
|
||||
}
|
||||
|
||||
async goToAppByAppId(appId: string): Promise<void> {
|
||||
async goToAppByAppId(appId: string | number): Promise<void> {
|
||||
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${appId}/tasks/`;
|
||||
await BrowserActions.getUrl(urlToNavigateTo);
|
||||
const taskPage = new TasksPage();
|
||||
|
@@ -17,14 +17,9 @@
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, Key, $, $$ } from 'protractor';
|
||||
import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page';
|
||||
|
||||
export class TaskDetailsPage {
|
||||
|
||||
appSettingsTogglesClass = new AppSettingsTogglesPage();
|
||||
|
||||
formContent = $('adf-form');
|
||||
|
||||
formNameField = $('[data-automation-id="card-textitem-value-formName"]');
|
||||
formNameButton = $('[data-automation-id="card-textitem-toggle-formName"]');
|
||||
assigneeField = $('[data-automation-id="card-textitem-value-assignee"]');
|
||||
@@ -45,7 +40,6 @@ export class TaskDetailsPage {
|
||||
involvePeopleButton = $('div[class*="add-people"]');
|
||||
addPeopleField = $('input[data-automation-id="adf-people-search-input"]');
|
||||
addInvolvedUserButton = $('button[id="add-people"]');
|
||||
taskDetailsInfoDrawer = element(by.tagName('adf-info-drawer'));
|
||||
taskDetailsSection = $('div[data-automation-id="app-tasks-details"]');
|
||||
taskDetailsEmptySection = $('div[data-automation-id="adf-tasks-details--empty"]');
|
||||
completeTask = $('button[id="adf-no-form-complete-button"]');
|
||||
@@ -304,18 +298,6 @@ export class TaskDetailsPage {
|
||||
await BrowserActions.click(this.auditLogButton);
|
||||
}
|
||||
|
||||
appSettingsToggles(): AppSettingsTogglesPage {
|
||||
return this.appSettingsTogglesClass;
|
||||
}
|
||||
|
||||
async taskInfoDrawerIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.taskDetailsInfoDrawer);
|
||||
}
|
||||
|
||||
async taskInfoDrawerIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.taskDetailsInfoDrawer);
|
||||
}
|
||||
|
||||
async checkNoPeopleIsInvolved(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noPeopleInvolved);
|
||||
}
|
||||
|
@@ -19,9 +19,7 @@ import { ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class TaskFiltersPage {
|
||||
|
||||
filter: ElementFinder;
|
||||
taskIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
|
||||
|
||||
constructor(filter: ElementFinder) {
|
||||
this.filter = filter;
|
||||
@@ -31,17 +29,6 @@ export class TaskFiltersPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
}
|
||||
|
||||
async getTaskFilterIcon(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const icon = this.filter.$(this.taskIcon);
|
||||
return BrowserActions.getText(icon);
|
||||
}
|
||||
|
||||
async checkTaskFilterHasNoIcon(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.taskIcon));
|
||||
}
|
||||
|
||||
async clickTaskFilter(): Promise<void> {
|
||||
return BrowserActions.click(this.filter);
|
||||
}
|
||||
|
@@ -16,20 +16,13 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from '../pages/process-filters.page';
|
||||
import { CommentsPage } from '../../core/pages/comments.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ActivitiCommentsApi, TasksApi } from '@alfresco/js-api';
|
||||
import { ActivitiCommentsApi, ResultListDataRepresentationCommentRepresentation, TasksApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Comment component for Processes', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -44,7 +37,10 @@ describe('Comment component for Processes', () => {
|
||||
const commentsApi = new ActivitiCommentsApi(apiService.getInstance());
|
||||
const taskApi = new TasksApi(apiService.getInstance());
|
||||
|
||||
let user; let appId; let processInstanceId; let addedComment;
|
||||
let user: UserModel;
|
||||
let appId: number;
|
||||
let processInstanceId: string;
|
||||
let addedComment: ResultListDataRepresentationCommentRepresentation;
|
||||
const processName = 'Comment APS';
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -82,7 +78,9 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
await commentsPage.getTotalNumberOfComments('Comments (' + addedComment.total + ')');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(
|
||||
addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName
|
||||
);
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
|
||||
@@ -120,7 +118,9 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
await commentsPage.getTotalNumberOfComments('Comments (' + addedTaskComment.total + ')');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(
|
||||
addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName
|
||||
);
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
});
|
||||
|
@@ -17,20 +17,18 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { FiltersPage } from './../pages/filters.page';
|
||||
import { ProcessInstancesApi, UserFiltersApi } from '@alfresco/js-api';
|
||||
import { ProcessFiltersPage } from '../pages/process-filters.page';
|
||||
import { FiltersPage } from '../pages/filters.page';
|
||||
import {
|
||||
AppDefinitionRepresentation,
|
||||
ProcessInstancesApi,
|
||||
ResultListDataRepresentationProcessInstanceRepresentation,
|
||||
UserFiltersApi
|
||||
} from '@alfresco/js-api';
|
||||
|
||||
describe('Sorting for process filters', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -44,8 +42,11 @@ describe('Sorting for process filters', () => {
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
const processInstancesApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
|
||||
let tenantId, appId, user, processesQuery;
|
||||
let importedApp;
|
||||
let tenantId: number;
|
||||
let appId: number;
|
||||
let user: UserModel;
|
||||
let processesQuery: ResultListDataRepresentationProcessInstanceRepresentation;
|
||||
let importedApp: AppDefinitionRepresentation;
|
||||
|
||||
const processFilter = {
|
||||
running_old_first: 'Running - Oldest first',
|
||||
@@ -79,16 +80,17 @@ describe('Sorting for process filters', () => {
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
} catch (e) {
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', async () => {
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.running_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'running' }
|
||||
appId: null,
|
||||
name: processFilter.running_old_first,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'created-asc', name: '', state: 'running' }
|
||||
});
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
const firstProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
@@ -100,7 +102,10 @@ describe('Sorting for process filters', () => {
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);
|
||||
await filtersPage.goToFilter(processFilter.running_old_first);
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc'
|
||||
processDefinitionId: null,
|
||||
appDefinitionId: null,
|
||||
state: 'running',
|
||||
sort: 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
|
||||
@@ -109,8 +114,10 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
it('[C260477] Should be able to create a filter on APS for completed processes - Oldest first and check on ADF', async () => {
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'completed' }
|
||||
appId: null,
|
||||
name: processFilter.completed_old_first,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'created-asc', name: '', state: 'completed' }
|
||||
});
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
@@ -129,7 +136,10 @@ describe('Sorting for process filters', () => {
|
||||
await filtersPage.goToFilter(processFilter.completed_old_first);
|
||||
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-asc'
|
||||
processDefinitionId: null,
|
||||
appDefinitionId: null,
|
||||
state: 'completed',
|
||||
sort: 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
|
||||
@@ -138,8 +148,10 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
it('[C260478] Should be able to create a filter on APS for all processes - Oldest first and check on ADF', async () => {
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.all_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'all' }
|
||||
appId: null,
|
||||
name: processFilter.all_old_first,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'created-asc', name: '', state: 'all' }
|
||||
});
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
@@ -162,7 +174,10 @@ describe('Sorting for process filters', () => {
|
||||
await filtersPage.goToFilter(processFilter.all_old_first);
|
||||
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-asc'
|
||||
processDefinitionId: null,
|
||||
appDefinitionId: null,
|
||||
state: 'all',
|
||||
sort: 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
|
||||
@@ -174,8 +189,10 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
it('[C260479] Should be able to create a filter on APS for running processes - Newest first and check on ADF', async () => {
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.running_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
|
||||
appId: null,
|
||||
name: processFilter.running_new_first,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'created-desc', name: '', state: 'running' }
|
||||
});
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
@@ -190,7 +207,10 @@ describe('Sorting for process filters', () => {
|
||||
await filtersPage.goToFilter(processFilter.running_new_first);
|
||||
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-desc'
|
||||
processDefinitionId: null,
|
||||
appDefinitionId: null,
|
||||
state: 'running',
|
||||
sort: 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
|
||||
@@ -199,8 +219,10 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
it('[C260480] Should be able to create a filter on APS for completed processes - Newest first and check on ADF', async () => {
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'completed' }
|
||||
appId: null,
|
||||
name: processFilter.completed_new_first,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'created-desc', name: '', state: 'completed' }
|
||||
});
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
@@ -218,7 +240,10 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_new_first);
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-desc'
|
||||
processDefinitionId: null,
|
||||
appDefinitionId: null,
|
||||
state: 'completed',
|
||||
sort: 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
|
||||
@@ -227,8 +252,10 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
it('[C260481] Should be able to create a filter on APS for all processes - Newest first and check on ADF', async () => {
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.all_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'all' }
|
||||
appId: null,
|
||||
name: processFilter.all_new_first,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'created-desc', name: '', state: 'all' }
|
||||
});
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
@@ -251,7 +278,10 @@ describe('Sorting for process filters', () => {
|
||||
await filtersPage.goToFilter(processFilter.all_new_first);
|
||||
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-desc'
|
||||
processDefinitionId: null,
|
||||
appDefinitionId: null,
|
||||
state: 'all',
|
||||
sort: 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(deleteThirdProc.name);
|
||||
await expect(processesQuery.data[1].name).toEqual(deleteSecondProc.name);
|
||||
@@ -263,8 +293,10 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
it('[C272815] Should be able to create a filter on APS for completed processes - Completed most recently and check on ADF', async () => {
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_most_recently, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'ended-asc', 'name': '', 'state': 'completed' }
|
||||
appId: null,
|
||||
name: processFilter.completed_most_recently,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'ended-asc', name: '', state: 'completed' }
|
||||
});
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
@@ -283,7 +315,10 @@ describe('Sorting for process filters', () => {
|
||||
await filtersPage.goToFilter(processFilter.completed_most_recently);
|
||||
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-asc'
|
||||
processDefinitionId: null,
|
||||
appDefinitionId: null,
|
||||
state: 'completed',
|
||||
sort: 'ended-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(secondProc.name);
|
||||
await expect(processesQuery.data[1].name).toEqual(firstProc.name);
|
||||
@@ -292,8 +327,10 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
it('[C272816] Should be able to create a filter on APS for completed processes - Completed least recently and check on ADF', async () => {
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_least_recently, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'ended-desc', 'name': '', 'state': 'completed' }
|
||||
appId: null,
|
||||
name: processFilter.completed_least_recently,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'ended-desc', name: '', state: 'completed' }
|
||||
});
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
@@ -312,7 +349,10 @@ describe('Sorting for process filters', () => {
|
||||
await filtersPage.goToFilter(processFilter.completed_least_recently);
|
||||
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-desc'
|
||||
processDefinitionId: null,
|
||||
appDefinitionId: null,
|
||||
state: 'completed',
|
||||
sort: 'ended-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
await expect(processesQuery.data[1].name).toEqual(firstProc.name);
|
||||
|
@@ -15,26 +15,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { AppSettingsTogglesPage } from './../pages/dialog/app-settings-toggles.page';
|
||||
import { createApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from '../pages/process-filters.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { UserFiltersApi } from '@alfresco/js-api';
|
||||
import { UserFiltersApi, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('New Process Filters', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const appSettingsToggles = new AppSettingsTogglesPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
|
||||
let tenantId; let user; let filterId; let customProcessFilter;
|
||||
let tenantId: number;
|
||||
let user: UserModel;
|
||||
let filterId: number;
|
||||
let customProcessFilter: UserProcessInstanceFilterRepresentation;
|
||||
|
||||
const processFilter = {
|
||||
running: 'Running',
|
||||
@@ -87,28 +85,6 @@ describe('New Process Filters', () => {
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_filter);
|
||||
});
|
||||
|
||||
it('[C286450] Should display the process filter icon when a custom filter is added', async () => {
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
appId: null,
|
||||
name: processFilter.new_icon,
|
||||
icon: 'glyphicon-cloud',
|
||||
filter: { sort: 'created-desc', name: '', state: 'running' }
|
||||
});
|
||||
|
||||
filterId = customProcessFilter.id;
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
|
||||
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await appSettingsToggles.enableProcessFiltersIcon();
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
|
||||
await expect(await processFiltersPage.getFilterIcon(processFilter.new_icon)).toEqual('cloud');
|
||||
});
|
||||
|
||||
it('[C260474] Should be able to edit a filter on APS and check it on ADF', async () => {
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
appId: null,
|
||||
@@ -131,51 +107,6 @@ describe('New Process Filters', () => {
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.edited);
|
||||
});
|
||||
|
||||
it('[C286451] Should display changes on a process filter when this filter icon is edited', async () => {
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
appId: null,
|
||||
name: processFilter.edit_icon,
|
||||
icon: 'glyphicon-random',
|
||||
filter: { sort: 'created-desc', name: '', state: 'running' }
|
||||
});
|
||||
|
||||
filterId = customProcessFilter.id;
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
|
||||
|
||||
await userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
appId: null,
|
||||
name: processFilter.edit_icon,
|
||||
icon: 'glyphicon-cloud',
|
||||
filter: { sort: 'created-desc', name: '', state: 'running' }
|
||||
});
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
|
||||
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await appSettingsToggles.enableProcessFiltersIcon();
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
|
||||
await expect(await processFiltersPage.getFilterIcon(processFilter.edit_icon)).toEqual('cloud');
|
||||
});
|
||||
|
||||
it('[C286452] Should display process filter icons only when showIcon property is set on true', async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
await processFiltersPage.checkFilterHasNoIcon(processFilter.all);
|
||||
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await appSettingsToggles.enableProcessFiltersIcon();
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.all);
|
||||
await expect(await processFiltersPage.getFilterIcon(processFilter.all)).toEqual('dashboard');
|
||||
});
|
||||
|
||||
it('[C260475] Should be able to delete a filter on APS and check it on ADF', async () => {
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
appId: null,
|
||||
|
@@ -16,15 +16,14 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { ProcessListPage } from './../pages/process-list.page';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { ProcessFiltersPage } from '../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from '../pages/process-details.page';
|
||||
import { ProcessListPage } from '../pages/process-list.page';
|
||||
|
||||
describe('Empty Process List Test', () => {
|
||||
|
||||
const appWithProcess = browser.params.resources.Files.APP_WITH_PROCESSES;
|
||||
const simpleAppWithUserForm = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
@@ -37,7 +36,7 @@ describe('Empty Process List Test', () => {
|
||||
const startProcessPage = new StartProcessPage();
|
||||
const apiService = createApiService();
|
||||
|
||||
let user;
|
||||
let user: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
@@ -54,7 +53,7 @@ describe('Empty Process List Test', () => {
|
||||
await applicationsService.importPublishDeployApp(simpleAppWithUserForm.file_path);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C260494] Should add process to list when a process is created', async () => {
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
|
@@ -15,20 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, PaginationPage, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { AppDefinitionRepresentation } from '@alfresco/js-api';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from '../pages/process-details.page';
|
||||
import { ProcessFiltersPage } from '../pages/process-filters.page';
|
||||
|
||||
describe('Process List - Pagination when adding processes', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -46,8 +40,8 @@ describe('Process List - Pagination when adding processes', () => {
|
||||
fifteenValue: 15
|
||||
};
|
||||
|
||||
let processUserModel;
|
||||
let resultApp;
|
||||
let processUserModel: UserModel;
|
||||
let resultApp: AppDefinitionRepresentation;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -80,7 +74,7 @@ describe('Process List - Pagination when adding processes', () => {
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of 20' );
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of 20');
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
|
||||
await paginationPage.checkNextPageButtonIsEnabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
@@ -96,7 +90,7 @@ describe('Process List - Pagination when adding processes', () => {
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-25 of 25' );
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-25 of 25');
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(10);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
@@ -24,9 +24,9 @@ import { createApiService,
|
||||
ViewerPage,
|
||||
ModelsActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||
import { ProcessFiltersPage } from '../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from '../pages/process-details.page';
|
||||
import { AttachmentListPage } from '../pages/attachment-list.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
@@ -53,7 +53,9 @@ describe('Attachment list action menu for processes', () => {
|
||||
});
|
||||
|
||||
const downloadedPngFile = pngFile.name;
|
||||
let tenantId; let appId;
|
||||
let tenantId: number;
|
||||
let appId: number;
|
||||
|
||||
const processName = {
|
||||
active: 'Active Process',
|
||||
completed: 'Completed Process',
|
||||
|
@@ -15,26 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage,
|
||||
StartProcessPage,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { ProcessListPage } from './../pages/process-list.page';
|
||||
import { RuntimeAppDefinitionsApi, UserFiltersApi, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { ProcessFiltersPage } from '../pages/process-filters.page';
|
||||
import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page';
|
||||
import { ProcessDetailsPage } from '../pages/process-details.page';
|
||||
import { ProcessListPage } from '../pages/process-list.page';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessListDemoPage } from '../pages/process-list-demo.page';
|
||||
|
||||
describe('Process Filters Test', () => {
|
||||
|
||||
const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -50,10 +41,6 @@ describe('Process Filters Test', () => {
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
const appsApi = new RuntimeAppDefinitionsApi(apiService.getInstance());
|
||||
|
||||
let appModel; let user;
|
||||
|
||||
const processTitle = {
|
||||
running: 'Test_running',
|
||||
@@ -62,18 +49,12 @@ describe('Process Filters Test', () => {
|
||||
one: 'Test fake process one',
|
||||
two: 'Test fake process two'
|
||||
};
|
||||
const processFilter = {
|
||||
running: 'Running',
|
||||
all: 'All',
|
||||
completed: 'Completed'
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
const user = await usersActions.createUser();
|
||||
await apiService.login(user.username, user.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
await applicationsService.importPublishDeployApp(app.file_path);
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
@@ -107,7 +88,6 @@ describe('Process Filters Test', () => {
|
||||
await startProcessPage.enterProcessName(processTitle.running);
|
||||
await startProcessPage.clickFormStartProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.running);
|
||||
await processFiltersPage.selectFromProcessList(processTitle.running);
|
||||
|
||||
await processDetailsPage.propertiesList.waitVisible();
|
||||
@@ -119,7 +99,6 @@ describe('Process Filters Test', () => {
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
await processFiltersPage.clickAllFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.all);
|
||||
await processFiltersPage.selectFromProcessList(processTitle.running);
|
||||
await processFiltersPage.selectFromProcessList(processTitle.completed);
|
||||
await processDetailsPage.propertiesList.waitVisible();
|
||||
@@ -131,32 +110,10 @@ describe('Process Filters Test', () => {
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
await processFiltersPage.clickCompletedFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
|
||||
await processFiltersPage.selectFromProcessList(processTitle.completed);
|
||||
await processDetailsPage.propertiesList.waitVisible();
|
||||
});
|
||||
|
||||
it('[C280407] Should be able to access the filters with URL', async () => {
|
||||
const defaultFiltersNumber = 3;
|
||||
let processFilterUrl;
|
||||
|
||||
const deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
processFilterUrl = browser.baseUrl + '/activiti/apps/' + deployedAppId + '/processes/';
|
||||
const taskAppFilters = await userFiltersApi.getUserProcessInstanceFilters({ appId: deployedAppId });
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
await expect(taskAppFilters.size).toBe(defaultFiltersNumber);
|
||||
for (const filter of taskAppFilters.data) {
|
||||
await BrowserActions.getUrl(processFilterUrl + filter.id);
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
await processFiltersPage.checkFilterIsHighlighted(filter.name);
|
||||
}
|
||||
});
|
||||
|
||||
it('[C260463] Should Cancel process be displayed in Completed process filters', async () => {
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
@@ -172,86 +129,8 @@ describe('Process Filters Test', () => {
|
||||
await processListDemoPage.checkProcessIsNotDisplayed(processTitle.canceled);
|
||||
|
||||
await processFiltersPage.clickCompletedFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
|
||||
await processListDemoPage.checkProcessIsDisplayed(processTitle.canceled);
|
||||
await processFiltersPage.selectFromProcessList(processTitle.canceled);
|
||||
await processDetailsPage.propertiesList.waitVisible();
|
||||
});
|
||||
|
||||
it('[C213262] Default process filters', async () => {
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
await startProcessPage.enterProcessName(processTitle.one);
|
||||
await startProcessPage.clickFormStartProcessButton();
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
await processListDemoPage.checkProcessIsDisplayed(processTitle.one);
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.running);
|
||||
await processDetailsPage.propertiesList.waitVisible();
|
||||
await checkProcessInfoDrawer({ name: processTitle.one });
|
||||
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
await startProcessPage.enterProcessName(processTitle.two);
|
||||
await startProcessPage.clickFormStartProcessButton();
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
await processListDemoPage.checkProcessIsDisplayed(processTitle.one);
|
||||
await processListDemoPage.checkProcessIsDisplayed(processTitle.two);
|
||||
|
||||
await processDetailsPage.cancelProcessButton.click();
|
||||
await processListDemoPage.checkProcessIsNotDisplayed(processTitle.canceled);
|
||||
|
||||
await processFiltersPage.clickCompletedFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
|
||||
await processListDemoPage.checkProcessIsDisplayed(processTitle.two);
|
||||
await processFiltersPage.selectFromProcessList(processTitle.two);
|
||||
|
||||
await processFiltersPage.clickAllFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.all);
|
||||
await processListDemoPage.checkProcessIsDisplayed(processTitle.two);
|
||||
await processFiltersPage.selectFromProcessList(processTitle.two);
|
||||
});
|
||||
|
||||
it('[C260384] Edit default filter', async () => {
|
||||
const runningFilter = (await getFilter()).find(filter => filter.name === 'Running');
|
||||
await userFiltersApi
|
||||
.updateUserProcessInstanceFilter(runningFilter.id, { ...runningFilter, name: 'Edited Running' });
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await processFiltersPage.checkFilterIsNotDisplayed('Running');
|
||||
await processFiltersPage.checkFilterIsDisplayed('Edited Running');
|
||||
});
|
||||
|
||||
it('[C260385] Delete default filter', async () => {
|
||||
const allFilter = (await getFilter()).find(filter => filter.name === 'All');
|
||||
await userFiltersApi.deleteUserProcessInstanceFilter(allFilter.id);
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await processFiltersPage.checkFilterIsNotDisplayed('All');
|
||||
});
|
||||
|
||||
async function getFilter(): Promise<UserProcessInstanceFilterRepresentation[]> {
|
||||
const apps = await appsApi.getAppDefinitions();
|
||||
const { id: appId = 0 } = apps.data.find((application) => application.name === appModel.name);
|
||||
|
||||
const filters = await userFiltersApi.getUserProcessInstanceFilters({ appId });
|
||||
return filters.data;
|
||||
}
|
||||
|
||||
async function checkProcessInfoDrawer({ name }) {
|
||||
await expect(await processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(name);
|
||||
await expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
|
||||
await expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
|
||||
await expect(await processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESS_CATEGORY);
|
||||
await expect(await processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_BUSINESS_KEY);
|
||||
await expect(await processDetailsPage.getCreatedBy()).toEqual(`${user.firstName} ${user.lastName}`);
|
||||
await expect(await processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESS_DESCRIPTION);
|
||||
}
|
||||
});
|
||||
|
@@ -16,23 +16,16 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { ProcessListPage } from './../pages/process-list.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page';
|
||||
import { ProcessListPage } from '../pages/process-list.page';
|
||||
import { ProcessDetailsPage } from '../pages/process-details.page';
|
||||
import * as moment from 'moment';
|
||||
import { ProcessInstancesApi } from '@alfresco/js-api';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation, ProcessInstancesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Process Instance Details', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -48,7 +41,10 @@ describe('Process Instance Details', () => {
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const processApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
|
||||
let appModel; let process; let user;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let user: UserModel;
|
||||
|
||||
const PROCESS_DATE_FORMAT = 'll';
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -70,13 +66,13 @@ describe('Process Instance Details', () => {
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
process = await processApi.getProcessInstance(processModel.id);
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await modelsActions.deleteModel(appModel.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C307031] Should display the created date in the default format', async () => {
|
||||
await processDetailsPage.checkProcessHeaderDetailsAreVisible();
|
||||
|
@@ -15,19 +15,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage, ModelsActions,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
UsersActions,
|
||||
UserModel
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
|
||||
import { ProcessListDemoPage } from '../pages/process-list-demo.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TaskFormsApi } from '@alfresco/js-api';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation, TaskFormsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Process List Test', () => {
|
||||
|
||||
const appWithDateField = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
|
||||
const appWithUserWidget = browser.params.resources.Files.APP_WITH_USER_WIDGET;
|
||||
|
||||
@@ -40,7 +42,9 @@ describe('Process List Test', () => {
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
|
||||
let appDateModel; let appUserWidgetModel; let user;
|
||||
let appDateModel: AppDefinitionRepresentation;
|
||||
let appUserWidgetModel: AppDefinitionRepresentation;
|
||||
let user: UserModel;
|
||||
|
||||
const processList = ['Process With Date', 'Process With Date 2', 'Process With User Widget', 'Process With User Widget 2'];
|
||||
|
||||
@@ -56,8 +60,10 @@ describe('Process List Test', () => {
|
||||
insertAppId: 'Insert App ID'
|
||||
};
|
||||
|
||||
let appWithDateFieldId;
|
||||
let procWithDate; let completedProcWithDate; let completedProcWithUserWidget;
|
||||
let appWithDateFieldId: string | number;
|
||||
let procWithDate: ProcessInstanceRepresentation;
|
||||
let completedProcWithDate: ProcessInstanceRepresentation;
|
||||
let completedProcWithUserWidget: ProcessInstanceRepresentation;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -87,7 +93,7 @@ describe('Process List Test', () => {
|
||||
await taskFormsApi.completeTaskForm(procWithUserWidgetTaskId.id, { values: { label: null } });
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await modelsActions.deleteModel(appDateModel.id);
|
||||
@@ -96,11 +102,11 @@ describe('Process List Test', () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await BrowserActions.getUrl(browser.baseUrl + '/process-list');
|
||||
});
|
||||
});
|
||||
|
||||
it('[C286638] Should display all process by default', async () => {
|
||||
await processListDemoPage.checkAppIdFieldIsDisplayed();
|
||||
|
@@ -1,381 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
|
||||
describe('Process List - Pagination', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
const itemsPerPage = {
|
||||
five: '5',
|
||||
fiveValue: 5,
|
||||
ten: '10',
|
||||
tenValue: 10,
|
||||
fifteen: '15',
|
||||
fifteenValue: 15,
|
||||
twenty: '20',
|
||||
twentyValue: 20,
|
||||
default: '25'
|
||||
};
|
||||
|
||||
const processFilterRunning = 'Running';
|
||||
|
||||
let deployedTestApp;
|
||||
let processUserModel;
|
||||
const nrOfProcesses = 20;
|
||||
let page;
|
||||
let totalPages;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
deployedTestApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
describe('With processes Pagination', () => {
|
||||
beforeAll(async () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
for (let i = 0; i < nrOfProcesses; i++) {
|
||||
await new ProcessUtil(apiService).startProcessOfApp(deployedTestApp.name);
|
||||
}
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
});
|
||||
|
||||
it('[C261042] Should display default pagination', async () => {
|
||||
page = 1;
|
||||
totalPages = 1;
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
it('[C261043] Should be possible to Items per page to 15', async () => {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
|
||||
await paginationPage.checkNextPageButtonIsEnabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
await paginationPage.clickOnNextPage();
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
});
|
||||
|
||||
it('[C261044] Should be possible to Items per page to 10', async () => {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
await paginationPage.checkNextPageButtonIsEnabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
await paginationPage.clickOnNextPage();
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
});
|
||||
|
||||
it('[C261047] Should be possible to Items per page to 20', async () => {
|
||||
page = 1;
|
||||
totalPages = 1;
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
});
|
||||
|
||||
it('[C261045] Should be possible to Items per page to 5', async () => {
|
||||
let showing;
|
||||
page = 1;
|
||||
totalPages = 4;
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
showing = (itemsPerPage.fiveValue * page);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
await paginationPage.checkNextPageButtonIsEnabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
await paginationPage.clickOnNextPage();
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
showing = (itemsPerPage.fiveValue * page);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + showing + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
await paginationPage.checkNextPageButtonIsEnabled();
|
||||
await paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page++;
|
||||
await paginationPage.clickOnNextPage();
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
showing = (itemsPerPage.fiveValue * page);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
await paginationPage.checkNextPageButtonIsEnabled();
|
||||
await paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page++;
|
||||
await paginationPage.clickOnNextPage();
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
showing = (itemsPerPage.fiveValue * page);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + showing + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
});
|
||||
|
||||
it('[C261049] Should be possible to open page number dropdown', async () => {
|
||||
let showing;
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
|
||||
showing = (itemsPerPage.tenValue * page);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
await paginationPage.checkNextPageButtonIsEnabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
await paginationPage.clickOnPageDropdown();
|
||||
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
page = 2;
|
||||
await paginationPage.clickOnPageDropdownOption('2');
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
|
||||
showing = (itemsPerPage.tenValue * page);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
await paginationPage.checkNextPageButtonIsDisabled();
|
||||
await paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
await paginationPage.clickOnPageDropdown();
|
||||
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
page = 1;
|
||||
await paginationPage.clickOnPageDropdownOption('1');
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
|
||||
showing = (itemsPerPage.tenValue * page);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
|
||||
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
await paginationPage.checkNextPageButtonIsEnabled();
|
||||
await paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
it('[C261048] Should be possible to sort processes by name', async () => {
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
|
||||
await processFiltersPage.sortByName('ASC');
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await processFiltersPage.checkProcessesSortedByNameAsc();
|
||||
|
||||
await processFiltersPage.sortByName('DESC');
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await processFiltersPage.checkProcessesSortedByNameDesc();
|
||||
});
|
||||
|
||||
it('[C286260] Should keep sorting when changing \'Items per page\'', async () => {
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
await processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
await processFiltersPage.waitForTableBody();
|
||||
|
||||
await processFiltersPage.sortByName('ASC');
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await processFiltersPage.checkProcessesSortedByNameAsc();
|
||||
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
await processFiltersPage.waitForTableBody();
|
||||
await processFiltersPage.checkProcessesSortedByNameAsc();
|
||||
});
|
||||
});
|
||||
});
|
@@ -30,15 +30,14 @@ import { createApiService,
|
||||
import { browser } from 'protractor';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { ProcessInstancesApi } from '@alfresco/js-api';
|
||||
import { AttachmentListPage } from '../pages/attachment-list.page';
|
||||
import { ProcessDetailsPage } from '../pages/process-details.page';
|
||||
import { ProcessFiltersPage } from '../pages/process-filters.page';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstancesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Start Process Component', () => {
|
||||
|
||||
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
|
||||
const simpleApp = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
|
||||
const dateFormApp = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
|
||||
@@ -62,7 +61,9 @@ describe('Start Process Component', () => {
|
||||
|
||||
let procUserModel: UserModel;
|
||||
let secondProcUserModel: UserModel;
|
||||
let appCreated; let simpleAppCreated; let dateFormAppCreated;
|
||||
let appCreated: AppDefinitionRepresentation;
|
||||
let simpleAppCreated: AppDefinitionRepresentation;
|
||||
let dateFormAppCreated: AppDefinitionRepresentation;
|
||||
|
||||
const processName255Characters = StringUtil.generateRandomString(255);
|
||||
const processNameBiggerThen255Characters = StringUtil.generateRandomString(256);
|
||||
@@ -77,7 +78,6 @@ describe('Start Process Component', () => {
|
||||
});
|
||||
|
||||
describe('Provider: BPM', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
@@ -121,7 +121,6 @@ describe('Start Process Component', () => {
|
||||
});
|
||||
|
||||
describe(' Once logged with user with app', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(secondProcUserModel.username, secondProcUserModel.password);
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
@@ -264,7 +263,9 @@ describe('Start Process Component', () => {
|
||||
await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
|
||||
await startProcessPage.enterProcessName('Type');
|
||||
await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
|
||||
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
|
||||
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
|
||||
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
|
||||
);
|
||||
await startProcessPage.clickStartProcessButton();
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList('Type');
|
||||
@@ -278,7 +279,9 @@ describe('Start Process Component', () => {
|
||||
await startProcessPage.typeProcessDefinition('process');
|
||||
|
||||
await startProcessPage.pressDownArrowAndEnter();
|
||||
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
|
||||
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
|
||||
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
|
||||
);
|
||||
});
|
||||
|
||||
it('[C286514] Should the process definition input be cleared when clicking on options drop down ', async () => {
|
||||
@@ -288,7 +291,9 @@ describe('Start Process Component', () => {
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
await startProcessPage.typeProcessDefinition('process');
|
||||
await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
|
||||
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
|
||||
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
|
||||
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
|
||||
);
|
||||
await startProcessPage.clickProcessDropdownArrow();
|
||||
|
||||
await expect(await startProcessPage.getProcessDefinitionValue()).toBe('');
|
||||
|
@@ -25,7 +25,7 @@ import { createApiService,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { CommentsPage } from '../../core/pages/comments.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ActivitiCommentsApi, TaskActionsApi } from '@alfresco/js-api';
|
||||
@@ -47,7 +47,9 @@ describe('Comment component for Processes', () => {
|
||||
const activitiCommentsApi = new ActivitiCommentsApi(apiService.getInstance());
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
|
||||
let user; let appId; let secondUser;
|
||||
let user: UserModel;
|
||||
let appId: number;
|
||||
let secondUser: UserModel;
|
||||
|
||||
const taskName = {
|
||||
completed_task: 'Test Completed',
|
||||
|
@@ -15,20 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
StringUtil, TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, PaginationPage, StringUtil, TaskUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Task List Pagination - Sorting', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -41,9 +34,8 @@ describe('Task List Pagination - Sorting', () => {
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
const nrOfTasks = 20;
|
||||
let processUserModel;
|
||||
const taskNameBase = 'Task';
|
||||
const taskNames = StringUtil.generateFilesNames(10, nrOfTasks + 9, taskNameBase, '');
|
||||
let processUserModel: UserModel;
|
||||
const taskNames = StringUtil.generateFilesNames(10, nrOfTasks + 9, 'Task', '');
|
||||
|
||||
const itemsPerPage = {
|
||||
five: '5',
|
||||
|
@@ -25,7 +25,7 @@ import {
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
@@ -40,8 +40,8 @@ describe('Start Task - Task App', () => {
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
|
||||
let processUserModel; let anotherUser;
|
||||
const noFormMessage = 'No forms attached';
|
||||
let processUserModel: UserModel;
|
||||
let anotherUser: UserModel;
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
@@ -81,7 +81,7 @@ describe('Start Task - Task App', () => {
|
||||
await taskPage.taskDetails().checkAttachFormButtonIsDisplayed();
|
||||
await taskPage.taskDetails().checkAttachFormButtonIsEnabled();
|
||||
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
|
||||
await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage);
|
||||
await expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached');
|
||||
});
|
||||
|
||||
it('[C268910] Should a standalone task be displayed in completed tasks when completing it', async () => {
|
||||
@@ -139,7 +139,7 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
|
||||
await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage);
|
||||
await expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached');
|
||||
});
|
||||
|
||||
it('[C329799] Form actions are enabled in assigned task', async () => {
|
||||
|
@@ -20,32 +20,29 @@ import { browser } from 'protractor';
|
||||
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { AttachmentListPage } from '../pages/attachment-list.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AppDefinitionRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Start Task - Custom App', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const attachmentListPage = new AttachmentListPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
let processUserModel; let assigneeUserModel;
|
||||
const formTextField = app.form_fields.form_fieldId;
|
||||
const formFieldValue = 'First value ';
|
||||
let processUserModel: UserModel;
|
||||
let assigneeUserModel: UserModel;
|
||||
|
||||
const taskPage = new TasksPage();
|
||||
const firstComment = 'comm1'; const firstChecklist = 'checklist1';
|
||||
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File', 'Spinner'];
|
||||
const showHeaderTask = 'Show Header';
|
||||
let appModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
|
||||
const pngFile = new FileModel({
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
|
||||
@@ -62,7 +59,7 @@ describe('Start Task - Custom App', () => {
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C263942] Should be possible to modify a task', async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
|
||||
@@ -86,14 +83,19 @@ describe('Start Task - Custom App', () => {
|
||||
|
||||
await taskDetails.clickAddInvolvedUserButton();
|
||||
|
||||
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
|
||||
).toEqual(assigneeUserModel.email);
|
||||
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
|
||||
assigneeUserModel.email
|
||||
);
|
||||
|
||||
await taskDetails.selectActivityTab();
|
||||
|
||||
const firstComment = 'comm1';
|
||||
await taskDetails.addComment(firstComment);
|
||||
await taskDetails.checkCommentIsDisplayed(firstComment);
|
||||
|
||||
const checklistDialog = await taskPage.clickOnAddChecklistButton();
|
||||
const firstChecklist = 'checklist1';
|
||||
|
||||
await checklistDialog.addName(firstChecklist);
|
||||
await checklistDialog.clickCreateChecklistButton();
|
||||
|
||||
@@ -137,6 +139,8 @@ describe('Start Task - Custom App', () => {
|
||||
});
|
||||
|
||||
it('[C263949] Should be possible to save filled form', async () => {
|
||||
const formFieldValue = 'First value ';
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
|
||||
@@ -146,22 +150,15 @@ describe('Start Task - Custom App', () => {
|
||||
await task.addName(tasks[4]);
|
||||
await task.clickStartButton();
|
||||
|
||||
const formTextField = app.form_fields.form_fieldId;
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
|
||||
await taskPage.formFields().setFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await taskPage.formFields().refreshForm();
|
||||
|
||||
await taskPage.formFields().checkFieldValue(formTextField, '');
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
|
||||
await taskPage.formFields().setFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await taskPage.formFields().checkFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await taskPage.formFields().saveForm();
|
||||
|
||||
await taskPage.formFields().checkFieldValue(formTextField, formFieldValue);
|
||||
});
|
||||
|
||||
@@ -198,25 +195,4 @@ describe('Start Task - Custom App', () => {
|
||||
await attachmentListPage.clickAttachFileButton(pngFile.location);
|
||||
await attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
});
|
||||
|
||||
it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', async () => {
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
const task = await taskPage.createNewTask();
|
||||
await task.addName(showHeaderTask);
|
||||
await task.clickStartButton();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
|
||||
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await taskPage.taskDetails().appSettingsToggles().disableShowHeader();
|
||||
await processServiceTabBarPage.clickTasksButton();
|
||||
|
||||
await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
|
||||
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await taskPage.taskDetails().appSettingsToggles().enableShowHeader();
|
||||
await processServiceTabBarPage.clickTasksButton();
|
||||
|
||||
await taskPage.taskDetails().taskInfoDrawerIsDisplayed();
|
||||
});
|
||||
});
|
||||
|
@@ -26,19 +26,16 @@ import { createApiService,
|
||||
import { browser } from 'protractor';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { AttachmentListPage } from '../pages/attachment-list.page';
|
||||
import { ChecklistDialog } from '../pages/dialog/create-checklist-dialog.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import * as CONSTANTS from '../../util/constants';
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const attachmentListPage = new AttachmentListPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
@@ -46,16 +43,11 @@ describe('Start Task - Task App', () => {
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const applicationsUtil = new ApplicationsUtil(apiService);
|
||||
|
||||
let processUserModel; let assigneeUserModel;
|
||||
let processUserModel: UserModel;
|
||||
let assigneeUserModel: UserModel;
|
||||
const formTextField = app.form_fields.form_fieldId;
|
||||
const formFieldValue = 'First value ';
|
||||
const taskPage = new TasksPage();
|
||||
const firstComment = 'comm1'; const firstChecklist = 'checklist1';
|
||||
const taskName255Characters = StringUtil.generateRandomString(255);
|
||||
const taskNameBiggerThen255Characters = StringUtil.generateRandomString(256);
|
||||
const lengthValidationError = 'Length exceeded, 255 characters max.';
|
||||
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
|
||||
const showHeaderTask = 'Show Header';
|
||||
const jpgFile = new FileModel({
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_location,
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_name
|
||||
@@ -72,7 +64,7 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
await applicationsUtil.importApplication(app.file_path);
|
||||
|
||||
await taskUtil.createStandaloneTask(showHeaderTask);
|
||||
await taskUtil.createStandaloneTask('Show Header');
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
@@ -101,9 +93,11 @@ describe('Start Task - Task App', () => {
|
||||
.toEqual(assigneeUserModel.email);
|
||||
|
||||
await taskDetails.selectActivityTab();
|
||||
const firstComment = 'comm1';
|
||||
await taskDetails.addComment(firstComment);
|
||||
await taskDetails.checkCommentIsDisplayed(firstComment);
|
||||
|
||||
const firstChecklist = 'checklist1';
|
||||
await (await taskPage.clickOnAddChecklistButton()).addName(firstChecklist);
|
||||
|
||||
const checklistDialog = new ChecklistDialog();
|
||||
@@ -133,6 +127,7 @@ describe('Start Task - Task App', () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
|
||||
const formFields = await taskPage.formFields();
|
||||
const formFieldValue = 'First value ';
|
||||
await formFields.setFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await formFields.refreshForm();
|
||||
@@ -169,29 +164,16 @@ describe('Start Task - Task App', () => {
|
||||
await attachmentListPage.checkFileIsAttached(jpgFile.name);
|
||||
});
|
||||
|
||||
it('[C260420] Should Information box be hidden when showHeaderContent property is set on false', async () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
|
||||
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await taskPage.taskDetails().appSettingsToggles().disableShowHeader();
|
||||
await processServiceTabBarPage.clickTasksButton();
|
||||
|
||||
await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
|
||||
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await taskPage.taskDetails().appSettingsToggles().enableShowHeader();
|
||||
await processServiceTabBarPage.clickTasksButton();
|
||||
|
||||
await taskPage.taskDetails().taskInfoDrawerIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C291780] Should be displayed an error message if task name exceed 255 characters', async () => {
|
||||
const startDialog = await taskPage.createNewTask();
|
||||
const taskName255Characters = StringUtil.generateRandomString(255);
|
||||
await startDialog.addName(taskName255Characters);
|
||||
|
||||
await startDialog.checkStartButtonIsEnabled();
|
||||
const taskNameBiggerThen255Characters = StringUtil.generateRandomString(256);
|
||||
await startDialog.addName(taskNameBiggerThen255Characters);
|
||||
await startDialog.blur(startDialog.name);
|
||||
const lengthValidationError = 'Length exceeded, 255 characters max.';
|
||||
await startDialog.checkValidationErrorIsDisplayed(lengthValidationError);
|
||||
await startDialog.checkStartButtonIsDisabled();
|
||||
});
|
||||
|
@@ -71,8 +71,7 @@ describe('Task Assignee', () => {
|
||||
tenantId: user.tenantId,
|
||||
type: 1
|
||||
});
|
||||
} catch (e) {
|
||||
}
|
||||
} catch {}
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
await applicationsService.importPublishDeployApp(app.file_path, { renewIdmEntries: true });
|
||||
|
@@ -24,17 +24,16 @@ import { createApiService,
|
||||
ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { AttachmentListPage } from '../pages/attachment-list.page';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { Activiti } from '@alfresco/js-api';
|
||||
import { Activiti, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import ContentApi = Activiti.ContentApi;
|
||||
|
||||
describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -55,7 +54,10 @@ describe('Attachment list action menu for tasks', () => {
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
|
||||
});
|
||||
const downloadedPngFile = pngFile.name;
|
||||
let tenantId; let appId; let relatedContent; let relatedContentId;
|
||||
let tenantId: number;
|
||||
let appId: number;
|
||||
let relatedContent: RelatedContentRepresentation;
|
||||
let relatedContentId: number;
|
||||
const taskName = {
|
||||
active: 'Active Task',
|
||||
completed: 'Completed Task',
|
||||
@@ -64,7 +66,6 @@ describe('Attachment list action menu for tasks', () => {
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
const user = await usersActions.createUser();
|
||||
tenantId = user.tenantId;
|
||||
|
@@ -19,17 +19,18 @@ import {
|
||||
LoginPage,
|
||||
BrowserActions,
|
||||
FileBrowserUtil,
|
||||
ApplicationsUtil, createApiService,
|
||||
ApplicationsUtil,
|
||||
createApiService,
|
||||
UsersActions,
|
||||
TaskUtil
|
||||
TaskUtil,
|
||||
UserModel
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Task Audit', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -40,11 +41,10 @@ describe('Task Audit', () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
const taskTaskApp = 'Audit task task app';
|
||||
const taskCustomApp = 'Audit task custom app';
|
||||
const taskCompleteCustomApp = 'Audit completed task custom app';
|
||||
const auditLogFile = 'Audit.pdf';
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -59,7 +59,7 @@ describe('Task Audit', () => {
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
afterAll( async () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
@@ -96,7 +96,8 @@ describe('Task Audit', () => {
|
||||
it('[C263944] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone completed task', async () => {
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.createTask({name: taskCompleteCustomApp});
|
||||
const taskCompleteCustomApp = 'Audit completed task custom app';
|
||||
await taskPage.createTask({ name: taskCompleteCustomApp });
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskCompleteCustomApp);
|
||||
@@ -113,7 +114,7 @@ describe('Task Audit', () => {
|
||||
it('[C263943] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone running task', async () => {
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.createTask({name: taskCustomApp});
|
||||
await taskPage.createTask({ name: taskCustomApp });
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskCustomApp);
|
||||
|
@@ -15,27 +15,30 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage, ModelsActions,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
StringUtil, TaskUtil,
|
||||
StringUtil,
|
||||
TaskUtil,
|
||||
UsersActions,
|
||||
Widget,
|
||||
FormUtil
|
||||
FormUtil,
|
||||
UserModel
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FiltersPage } from './../pages/filters.page';
|
||||
import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { TasksListPage } from './../pages/tasks-list.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { AttachFormPage } from './../pages/attach-form.page';
|
||||
import { FiltersPage } from '../pages/filters.page';
|
||||
import { TaskDetailsPage } from '../pages/task-details.page';
|
||||
import { TasksListPage } from '../pages/tasks-list.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { AttachFormPage } from '../pages/attach-form.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
|
||||
import { ModelRepresentation, TaskActionsApi, TaskRepresentation, TasksApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Task Details - Form', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -56,7 +59,12 @@ describe('Task Details - Form', () => {
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
|
||||
let task; let otherTask; let user; let newForm; let attachedForm; let otherAttachedForm;
|
||||
let task: TaskRepresentation;
|
||||
let otherTask: TaskRepresentation;
|
||||
let user: UserModel;
|
||||
let newForm: ModelRepresentation;
|
||||
let attachedForm: ModelRepresentation;
|
||||
let otherAttachedForm: ModelRepresentation;
|
||||
|
||||
beforeAll(async () => {
|
||||
const attachedFormModel = {
|
||||
@@ -183,7 +191,8 @@ describe('Task Details - Form', () => {
|
||||
tabFieldVar: 'tabBasicFieldVar'
|
||||
};
|
||||
|
||||
let newTask; let appModel;
|
||||
let newTask;
|
||||
let appModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AppDefinitionRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Task Details - No form', () => {
|
||||
|
||||
const app = browser.params.resources.Files.NO_FORM_APP;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -32,9 +32,8 @@ describe('Task Details - No form', () => {
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel;
|
||||
const noFormMessage = 'No forms attached';
|
||||
let importedApp;
|
||||
let processUserModel: UserModel;
|
||||
let importedApp: AppDefinitionRepresentation;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -45,9 +44,9 @@ describe('Task Details - No form', () => {
|
||||
importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
await new ProcessUtil(apiService).startProcessOfApp(importedApp.name);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
});
|
||||
|
||||
afterAll( async () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
@@ -63,6 +62,8 @@ describe('Task Details - No form', () => {
|
||||
await taskPage.taskDetails().checkCompleteTaskButtonIsEnabled();
|
||||
await taskPage.taskDetails().checkAttachFormButtonIsNotDisplayed();
|
||||
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
|
||||
|
||||
const noFormMessage = 'No forms attached';
|
||||
await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -15,18 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage, ModelsActions,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
StringUtil, TaskUtil,
|
||||
UsersActions
|
||||
StringUtil,
|
||||
TaskUtil,
|
||||
UsersActions,
|
||||
UserModel
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TaskActionsApi, TaskFormsApi, TasksApi } from '@alfresco/js-api';
|
||||
import { AppDefinitionRepresentation, TaskActionsApi, TaskFormsApi, TasksApi } from '@alfresco/js-api';
|
||||
import Task = require('../../models/APS/Task');
|
||||
import TaskModel = require('../../models/APS/TaskModel');
|
||||
import FormModel = require('../../models/APS/FormModel');
|
||||
@@ -34,7 +38,6 @@ import CONSTANTS = require('../../util/constants');
|
||||
import * as moment from 'moment';
|
||||
|
||||
describe('Task Details component', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const processServices = new ProcessServicesPage();
|
||||
@@ -49,10 +52,11 @@ describe('Task Details component', () => {
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
|
||||
let processUserModel; let appModel;
|
||||
let processUserModel: UserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
|
||||
const TASK_DATE_FORMAT = 'll';
|
||||
let formModel;
|
||||
let formModel: any;
|
||||
|
||||
const taskFormModel = {
|
||||
name: StringUtil.generateRandomString(),
|
||||
@@ -162,7 +166,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
|
||||
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
|
||||
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
|
||||
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel.definition.models[1].name);
|
||||
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name);
|
||||
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
|
||||
@@ -193,7 +197,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
|
||||
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
|
||||
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
|
||||
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel.definition.models[1].name);
|
||||
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name);
|
||||
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
|
||||
@@ -310,7 +314,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.COMPLETED);
|
||||
});
|
||||
|
||||
it('[C260321] Should not be able to edit a completed task\'s details', async () => {
|
||||
it('[C260321] Should not be able to edit a completed task details', async () => {
|
||||
const taskName = 'TaskCompleted';
|
||||
const form = await modelsActions.modelsApi.createModel(taskFormModel);
|
||||
const task = await taskUtil.createStandaloneTask(taskName);
|
||||
|
@@ -18,248 +18,155 @@
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage, ModelsActions,
|
||||
UserFiltersUtil,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TasksListPage } from './../pages/tasks-list.page';
|
||||
import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { AppSettingsTogglesPage } from './../pages/dialog/app-settings-toggles.page';
|
||||
import { TaskFiltersDemoPage } from './../pages/task-filters-demo.page';
|
||||
import { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { TasksListPage } from '../pages/tasks-list.page';
|
||||
import { TaskDetailsPage } from '../pages/task-details.page';
|
||||
import { TaskFiltersDemoPage } from '../pages/task-filters-demo.page';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Task', () => {
|
||||
const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
|
||||
|
||||
describe('Filters', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const processServicesPage = new ProcessServicesPage();
|
||||
const tasksPage = new TasksPage();
|
||||
const tasksListPage = new TasksListPage();
|
||||
const taskDetailsPage = new TaskDetailsPage();
|
||||
const taskFiltersDemoPage = new TaskFiltersDemoPage();
|
||||
|
||||
const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const processServicesPage = new ProcessServicesPage();
|
||||
const tasksPage = new TasksPage();
|
||||
const tasksListPage = new TasksListPage();
|
||||
const taskDetailsPage = new TaskDetailsPage();
|
||||
const taskFiltersDemoPage = new TaskFiltersDemoPage();
|
||||
let appId: number;
|
||||
let user: UserModel;
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
beforeEach(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
let appId: number; let user: UserModel;
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const { id } = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appId = id;
|
||||
|
||||
beforeEach(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const { id } = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appId = id;
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
await processServicesPage.checkApsContainer();
|
||||
await processServicesPage.goToApp(app.title);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C279967] Should display default filters when an app is deployed', async () => {
|
||||
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C260330] Should display Task Filter List when app is in Task Tab', async () => {
|
||||
await tasksPage.createTask({ name: 'Test' });
|
||||
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
|
||||
|
||||
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
|
||||
await tasksListPage.checkContentIsNotDisplayed('Test');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
|
||||
|
||||
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
|
||||
|
||||
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
|
||||
await tasksListPage.checkContentIsNotDisplayed('Test');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
|
||||
});
|
||||
|
||||
it('[C260348] Should display task in Complete Tasks List when task is completed', async () => {
|
||||
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
|
||||
const task = await tasksPage.createNewTask();
|
||||
await task.addName('Test');
|
||||
await task.clickStartButton();
|
||||
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
|
||||
|
||||
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
|
||||
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
|
||||
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
|
||||
|
||||
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
|
||||
|
||||
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
|
||||
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
|
||||
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
|
||||
});
|
||||
|
||||
it('[C260349] Should sort task by name when Name sorting is clicked', async () => {
|
||||
await tasksPage.createTask({ name: 'Test1' });
|
||||
await taskDetailsPage.clickCompleteTask();
|
||||
|
||||
await tasksPage.createTask({ name: 'Test2' });
|
||||
await taskDetailsPage.clickCompleteTask();
|
||||
|
||||
await tasksPage.createTask({ name: 'Test3' });
|
||||
await tasksPage.createTask({ name: 'Test4' });
|
||||
|
||||
await tasksListPage.checkContentIsDisplayed('Test4');
|
||||
await tasksListPage.checkRowIsSelected('Test4');
|
||||
await tasksListPage.checkContentIsDisplayed('Test3');
|
||||
await taskDetailsPage.checkTaskDetailsDisplayed();
|
||||
|
||||
await tasksPage.clickSortByNameAsc();
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3');
|
||||
await tasksPage.clickSortByNameDesc();
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4');
|
||||
|
||||
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test1');
|
||||
await tasksListPage.checkContentIsDisplayed('Test2');
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2');
|
||||
|
||||
await tasksPage.clickSortByNameAsc();
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1');
|
||||
|
||||
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test3');
|
||||
await tasksListPage.checkContentIsDisplayed('Test4');
|
||||
});
|
||||
|
||||
it('[C277264] Should display task filter results when task filter is selected', async () => {
|
||||
await tasksPage.createTask({ name: 'Test' });
|
||||
|
||||
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test');
|
||||
});
|
||||
await loginPage.login(user.username, user.password);
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
await processServicesPage.checkApsContainer();
|
||||
await processServicesPage.goToApp(app.title);
|
||||
});
|
||||
|
||||
describe('Custom Filters', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const processServicesPage = new ProcessServicesPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const appSettingsToggles = new AppSettingsTogglesPage();
|
||||
const taskFiltersDemoPage = new TaskFiltersDemoPage();
|
||||
afterEach(async () => {
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
const apiService = createApiService();
|
||||
const userFiltersApi = new UserFiltersUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
it('[C279967] Should display default filters when an app is deployed', async () => {
|
||||
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
});
|
||||
|
||||
let user;
|
||||
let appId: number;
|
||||
it('[C260330] Should display Task Filter List when app is in Task Tab', async () => {
|
||||
await tasksPage.createTask({ name: 'Test' });
|
||||
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
|
||||
|
||||
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
|
||||
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
|
||||
await tasksListPage.checkContentIsNotDisplayed('Test');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appId = await applicationsService.getAppDefinitionId(importedApp.id);
|
||||
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
|
||||
await tasksListPage.checkContentIsNotDisplayed('Test');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
|
||||
});
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
it('[C260348] Should display task in Complete Tasks List when task is completed', async () => {
|
||||
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
const task = await tasksPage.createNewTask();
|
||||
await task.addName('Test');
|
||||
await task.clickStartButton();
|
||||
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
await processServicesPage.checkApsContainer();
|
||||
await processServicesPage.goToApp(app.title);
|
||||
});
|
||||
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
|
||||
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
|
||||
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
|
||||
|
||||
it('[C260350] Should display a new filter when a filter is added', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
name: 'New Task Filter',
|
||||
appId,
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
const { id } = await userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed();
|
||||
await userFiltersApi.deleteUserTaskFilter(id);
|
||||
});
|
||||
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
|
||||
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
|
||||
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
|
||||
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
|
||||
});
|
||||
|
||||
it('[C286447] Should display the task filter icon when a custom filter is added', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
name: 'New Task Filter with icon',
|
||||
appId,
|
||||
icon: 'glyphicon-cloud',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
const { id } = await userFiltersApi.createUserTaskFilter(newFilter);
|
||||
it('[C260349] Should sort task by name when Name sorting is clicked', async () => {
|
||||
await tasksPage.createTask({ name: 'Test1' });
|
||||
await taskDetailsPage.clickCompleteTask();
|
||||
|
||||
await browser.refresh();
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await browser.sleep(500);
|
||||
await appSettingsToggles.enableTaskFiltersIcon();
|
||||
await processServiceTabBarPage.clickTasksButton();
|
||||
await tasksPage.createTask({ name: 'Test2' });
|
||||
await taskDetailsPage.clickCompleteTask();
|
||||
|
||||
await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').checkTaskFilterIsDisplayed();
|
||||
await expect(await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').getTaskFilterIcon()).toEqual('cloud');
|
||||
await userFiltersApi.deleteUserTaskFilter(id);
|
||||
});
|
||||
await tasksPage.createTask({ name: 'Test3' });
|
||||
await tasksPage.createTask({ name: 'Test4' });
|
||||
|
||||
it('[C286449] Should display task filter icons only when showIcon property is set on true', async () => {
|
||||
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterHasNoIcon();
|
||||
await tasksListPage.checkContentIsDisplayed('Test4');
|
||||
await tasksListPage.checkRowIsSelected('Test4');
|
||||
await tasksListPage.checkContentIsDisplayed('Test3');
|
||||
await taskDetailsPage.checkTaskDetailsDisplayed();
|
||||
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
await appSettingsToggles.enableTaskFiltersIcon();
|
||||
await processServiceTabBarPage.clickTasksButton();
|
||||
await tasksPage.clickSortByNameAsc();
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3');
|
||||
await tasksPage.clickSortByNameDesc();
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4');
|
||||
|
||||
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
|
||||
await expect(await taskFiltersDemoPage.myTasksFilter().getTaskFilterIcon()).toEqual('inbox');
|
||||
});
|
||||
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test1');
|
||||
await tasksListPage.checkContentIsDisplayed('Test2');
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2');
|
||||
|
||||
await tasksPage.clickSortByNameAsc();
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1');
|
||||
|
||||
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test3');
|
||||
await tasksListPage.checkContentIsDisplayed('Test4');
|
||||
});
|
||||
|
||||
it('[C277264] Should display task filter results when task filter is selected', async () => {
|
||||
await tasksPage.createTask({ name: 'Test' });
|
||||
|
||||
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
|
||||
await tasksListPage.checkContentIsDisplayed('Test');
|
||||
await expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test');
|
||||
});
|
||||
});
|
||||
|
@@ -15,18 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TasksListPage } from './../pages/tasks-list.page';
|
||||
import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { TaskFiltersDemoPage } from './../pages/task-filters-demo.page';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { TasksListPage } from '../pages/tasks-list.page';
|
||||
import { TaskDetailsPage } from '../pages/task-details.page';
|
||||
import { TaskFiltersDemoPage } from '../pages/task-filters-demo.page';
|
||||
import { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Task Filters Sorting', () => {
|
||||
|
||||
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -41,8 +40,8 @@ describe('Task Filters Sorting', () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const userFiltersUtil = new UserFiltersUtil(apiService);
|
||||
|
||||
let user;
|
||||
let appId;
|
||||
let user: UserModel;
|
||||
let appId: number;
|
||||
|
||||
const tasks = [
|
||||
{ name: 'Task 1 Completed', dueDate: '01/01/2019' },
|
||||
@@ -50,7 +49,8 @@ describe('Task Filters Sorting', () => {
|
||||
{ name: 'Task 3 Completed', dueDate: '03/01/2019' },
|
||||
{ name: 'Task 4', dueDate: '01/01/2019' },
|
||||
{ name: 'Task 5', dueDate: '02/01/2019' },
|
||||
{ name: 'Task 6', dueDate: '03/01/2019' }];
|
||||
{ name: 'Task 6', dueDate: '03/01/2019' }
|
||||
];
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -67,21 +67,21 @@ describe('Task Filters Sorting', () => {
|
||||
await processServicesPage.checkApsContainer();
|
||||
await processServicesPage.goToApp(app.title);
|
||||
|
||||
await tasksPage.createTask({name: tasks[0].name, dueDate: tasks[0].dueDate});
|
||||
await tasksPage.createTask({ name: tasks[0].name, dueDate: tasks[0].dueDate });
|
||||
await taskDetailsPage.clickCompleteTask();
|
||||
|
||||
await tasksPage.createTask({name: tasks[1].name, dueDate: tasks[1].dueDate});
|
||||
await tasksPage.createTask({ name: tasks[1].name, dueDate: tasks[1].dueDate });
|
||||
await taskDetailsPage.clickCompleteTask();
|
||||
|
||||
await tasksPage.createTask({name: tasks[2].name, dueDate: tasks[2].dueDate});
|
||||
await tasksPage.createTask({ name: tasks[2].name, dueDate: tasks[2].dueDate });
|
||||
await taskDetailsPage.clickCompleteTask();
|
||||
|
||||
await tasksPage.createTask({name: tasks[3].name, dueDate: tasks[3].dueDate});
|
||||
await tasksPage.createTask({name: tasks[4].name, dueDate: tasks[4].dueDate});
|
||||
await tasksPage.createTask({name: tasks[5].name, dueDate: tasks[5].dueDate});
|
||||
await tasksPage.createTask({ name: tasks[3].name, dueDate: tasks[3].dueDate });
|
||||
await tasksPage.createTask({ name: tasks[4].name, dueDate: tasks[4].dueDate });
|
||||
await tasksPage.createTask({ name: tasks[5].name, dueDate: tasks[5].dueDate });
|
||||
});
|
||||
|
||||
afterAll( async () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
@@ -89,7 +89,7 @@ describe('Task Filters Sorting', () => {
|
||||
it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
appId,
|
||||
name : 'Newest first',
|
||||
name: 'Newest first',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
@@ -101,12 +101,12 @@ describe('Task Filters Sorting', () => {
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name);
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
|
||||
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
appId,
|
||||
name : 'Newest last',
|
||||
name: 'Newest last',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-asc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
@@ -123,7 +123,7 @@ describe('Task Filters Sorting', () => {
|
||||
it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
appId,
|
||||
name : 'Due first',
|
||||
name: 'Due first',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
@@ -140,7 +140,7 @@ describe('Task Filters Sorting', () => {
|
||||
it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
appId,
|
||||
name : 'Due last',
|
||||
name: 'Due last',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-asc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
@@ -157,7 +157,7 @@ describe('Task Filters Sorting', () => {
|
||||
it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
appId,
|
||||
name : 'Newest first Open',
|
||||
name: 'Newest first Open',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
@@ -174,7 +174,7 @@ describe('Task Filters Sorting', () => {
|
||||
it('[C277259] Should display tasks under new filter from oldest to newest when they are open', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
appId,
|
||||
name : 'Newest last Open',
|
||||
name: 'Newest last Open',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-asc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
@@ -191,7 +191,7 @@ describe('Task Filters Sorting', () => {
|
||||
it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
appId,
|
||||
name : 'Due first Open',
|
||||
name: 'Due first Open',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-desc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
@@ -208,7 +208,7 @@ describe('Task Filters Sorting', () => {
|
||||
it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', async () => {
|
||||
const newFilter = new UserProcessInstanceFilterRepresentation({
|
||||
appId,
|
||||
name : 'Due last Open',
|
||||
name: 'Due last Open',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-asc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
|
@@ -25,7 +25,7 @@ import { createApiService,
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Task List Pagination', () => {
|
||||
@@ -42,7 +42,7 @@ describe('Task List Pagination', () => {
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let currentPage = 1;
|
||||
const nrOfTasks = 20;
|
||||
let totalPages;
|
||||
let totalPages: number;
|
||||
|
||||
const itemsPerPage = {
|
||||
five: '5',
|
||||
|
@@ -15,22 +15,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowserActions, Widget, ApplicationsUtil, ProcessUtil, createApiService, UsersActions } from '@alfresco/adf-testing';
|
||||
import { LoginPage, BrowserActions, Widget, ApplicationsUtil, ProcessUtil, createApiService, UsersActions, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { browser } from 'protractor';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Amount Widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.AMOUNT;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
const apiService = createApiService();
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
@@ -49,7 +50,7 @@ describe('Amount Widget', () => {
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedAppId}/tasks/`;
|
||||
@@ -64,7 +65,7 @@ describe('Amount Widget', () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C274703] Should be possible to set general, advance and visibility properties for Amount Widget', async () => {
|
||||
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.amount_input_id);
|
||||
@@ -78,12 +79,12 @@ describe('Amount Widget', () => {
|
||||
await expect(fieldCurrency.trim()).toBe('$');
|
||||
|
||||
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 4);
|
||||
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be less than 5');
|
||||
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be less than 5`);
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
|
||||
|
||||
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 101);
|
||||
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be greater than 100');
|
||||
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be greater than 100`);
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
|
||||
|
||||
|
@@ -15,14 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
FileBrowserUtil,
|
||||
LoginPage,
|
||||
UsersActions,
|
||||
ViewerPage,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, FileBrowserUtil, LoginPage, UsersActions, ViewerPage, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
@@ -33,7 +26,6 @@ import { FiltersPage } from '../pages/filters.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Attach widget - File', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@@ -49,9 +41,8 @@ describe('Attach widget - File', () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
const pdfFile = new FileModel({name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name});
|
||||
const appFields = app.form_fields;
|
||||
let processUserModel: UserModel;
|
||||
const pdfFile = new FileModel({ name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name });
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -73,8 +64,8 @@ describe('Attach widget - 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().attachFile(app.form_fields.attachFile_id, pdfFile.location);
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.form_fields.attachFile_id, pdfFile.name);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -83,7 +74,7 @@ describe('Attach widget - File', () => {
|
||||
});
|
||||
|
||||
it('[C268067] Should be able to preview, download and remove attached files from an active form', async () => {
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().checkAttachFileOptionsActiveForm();
|
||||
|
||||
await widget.attachFileWidget().viewAttachedFile();
|
||||
@@ -91,11 +82,11 @@ describe('Attach widget - File', () => {
|
||||
await viewerPage.checkCloseButtonIsDisplayed();
|
||||
await viewerPage.clickCloseButton();
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().downloadFile();
|
||||
await FileBrowserUtil.isFileDownloaded(pdfFile.name);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().removeAttachedFile();
|
||||
await widget.attachFileWidget().attachFileWidgetDisplayed();
|
||||
});
|
||||
@@ -107,9 +98,9 @@ describe('Attach widget - File', () => {
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
await filtersPage.goToFilter('Completed Tasks');
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.form_fields.attachFile_id, pdfFile.name);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().checkAttachFileOptionsCompletedForm();
|
||||
|
||||
await widget.attachFileWidget().viewAttachedFile();
|
||||
@@ -117,7 +108,7 @@ describe('Attach widget - File', () => {
|
||||
await viewerPage.checkCloseButtonIsDisplayed();
|
||||
await viewerPage.clickCloseButton();
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().downloadFile();
|
||||
await FileBrowserUtil.isFileDownloaded(pdfFile.name);
|
||||
});
|
||||
|
@@ -15,31 +15,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Attach Folder widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.ATTACH_FOLDER;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
@@ -58,11 +51,10 @@ describe('Attach Folder widget', () => {
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -72,7 +64,7 @@ describe('Attach Folder widget', () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C276745] Should be possible to set visibility properties for Attach Folder Widget', async () => {
|
||||
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.upload_button_id);
|
||||
|
@@ -15,29 +15,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Checkbox Widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.CHECKBOX;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel: UserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
@@ -56,10 +51,10 @@ describe('Checkbox Widget', () => {
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
@@ -68,7 +63,7 @@ describe('Checkbox Widget', () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C268554] Should be able to set general settings for Checkbox widget ', async () => {
|
||||
await taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, '2');
|
||||
|
@@ -15,18 +15,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
Widget, UserModel
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Date and time widget', () => {
|
||||
|
||||
@@ -35,16 +36,16 @@ describe('Date and time widget', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel: UserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -61,8 +62,7 @@ describe('Date and time widget', () => {
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
|
@@ -15,22 +15,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
FormPage,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
Widget, UserModel
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { FormDemoPage } from '.././pages/form-demo.page';
|
||||
import { FormDemoPage } from '../pages/form-demo.page';
|
||||
import { customDateFormAPS1 } from '../../resources/forms/custom-date-form';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Date widget', () => {
|
||||
|
||||
@@ -39,12 +40,12 @@ describe('Date widget', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const dateWidget = widget.dateWidget();
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedAppId; let process;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
@@ -73,8 +74,7 @@ describe('Date widget', () => {
|
||||
|
||||
describe('Simple App', () => {
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -113,13 +113,11 @@ describe('Date widget', () => {
|
||||
await formDemoPage.setConfigToEditor(formJson);
|
||||
await dateWidget.setDateInput('datefield', '18-7-19');
|
||||
await formPage.saveForm();
|
||||
await expect(await dateWidget.getErrorMessage('datefield'))
|
||||
.toBe('Can\'t be less than 19-7-19', 'Min date validation is not working');
|
||||
await expect(await dateWidget.getErrorMessage('datefield')).toBe('Can\'t be less than 19-7-19');
|
||||
await dateWidget.clearDateInput('datefield');
|
||||
await dateWidget.setDateInput('datefield', '20-7-19');
|
||||
await formPage.saveForm();
|
||||
await expect(await dateWidget.getErrorMessage('datefield'))
|
||||
.toBe('Can\'t be greater than 19-8-19', 'Max date validation is not working');
|
||||
await expect(await dateWidget.getErrorMessage('datefield')).toBe('Can\'t be greater than 19-8-19');
|
||||
await dateWidget.clearDateInput('datefield');
|
||||
await dateWidget.setDateInput('datefield', '19-7-19');
|
||||
await formPage.saveForm();
|
||||
|
@@ -15,54 +15,46 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Document Template widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.FILE_FORM_ADF;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp( app.file_path);
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessOfApp(appModel.name);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
process = await processUtil.startProcessOfApp(appModel.name);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -72,10 +64,9 @@ describe('Document Template widget', () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C260406] should check that the template contains assigned file ', async () => {
|
||||
await expect(await widget.containerWidget().getFieldText(app.form_fields.container_id))
|
||||
.toEqual(app.attached_file);
|
||||
await expect(await widget.containerWidget().getFieldText(app.form_fields.container_id)).toEqual(app.attached_file);
|
||||
});
|
||||
});
|
||||
|
@@ -15,18 +15,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
import {
|
||||
createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget, UserModel
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Dropdown widget', () => {
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.DROPDOWN;
|
||||
@@ -34,34 +35,33 @@ describe('Dropdown widget', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
|
@@ -15,21 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
Widget, UserModel
|
||||
} 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');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Dynamic Table widget ', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
@@ -40,8 +41,9 @@ describe('Dynamic Table widget ', () => {
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel: UserModel;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
|
||||
describe('with Date Time Widget App', () => {
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE;
|
||||
@@ -60,8 +62,7 @@ describe('Dynamic Table widget ', () => {
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -117,8 +118,7 @@ describe('Dynamic Table widget ', () => {
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
@@ -173,8 +173,7 @@ describe('Dynamic Table widget ', () => {
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
@@ -189,15 +188,15 @@ describe('Dynamic Table widget ', () => {
|
||||
|
||||
await widget.dynamicTable().setDatatableInput('name', app.CUSTOM_VALIDATOR.FIELD.NAME);
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Id\' is required.');
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Id' is required.`);
|
||||
|
||||
await widget.dynamicTable().setDatatableInput('id', app.CUSTOM_VALIDATOR.FIELD.ID);
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Number\' is required.');
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Number' is required.`);
|
||||
|
||||
await widget.dynamicTable().setDatatableInput('12', app.CUSTOM_VALIDATOR.FIELD.NUM);
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Address\' is required.');
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Address' is required.`);
|
||||
|
||||
await widget.dynamicTable().setDatatableInput('address', app.CUSTOM_VALIDATOR.FIELD.ADDRESS);
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
|
@@ -15,54 +15,46 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Header widget', async () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.HEADER;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -72,7 +64,7 @@ describe('Header widget', async () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C276737] Should be able to set general and visibility properties for Header widget', async () => {
|
||||
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.header_id);
|
||||
|
@@ -15,36 +15,29 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Hyperlink widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.HYPERLINK;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedAppId; let process;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -61,8 +54,7 @@ describe('Hyperlink widget', () => {
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
|
@@ -15,18 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Multi-line Widget', () => {
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.MULTILINE_TEXT;
|
||||
@@ -34,34 +28,33 @@ describe('Multi-line Widget', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedAppId; let process;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -71,7 +64,7 @@ describe('Multi-line Widget', () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C268182] Should be able to set general properties for Multi-line Text Widget', async () => {
|
||||
const label = await widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple);
|
||||
|
@@ -15,36 +15,29 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Number widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.NUMBER;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -58,11 +51,10 @@ describe('Number widget', () => {
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -72,7 +64,7 @@ describe('Number widget', () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C269111] Should be able to set general properties for Number Widget', async () => {
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
@@ -91,12 +83,12 @@ describe('Number widget', () => {
|
||||
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.number_visible);
|
||||
|
||||
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 2);
|
||||
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be less than 3');
|
||||
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be less than 3`);
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
|
||||
|
||||
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 101);
|
||||
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be greater than 100');
|
||||
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be greater than 100`);
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
|
||||
|
||||
|
@@ -26,7 +26,6 @@ import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
describe('People widget', () => {
|
||||
|
||||
@@ -35,7 +34,6 @@ describe('People widget', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
@@ -61,8 +59,7 @@ describe('People widget', () => {
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
|
@@ -15,53 +15,45 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Radio Buttons Widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.RADIO_BUTTONS;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let appId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let appId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
appId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
appId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(appId);
|
||||
await new ProcessServicesPage().goToAppByAppId(appId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -71,7 +63,7 @@ describe('Radio Buttons Widget', () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C277316] Should display empty radio buttons when no preselection is configured', async () => {
|
||||
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
|
@@ -15,54 +15,46 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Text widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.TEXT;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
@@ -72,7 +64,7 @@ describe('Text widget', () => {
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C268157] Should be able to set general properties for Text widget', async () => {
|
||||
const label = await widget.textWidget().getFieldLabel(app.FIELD.simpleText);
|
||||
|
@@ -15,18 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from '../pages/process-services.page';
|
||||
import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
|
||||
const widgets = {
|
||||
textOneId: 'text1',
|
||||
@@ -51,40 +45,38 @@ const checkbox = {
|
||||
};
|
||||
|
||||
describe('Process-Services - Visibility conditions', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.VISIBILITY;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const widget = new Widget();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedAppId; let process;
|
||||
let processUserModel;
|
||||
let appModel: AppDefinitionRepresentation;
|
||||
let deployedAppId: number;
|
||||
let process: ProcessInstanceRepresentation;
|
||||
let processUserModel: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await new ProcessServicesPage().goToAppByAppId(deployedAppId);
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
Reference in New Issue
Block a user