mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
parent
4dc98eb288
commit
558056b05c
1
.gitignore
vendored
1
.gitignore
vendored
@ -27,3 +27,4 @@ out-tsc
|
||||
!/.protractor-smartrunner/
|
||||
/reports/
|
||||
e2e-result-*
|
||||
licenses.txt
|
||||
|
@ -1,46 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService } from '@alfresco/adf-testing';
|
||||
import { AppDefinitionRepresentation, ResultListDataRepresentationAppDefinitionRepresentation } from '@alfresco/js-api';
|
||||
|
||||
export class AppsRuntimeActions {
|
||||
|
||||
api: ApiService;
|
||||
|
||||
constructor(api: ApiService) {
|
||||
this.api = api;
|
||||
}
|
||||
|
||||
async getRuntimeAppByName(appName: string): Promise<AppDefinitionRepresentation> {
|
||||
const runtimeApps = await this.getRuntimeAppDefinitions();
|
||||
let desiredApp;
|
||||
|
||||
for (let i = 0; i < runtimeApps.data.length; i++) {
|
||||
if (runtimeApps.data[i].name === appName) {
|
||||
desiredApp = runtimeApps.data[i];
|
||||
}
|
||||
}
|
||||
|
||||
return desiredApp;
|
||||
}
|
||||
|
||||
async getRuntimeAppDefinitions(): Promise<ResultListDataRepresentationAppDefinitionRepresentation> {
|
||||
return this.api.getInstance().activiti.appsRuntimeApi.getAppDefinitions();
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FormRepresentation } from '@alfresco/js-api';
|
||||
import { ApiService } from '@alfresco/adf-testing';
|
||||
|
||||
export class FormModelActions {
|
||||
|
||||
api: ApiService;
|
||||
|
||||
constructor(api: ApiService) {
|
||||
this.api = api;
|
||||
}
|
||||
|
||||
async getFormByName(name: string): Promise<FormRepresentation> {
|
||||
|
||||
// @ts-ignore
|
||||
const forms: any = await this.api.getInstance().activiti.editorApi.getForms();
|
||||
|
||||
const form = forms.data.find((currentForm) => {
|
||||
return currentForm.name === name;
|
||||
});
|
||||
|
||||
return form;
|
||||
}
|
||||
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService } from '@alfresco/adf-testing';
|
||||
|
||||
export class ModelsActions {
|
||||
|
||||
api: ApiService;
|
||||
|
||||
constructor(alfrescoApi: ApiService) {
|
||||
this.api = alfrescoApi;
|
||||
}
|
||||
|
||||
async deleteVersionModel(modelId: number): Promise<any> {
|
||||
return this.api.getInstance().activiti.modelsApi.deleteModel(modelId, {
|
||||
cascade: false,
|
||||
deleteRuntimeApp: true
|
||||
});
|
||||
}
|
||||
|
||||
async deleteEntireModel(modelId: number): Promise<any> {
|
||||
return this.api.getInstance().activiti.modelsApi.deleteModel(modelId, {
|
||||
cascade: true,
|
||||
deleteRuntimeApp: true
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -30,7 +30,7 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { SitesApi, SiteEntry } from '@alfresco/js-api';
|
||||
import { SitesApi, SiteEntry, CommentsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Comment', () => {
|
||||
|
||||
@ -39,7 +39,9 @@ describe('Comment', () => {
|
||||
const viewerPage: ViewerPage = new ViewerPage();
|
||||
const commentsPage: CommentsPage = new CommentsPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const commentsApi = new CommentsApi(apiService.getInstance());
|
||||
|
||||
let userFullName, nodeId;
|
||||
let acsUser: UserModel;
|
||||
@ -93,7 +95,7 @@ describe('Comment', () => {
|
||||
});
|
||||
|
||||
it('[C276947] Should be able to add a comment on ACS and view on ADF', async () => {
|
||||
await apiService.getInstance().core.commentsApi.addComment(nodeId, { content: comments.test });
|
||||
await commentsApi.createComment(nodeId, { content: comments.test });
|
||||
|
||||
await viewerPage.viewFile(pngFileModel.name);
|
||||
|
||||
|
@ -29,7 +29,7 @@ import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { LockFilePage } from '../../content-services/pages/lock-file.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
import { NodeEntry, SitesApi } from '@alfresco/js-api';
|
||||
import { NodeEntry, NodesApi, SitesApi } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Lock File', () => {
|
||||
@ -45,6 +45,7 @@ describe('Lock File', () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const waitActions = new WaitActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const pngFileModel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
@ -56,6 +57,11 @@ describe('Lock File', () => {
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_path
|
||||
});
|
||||
|
||||
const pngFileToLockAdmin = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_C.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_C.file_path
|
||||
});
|
||||
|
||||
let site, documentLibrary;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -73,7 +79,7 @@ describe('Lock File', () => {
|
||||
visibility: 'PRIVATE'
|
||||
});
|
||||
|
||||
const resultNode = await apiService.getInstance().core.nodesApi.getNodeChildren(site.entry.guid);
|
||||
const resultNode = await nodesApi.listNodeChildren(site.entry.guid);
|
||||
|
||||
documentLibrary = resultNode.list.entries[0].entry.id;
|
||||
|
||||
@ -111,7 +117,7 @@ describe('Lock File', () => {
|
||||
afterEach(async () => {
|
||||
await apiService.login(adminUser.username, adminUser.password);
|
||||
try {
|
||||
await apiService.getInstance().core.nodesApi.unlockNode(pngUploadedFile.entry.id);
|
||||
await nodesApi.unlockNode(pngUploadedFile.entry.id);
|
||||
await waitActions.nodeIsUnlock(pngUploadedFile.entry.id);
|
||||
} catch (e) {
|
||||
}
|
||||
@ -120,7 +126,7 @@ describe('Lock File', () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
try {
|
||||
await apiService.getInstance().core.nodesApi.unlockNode(pngLockedUploadedFile.entry.id);
|
||||
await nodesApi.unlockNode(pngLockedUploadedFile.entry.id);
|
||||
} catch (e) {
|
||||
}
|
||||
try {
|
||||
@ -194,7 +200,7 @@ describe('Lock File', () => {
|
||||
await apiService.login(adminUser.username, adminUser.password);
|
||||
|
||||
try {
|
||||
await apiService.getInstance().core.nodesApi.unlockNode(pngUploadedFile.entry.id);
|
||||
await nodesApi.unlockNode(pngUploadedFile.entry.id);
|
||||
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
|
||||
} catch (error) {
|
||||
}
|
||||
@ -209,7 +215,7 @@ describe('Lock File', () => {
|
||||
await lockFilePage.saveButton.click();
|
||||
|
||||
try {
|
||||
await apiService.getInstance().core.nodesApi.deleteNode(pngUploadedFile.entry.id);
|
||||
await nodesApi.deleteNode(pngUploadedFile.entry.id);
|
||||
} catch (error) {
|
||||
await expect(error.status).toEqual(409);
|
||||
}
|
||||
@ -223,7 +229,7 @@ describe('Lock File', () => {
|
||||
await lockFilePage.saveButton.click();
|
||||
|
||||
try {
|
||||
await apiService.getInstance().core.nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
|
||||
await nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
|
||||
|
||||
} catch (error) {
|
||||
await expect(error.status).toEqual(409);
|
||||
@ -238,7 +244,7 @@ describe('Lock File', () => {
|
||||
await lockFilePage.saveButton.click();
|
||||
|
||||
try {
|
||||
await apiService.getInstance().core.nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });
|
||||
await nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });
|
||||
|
||||
} catch (error) {
|
||||
await expect(error.status).toEqual(409);
|
||||
@ -253,7 +259,7 @@ describe('Lock File', () => {
|
||||
await lockFilePage.saveButton.click();
|
||||
|
||||
try {
|
||||
await apiService.getInstance().core.nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
|
||||
await nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
|
||||
} catch (error) {
|
||||
await expect(error.status).toEqual(409);
|
||||
}
|
||||
@ -266,7 +272,7 @@ describe('Lock File', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await apiService.login(adminUser.username, adminUser.password);
|
||||
pngFileToBeLocked = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary);
|
||||
pngFileToBeLocked = await uploadActions.uploadFile(pngFileToLockAdmin.location, pngFileToLockAdmin.name, documentLibrary);
|
||||
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
|
||||
await loginPage.login(adminUser.username, adminUser.password);
|
||||
await navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||
@ -294,7 +300,7 @@ describe('Lock File', () => {
|
||||
try {
|
||||
await apiService.login(adminUser.username, adminUser.password);
|
||||
|
||||
const response = await apiService.getInstance().core.nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
|
||||
const response = await nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
|
||||
await expect(response.entry.modifiedAt.getTime()).toBeGreaterThan(response.entry.createdAt.getTime());
|
||||
} catch (error) {
|
||||
}
|
||||
@ -310,9 +316,9 @@ describe('Lock File', () => {
|
||||
|
||||
try {
|
||||
await apiService.login(adminUser.username, adminUser.password);
|
||||
await apiService.getInstance().core.nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });
|
||||
await nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });
|
||||
|
||||
const movedFile = await apiService.getInstance().core.nodesApi.getNode(pngUploadedFile.entry.id);
|
||||
const movedFile = await nodesApi.getNode(pngUploadedFile.entry.id);
|
||||
|
||||
await expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
|
||||
} catch (error) {
|
||||
@ -320,7 +326,7 @@ describe('Lock File', () => {
|
||||
});
|
||||
|
||||
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', async () => {
|
||||
await contentServices.lockContent(pngFileToLock.name);
|
||||
await contentServices.lockContent(pngFileToLockAdmin.name);
|
||||
|
||||
await lockFilePage.lockFileCheckboxText.waitVisible();
|
||||
await lockFilePage.lockFileCheckbox.click();
|
||||
@ -340,7 +346,7 @@ describe('Lock File', () => {
|
||||
await lockFilePage.saveButton.click();
|
||||
|
||||
try {
|
||||
const response = await apiService.getInstance().core.nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
|
||||
const response = await nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
|
||||
await expect(response.entry.name).toEqual('My new name');
|
||||
} catch (error) {
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import {
|
||||
ApiService,
|
||||
BrowserActions,
|
||||
BrowserActions, Logger,
|
||||
LoginPage,
|
||||
NotificationHistoryPage,
|
||||
PermissionActions,
|
||||
@ -37,6 +37,7 @@ import { MetadataViewPage } from '../../core/pages/metadata-view.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
|
||||
import { NotificationDemoPage } from '../../core/pages/notification.page';
|
||||
import { GroupsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Permissions Component', () => {
|
||||
|
||||
@ -50,6 +51,7 @@ describe('Permissions Component', () => {
|
||||
const notificationPage = new NotificationDemoPage();
|
||||
const searchService = new SearchService(apiService);
|
||||
const permissionActions = new PermissionActions(apiService);
|
||||
const groupsApi = new GroupsApi(apiService.getInstance());
|
||||
|
||||
const contentList = contentServicesPage.getDocumentList();
|
||||
const viewerPage = new ViewerPage();
|
||||
@ -94,7 +96,7 @@ describe('Permissions Component', () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await usersActions.createUser(fileOwnerUser);
|
||||
await usersActions.createUser(filePermissionUser);
|
||||
await apiService.getInstance().core.groupsApi.createGroup(groupBody);
|
||||
await groupsApi.createGroup(groupBody);
|
||||
|
||||
await apiService.login(fileOwnerUser.username, fileOwnerUser.password);
|
||||
roleConsumerFolder = await uploadActions.createFolder(roleConsumerFolderModel.name, '-my-');
|
||||
@ -119,7 +121,7 @@ describe('Permissions Component', () => {
|
||||
try {
|
||||
await searchService.isUserSearchable(filePermissionUser);
|
||||
} catch (e) {
|
||||
console.error(`*****\n Failed to sync user \n*****`);
|
||||
Logger.error(`*****\n Failed to sync user \n*****`);
|
||||
}
|
||||
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
|
||||
} catch (e) {
|
||||
|
@ -32,13 +32,11 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
import { SharedLinkEntry, SharedLinkPaging } from '@alfresco/js-api';
|
||||
import { SharedLinkEntry, SharedLinkPaging, SharedlinksApi } from '@alfresco/js-api';
|
||||
import { CustomSourcesPage } from '../../core/pages/custom-sources.page';
|
||||
|
||||
describe('Share file', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentListPage = contentServicesPage.getDocumentList();
|
||||
@ -47,8 +45,14 @@ describe('Share file', () => {
|
||||
const customSourcesPage = new CustomSourcesPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
|
||||
let acsUser: UserModel;
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const sharedLinksApi = new SharedlinksApi(apiService.getInstance());
|
||||
|
||||
const pngFileModel = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
|
||||
@ -67,7 +71,7 @@ describe('Share file', () => {
|
||||
|
||||
const apiCall = async () => {
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
return apiService.getInstance().core.sharedlinksApi.findSharedLinks();
|
||||
return sharedLinksApi.listSharedLinks();
|
||||
};
|
||||
|
||||
return ApiUtil.waitForApi(apiCall, predicate, 10, 2000);
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { PermissionsPage } from '../../content-services/pages/permissions.page';
|
||||
import {
|
||||
ApiService,
|
||||
BrowserActions,
|
||||
BrowserActions, Logger,
|
||||
LoginPage,
|
||||
NotificationHistoryPage, SearchService,
|
||||
StringUtil,
|
||||
@ -35,7 +35,7 @@ import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { VersionManagePage } from '../../core/pages/version-manager.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { SitesApi } from '@alfresco/js-api';
|
||||
import { NodesApi, SitesApi } from '@alfresco/js-api';
|
||||
import { NotificationDemoPage } from '../../core/pages/notification.page';
|
||||
|
||||
describe('Permissions Component', () => {
|
||||
@ -43,6 +43,7 @@ describe('Permissions Component', () => {
|
||||
const apiService = new ApiService();
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const searchService = new SearchService(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
@ -142,7 +143,7 @@ describe('Permissions Component', () => {
|
||||
siteFolder = await uploadActions.createFolder(folderName, publicSite.entry.guid);
|
||||
privateSiteFile = await uploadActions.uploadFile(fileModel.location, 'privateSite' + fileModel.name, privateSite.entry.guid);
|
||||
|
||||
await apiService.getInstance().core.nodesApi.updateNode(privateSiteFile.entry.id,
|
||||
await nodesApi.updateNode(privateSiteFile.entry.id,
|
||||
{
|
||||
permissions: {
|
||||
locallySet: [{
|
||||
@ -159,7 +160,7 @@ describe('Permissions Component', () => {
|
||||
try {
|
||||
await searchService.isUserSearchable(consumerUser);
|
||||
} catch (e) {
|
||||
console.error(`*****\n Failed to sync user \n*****`);
|
||||
Logger.error(`*****\n Failed to sync user \n*****`);
|
||||
}
|
||||
await browser.sleep(browser.params.testConfig.timeouts.index_search);
|
||||
} catch (error) {
|
||||
|
@ -28,6 +28,7 @@ import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { SocialPage } from '../../content-services/pages/social.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Social component', () => {
|
||||
|
||||
@ -43,6 +44,7 @@ describe('Social component', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const blueLikeColor = ('rgba(33, 150, 243, 1)');
|
||||
const greyLikeColor = ('rgba(128, 128, 128, 1)');
|
||||
@ -67,7 +69,7 @@ describe('Social component', () => {
|
||||
|
||||
emptyFile = await uploadActions.uploadFile(emptyFileModel.location, emptyFileModel.name, '-my-');
|
||||
|
||||
await apiService.getInstance().core.nodesApi.updateNode(emptyFile.entry.id,
|
||||
await nodesApi.updateNode(emptyFile.entry.id,
|
||||
|
||||
{
|
||||
permissions: {
|
||||
|
@ -27,6 +27,7 @@ import {
|
||||
import { TagPage } from '../../content-services/pages/tag.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TagsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Tag component', () => {
|
||||
|
||||
@ -37,6 +38,7 @@ describe('Tag component', () => {
|
||||
let acsUser: UserModel;
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const tagsApi = new TagsApi(apiService.getInstance());
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const pdfFileModel = new FileModel({ name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name });
|
||||
@ -73,7 +75,7 @@ describe('Tag component', () => {
|
||||
|
||||
Object.assign(deleteFile, uploadedDeleteFile.entry);
|
||||
|
||||
await apiService.getInstance().core.tagsApi.addTag(nodeId, tags);
|
||||
await tagsApi.createTagForNode(nodeId, tags);
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
await navigationBarPage.clickTagButton();
|
||||
|
@ -18,6 +18,7 @@
|
||||
import { ApiService, LoginPage, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TreeViewPage } from './../pages/tree-view.page';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Tree View Component', () => {
|
||||
|
||||
@ -28,8 +29,8 @@ describe('Tree View Component', () => {
|
||||
let acsUser: UserModel;
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
let treeFolder, secondTreeFolder, thirdTreeFolder;
|
||||
|
||||
@ -48,19 +49,19 @@ describe('Tree View Component', () => {
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
treeFolder = await apiService.getInstance().nodes.addNode(nodeNames.parentFolder, {
|
||||
treeFolder = await nodesApi.createNode(nodeNames.parentFolder, {
|
||||
name: nodeNames.folder,
|
||||
nodeType: 'cm:folder'
|
||||
});
|
||||
secondTreeFolder = await apiService.getInstance().nodes.addNode(nodeNames.parentFolder, {
|
||||
secondTreeFolder = await nodesApi.createNode(nodeNames.parentFolder, {
|
||||
name: nodeNames.secondFolder,
|
||||
nodeType: 'cm:folder'
|
||||
});
|
||||
thirdTreeFolder = await apiService.getInstance().nodes.addNode(secondTreeFolder.entry.id, {
|
||||
thirdTreeFolder = await nodesApi.createNode(secondTreeFolder.entry.id, {
|
||||
name: nodeNames.thirdFolder,
|
||||
nodeType: 'cm:folder'
|
||||
});
|
||||
await apiService.getInstance().nodes.addNode(thirdTreeFolder.entry.id, {
|
||||
await nodesApi.createNode(thirdTreeFolder.entry.id, {
|
||||
name: nodeNames.document,
|
||||
nodeType: 'cm:content'
|
||||
});
|
||||
|
@ -27,7 +27,7 @@ import {
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NodeEntry, SitesApi } from '@alfresco/js-api';
|
||||
import { NodeEntry, NodesApi, SharedlinksApi, SitesApi } from '@alfresco/js-api';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page';
|
||||
@ -47,6 +47,8 @@ describe('Unshare file', () => {
|
||||
const apiService = new ApiService();
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
const sharedlinksApi = new SharedlinksApi(apiService.getInstance());
|
||||
|
||||
const siteName = `PRIVATE-TEST-SITE-${StringUtil.generateRandomString(5)}`;
|
||||
let acsUser: UserModel;
|
||||
@ -82,13 +84,13 @@ describe('Unshare file', () => {
|
||||
shareFilesSite = await sitesApi.createSite(site);
|
||||
|
||||
const docLibId = (await sitesApi.listSiteContainers(siteName)).list.entries[0].entry.id;
|
||||
const testFile1Id = (await apiService.getInstance().core.nodesApi.addNode(docLibId, nodeBody)).entry.id;
|
||||
const testFile1Id = (await nodesApi.createNode(docLibId, nodeBody)).entry.id;
|
||||
await sitesApi.createSiteMembership(siteName, {
|
||||
id: acsUser.username,
|
||||
role: CONSTANTS.CS_USER_ROLES.CONSUMER
|
||||
});
|
||||
|
||||
await apiService.getInstance().core.nodesApi.updateNode(testFile1Id, {
|
||||
await nodesApi.updateNode(testFile1Id, {
|
||||
permissions: {
|
||||
isInheritanceEnabled: false,
|
||||
locallySet: [
|
||||
@ -99,7 +101,7 @@ describe('Unshare file', () => {
|
||||
]
|
||||
}
|
||||
});
|
||||
await apiService.getInstance().core.sharedlinksApi.addSharedLink({ nodeId: testFile1Id });
|
||||
await sharedlinksApi.createSharedLink({ nodeId: testFile1Id });
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
@ -269,6 +269,7 @@ describe('Delete Directive', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
try {
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
await sitesApi.deleteSite(createdSite.entry.id, { permanent: true });
|
||||
} catch (error) {}
|
||||
|
@ -30,6 +30,7 @@ import { FolderDialogPage } from '../../core/pages/dialog/folder-dialog.page';
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Edit folder directive', () => {
|
||||
|
||||
@ -40,8 +41,10 @@ describe('Edit folder directive', () => {
|
||||
const anotherAcsUser = new UserModel();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const pdfFile = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||
@ -63,7 +66,7 @@ describe('Edit folder directive', () => {
|
||||
subFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), editFolder.entry.id);
|
||||
filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
|
||||
|
||||
await apiService.getInstance().core.nodesApi.updateNode(editFolder.entry.id,
|
||||
await nodesApi.updateNode(editFolder.entry.id,
|
||||
|
||||
{
|
||||
permissions: {
|
||||
|
@ -264,20 +264,6 @@ describe('Document List Component', () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(testFile.name);
|
||||
});
|
||||
|
||||
it('[C261997] Should be able to clean Recent Files history', async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
const cleanUser = await usersActions.createUser();
|
||||
|
||||
await loginPage.login(cleanUser.username, cleanUser.password);
|
||||
await contentServicesPage.clickOnContentServices();
|
||||
await contentServicesPage.checkRecentFileToBeShowed();
|
||||
const icon = await contentServicesPage.getRecentFileIcon();
|
||||
await expect(icon).toBe('history');
|
||||
await contentServicesPage.expandRecentFiles();
|
||||
await contentServicesPage.checkEmptyRecentFileIsDisplayed();
|
||||
await contentServicesPage.closeRecentFiles();
|
||||
});
|
||||
|
||||
it('[C279970] Should display Islocked field for folders', async () => {
|
||||
const folderNameA = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
|
||||
const folderNameB = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
|
||||
|
@ -31,7 +31,7 @@ import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { SitesApi } from '@alfresco/js-api';
|
||||
import { NodesApi, SitesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
|
||||
@ -40,9 +40,10 @@ describe('Document List Component', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
||||
let uploadedFolder, uploadedFile, sourceFolder, destinationFolder, subFolder, subFolder2, copyFolder, subFile,
|
||||
@ -89,7 +90,7 @@ describe('Document List Component', () => {
|
||||
await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, uploadedFolder.entry.id);
|
||||
await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, sourceFolder.entry.id);
|
||||
uploadedFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
|
||||
await apiService.getInstance().core.nodesApi.updateNode(sourceFolder.entry.id,
|
||||
await nodesApi.updateNode(sourceFolder.entry.id,
|
||||
{
|
||||
permissions: {
|
||||
locallySet: [{
|
||||
|
@ -39,6 +39,7 @@ describe('Document List Component - Properties', () => {
|
||||
});
|
||||
|
||||
describe('Allow drop files property', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
@ -49,6 +50,9 @@ describe('Document List Component - Properties', () => {
|
||||
subFolder = await uploadActions.createFolder('subFolder', parentFolder.entry.id);
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
|
||||
await navigationBar.navigateToContentServices();
|
||||
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
@ -59,9 +63,6 @@ describe('Document List Component - Properties', () => {
|
||||
});
|
||||
|
||||
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
|
||||
await navigationBar.navigateToContentServices();
|
||||
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await contentServicesPage.openFolder(parentFolder.entry.name);
|
||||
await contentServicesPage.disableDropFilesInAFolder();
|
||||
await browser.sleep(1000);
|
||||
@ -75,9 +76,6 @@ describe('Document List Component - Properties', () => {
|
||||
});
|
||||
|
||||
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => {
|
||||
await navigationBar.navigateToContentServices();
|
||||
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await contentServicesPage.openFolder(parentFolder.entry.name);
|
||||
await contentServicesPage.enableDropFilesInAFolder();
|
||||
await browser.sleep(1000);
|
||||
|
@ -30,6 +30,7 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { CustomModelApi, NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Aspect oriented config', () => {
|
||||
|
||||
@ -40,8 +41,11 @@ describe('Aspect oriented config', () => {
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const modelOneName = 'modelOne', emptyAspectName = 'emptyAspect';
|
||||
const defaultModel = 'cm', defaultEmptyPropertiesAspect = 'taggable', aspectName = 'Taggable';
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
const customModelApi = new CustomModelApi(apiService.getInstance());
|
||||
|
||||
let acsUser: UserModel;
|
||||
|
||||
@ -57,12 +61,12 @@ describe('Aspect oriented config', () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
try {
|
||||
await apiService.getInstance().core.customModelApi.createCustomModel('ACTIVE', modelOneName, modelOneName, modelOneName, modelOneName);
|
||||
await customModelApi.createCustomModel('ACTIVE', modelOneName, modelOneName, modelOneName, modelOneName);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
try {
|
||||
await apiService.getInstance().core.customModelApi.createCustomAspect(modelOneName, emptyAspectName, null, emptyAspectName, emptyAspectName);
|
||||
await customModelApi.createCustomAspect(modelOneName, emptyAspectName, null, emptyAspectName, emptyAspectName);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
@ -74,13 +78,13 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
await loginPage.login(acsUser.username, acsUser.password);
|
||||
|
||||
const aspects = await apiService.getInstance().core.nodesApi.getNode(uploadedFile.entry.id);
|
||||
const aspects = await nodesApi.getNode(uploadedFile.entry.id);
|
||||
|
||||
aspects.entry.aspectNames.push(modelOneName.concat(':', emptyAspectName));
|
||||
|
||||
aspects.entry.aspectNames.push(defaultModel.concat(':', defaultEmptyPropertiesAspect));
|
||||
|
||||
await apiService.getInstance().core.nodesApi.updateNode(uploadedFile.entry.id, { aspectNames: aspects.entry.aspectNames });
|
||||
await nodesApi.updateNode(uploadedFile.entry.id, { aspectNames: aspects.entry.aspectNames });
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
@ -24,7 +24,8 @@ import {
|
||||
UploadActions,
|
||||
UserModel,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
ViewerPage,
|
||||
Logger
|
||||
} from '@alfresco/adf-testing';
|
||||
import { CustomModel, CustomType } from '@alfresco/js-api';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
@ -94,7 +95,7 @@ describe('content type', () => {
|
||||
await modelActions.deactivateCustomModel(model.name);
|
||||
await modelActions.deleteCustomModel(model.name);
|
||||
} catch (e) {
|
||||
console.error('failed to delete the model', e);
|
||||
Logger.error('failed to delete the model {e}');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -60,6 +60,7 @@ describe('Upload - User permission', () => {
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
|
||||
consumerSite = await sitesApi.createSite({
|
||||
|
@ -31,7 +31,7 @@ import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { SitesApi } from '@alfresco/js-api';
|
||||
import { NodesApi, SitesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Version component permissions', () => {
|
||||
|
||||
@ -52,6 +52,7 @@ describe('Version component permissions', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const newVersionFile = new FileModel({
|
||||
'name': browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
|
||||
@ -114,7 +115,7 @@ describe('Version component permissions', () => {
|
||||
const lockFileUploaded = await uploadActions.uploadFile(lockFileModel.location, lockFileModel.name, site.entry.guid);
|
||||
Object.assign(lockFileModel, lockFileUploaded.entry);
|
||||
|
||||
await apiService.getInstance().nodes.lockNode(lockFileModel.id, {
|
||||
await nodesApi.lockNode(lockFileModel.id, {
|
||||
type: 'FULL',
|
||||
lifetime: 'PERSISTENT'
|
||||
});
|
||||
@ -150,7 +151,7 @@ describe('Version component permissions', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().nodes.deleteNode(sameCreatorFile.id);
|
||||
await nodesApi.deleteNode(sameCreatorFile.id);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@ -222,7 +223,7 @@ describe('Version component permissions', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().nodes.deleteNode(sameCreatorFile.id);
|
||||
await nodesApi.deleteNode(sameCreatorFile.id);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@ -277,7 +278,7 @@ describe('Version component permissions', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().nodes.deleteNode(sameCreatorFile.id);
|
||||
await nodesApi.deleteNode(sameCreatorFile.id);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
|
@ -250,7 +250,7 @@ export class MetadataViewPage {
|
||||
async changeContentType(option: string, attempt = 0, maxAttempt = 3): Promise<boolean> {
|
||||
const nodeType = TestElement.byCss('div[data-automation-id="header-nodeType"] .mat-select-trigger');
|
||||
if (attempt > maxAttempt) {
|
||||
console.error(`content type select option not found. check acs version may be lesser than 7.0.0`);
|
||||
Logger.error(`content type select option not found. check acs version may be lesser than 7.0.0`);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
|
@ -88,10 +88,11 @@ describe('Viewer', () => {
|
||||
|
||||
it('[C280008] Should be possible to open any Excel file', async () => {
|
||||
await contentServicesPage.doubleClickRow('excel');
|
||||
|
||||
for (const currentFile of uploadedExcels) {
|
||||
if (currentFile.entry.name !== '.DS_Store') {
|
||||
await contentServicesPage.doubleClickRow(currentFile.entry.name);
|
||||
await viewerPage.checkFileIsLoaded(currentFile.entry.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ describe('Viewer', () => {
|
||||
for (const image of uploadedImages) {
|
||||
if (image.entry.name !== '.DS_Store') {
|
||||
await contentServicesPage.doubleClickRow(image.entry.name);
|
||||
await viewerPage.checkImgViewerIsDisplayed();
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
}
|
||||
@ -109,7 +109,7 @@ describe('Viewer', () => {
|
||||
for (const item of uploadedImgRenditionFolderInfo) {
|
||||
if (item.entry.name !== '.DS_Store') {
|
||||
await contentServicesPage.doubleClickRow(item.entry.name);
|
||||
await viewerPage.checkFileIsLoaded();
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ describe('Viewer', () => {
|
||||
for (const currentFile of uploadedPpt) {
|
||||
if (currentFile.entry.name !== '.DS_Store') {
|
||||
await contentServicesPage.doubleClickRow(currentFile.entry.name);
|
||||
await viewerPage.checkFileIsLoaded();
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ describe('Viewer', () => {
|
||||
for (const currentFile of uploadedTexts) {
|
||||
if (currentFile.entry.name !== '.DS_Store') {
|
||||
await contentServicesPage.doubleClickRow(currentFile.entry.name);
|
||||
await viewerPage.checkFileIsLoaded();
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ describe('Viewer', () => {
|
||||
for (const currentFile of uploadedWords) {
|
||||
if (currentFile.entry.name !== '.DS_Store') {
|
||||
await contentServicesPage.doubleClickRow(currentFile.entry.name);
|
||||
await viewerPage.checkFileIsLoaded();
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,9 @@ describe('Content Services Viewer', () => {
|
||||
|
||||
describe('Usual type files', () => {
|
||||
it('[C260038] Should display first page, toolbar and pagination when opening a .pdf file', async () => {
|
||||
await viewerPage.viewFile(pdfFile.name);
|
||||
await contentServicesPage.doubleClickRow(pdfFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
|
||||
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
|
||||
@ -156,7 +158,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C260040] Should be able to change pages and zoom when .pdf file is open', async () => {
|
||||
await viewerPage.viewFile(pdfFile.name);
|
||||
await contentServicesPage.doubleClickRow(pdfFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
|
||||
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
|
||||
@ -190,7 +194,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C260042] Should be able to download, open full-screen and Info container from the Viewer', async () => {
|
||||
await viewerPage.viewFile(jpgFile.name);
|
||||
await contentServicesPage.doubleClickRow(jpgFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
|
||||
await viewerPage.checkImgContainerIsDisplayed();
|
||||
@ -207,7 +213,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C260052] Should display image, toolbar and pagination when opening a .jpg file', async () => {
|
||||
await viewerPage.viewFile(jpgFile.name);
|
||||
await contentServicesPage.doubleClickRow(jpgFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
|
||||
await viewerPage.checkImgContainerIsDisplayed();
|
||||
@ -227,7 +235,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C260483] Should be able to zoom and rotate image when .jpg file is open', async () => {
|
||||
await viewerPage.viewFile(jpgFile.name);
|
||||
await contentServicesPage.doubleClickRow(jpgFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
|
||||
await viewerPage.checkPercentageIsDisplayed();
|
||||
@ -244,7 +254,8 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C279922] Should display first page, toolbar and pagination when opening a .ppt file', async () => {
|
||||
await viewerPage.viewFile(pptFile.name);
|
||||
await contentServicesPage.doubleClickRow(pptFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
|
||||
await viewerPage.checkFileContent('1', pptFile.firstPageText);
|
||||
@ -264,7 +275,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C291903] Should display the buttons in order in the adf viewer toolbar', async () => {
|
||||
await viewerPage.viewFile(pdfFile.name);
|
||||
await contentServicesPage.doubleClickRow(pdfFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkLeftSideBarIsNotDisplayed();
|
||||
await viewerPage.clickLeftSidebarButton();
|
||||
await viewerPage.checkLeftSideBarIsDisplayed();
|
||||
@ -275,7 +288,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C260053] Should display first page, toolbar and pagination when opening a .docx file', async () => {
|
||||
await viewerPage.viewFile(docxFile.name);
|
||||
await contentServicesPage.doubleClickRow(docxFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
|
||||
await viewerPage.checkFileContent('1', docxFile.firstPageText);
|
||||
@ -295,7 +310,8 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C260054] Should display Preview could not be loaded and viewer toolbar when opening an unsupported file', async () => {
|
||||
await viewerPage.viewFile(unsupportedFile.name);
|
||||
await contentServicesPage.doubleClickRow(unsupportedFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkCloseButtonIsDisplayed();
|
||||
await viewerPage.checkFileNameIsDisplayed(unsupportedFile.name);
|
||||
@ -311,7 +327,8 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C260056] Should display video and viewer toolbar when opening a media file', async () => {
|
||||
await viewerPage.viewFile(mp4File.name);
|
||||
await contentServicesPage.doubleClickRow(mp4File.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkMediaPlayerContainerIsDisplayed();
|
||||
await viewerPage.checkCloseButtonIsDisplayed();
|
||||
@ -327,7 +344,8 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C261123] Should be able to preview all pages and navigate to a page when using thumbnails', async () => {
|
||||
await viewerPage.viewFile(pdfFile.name);
|
||||
await contentServicesPage.doubleClickRow(pdfFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
|
||||
@ -357,7 +375,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C268105] Should display current thumbnail when getting to the page following the last visible thumbnail', async () => {
|
||||
await viewerPage.viewFile(pdfFile.name);
|
||||
await contentServicesPage.doubleClickRow(pdfFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
|
||||
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
|
||||
@ -385,7 +405,8 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C268901] Should need a password when opening a protected file', async () => {
|
||||
await viewerPage.viewFile(protectedFile.name);
|
||||
await contentServicesPage.doubleClickRow(protectedFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkZoomInButtonIsDisplayed();
|
||||
await viewerPage.checkPasswordDialogIsDisplayed();
|
||||
@ -404,7 +425,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
it('[C307985] Should close the viewer when password dialog is cancelled', async () => {
|
||||
await viewerPage.viewFile(protectedFile.name);
|
||||
await contentServicesPage.doubleClickRow(protectedFile.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.checkPasswordDialogIsDisplayed();
|
||||
await viewerPage.clickClosePasswordDialog();
|
||||
await contentServicesPage.checkContentIsDisplayed(protectedFile.name);
|
||||
@ -429,7 +452,9 @@ describe('Content Services Viewer', () => {
|
||||
});
|
||||
|
||||
async function uploadNewVersion(originalFileName: string, newVersionLocation: string): Promise<void> {
|
||||
await viewerPage.viewFile(originalFileName);
|
||||
await contentServicesPage.doubleClickRow(originalFileName);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.clickCloseButton();
|
||||
await contentServicesPage.versionManagerContent(originalFileName);
|
||||
await versionManagePage.showNewVersionButton.click();
|
||||
@ -440,14 +465,17 @@ describe('Content Services Viewer', () => {
|
||||
}
|
||||
|
||||
async function previewUnsupportedFile(unsupportedFileName: string): Promise<void> {
|
||||
await viewerPage.viewFile(unsupportedFileName);
|
||||
await contentServicesPage.doubleClickRow(unsupportedFileName);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.checkUnknownFormatIsDisplayed();
|
||||
await expect(await viewerPage.getUnknownFormatMessage()).toBe('Couldn\'t load preview. Unknown format.');
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
|
||||
async function changeFileNameInViewer(fileName: string, newName: string): Promise<void> {
|
||||
await viewerPage.viewFile(fileName);
|
||||
await contentServicesPage.doubleClickRow(fileName);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
|
||||
await viewerPage.clickInfoButton();
|
||||
await viewerPage.checkInfoSideBarIsDisplayed();
|
||||
await viewerPage.clickOnTab('Properties');
|
||||
|
@ -67,6 +67,7 @@ describe('Viewer', () => {
|
||||
beforeEach(async () => {
|
||||
await contentServicesPage.goToDocumentList();
|
||||
await contentServicesPage.doubleClickRow(txtFileUploaded.entry.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
@ -99,6 +100,7 @@ describe('Viewer', () => {
|
||||
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
await versionManagePage.closeVersionDialog();
|
||||
await contentServicesPage.doubleClickRow(txtFileUploaded.entry.name);
|
||||
await viewerPage.waitTillContentLoaded();
|
||||
await viewerPage.clickInfoButton();
|
||||
await viewerPage.clickOnTab('Versions');
|
||||
await versionManagePage.viewFileVersion('1.0');
|
||||
|
@ -31,7 +31,7 @@ import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { SitesApi } from '@alfresco/js-api';
|
||||
import { SharedlinksApi, SitesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Viewer', () => {
|
||||
|
||||
@ -44,6 +44,7 @@ describe('Viewer', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const sharedlinksApi = new SharedlinksApi(apiService);
|
||||
|
||||
let site;
|
||||
const acsUser = new UserModel();
|
||||
@ -86,7 +87,7 @@ describe('Viewer', () => {
|
||||
|
||||
wordFileUploaded = await uploadActions.uploadFile(wordFileInfo.location, wordFileInfo.name, '-my-');
|
||||
|
||||
pngFileShared = await apiService.getInstance().core.sharedlinksApi.addSharedLink({ 'nodeId': pngFileUploaded.entry.id });
|
||||
pngFileShared = await sharedlinksApi.createSharedLink({ 'nodeId': pngFileUploaded.entry.id });
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
@ -45,7 +45,7 @@ describe('Analytics Smoke Test', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(procUserModel.tenantId);
|
||||
await usersActions.deleteTenant(procUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260346] Should be able to change title of a report', async () => {
|
||||
|
@ -123,10 +123,9 @@ describe('Edit task filters and task list properties', () => {
|
||||
}));
|
||||
}, 5 * 60 * 1000);
|
||||
|
||||
afterAll(async (done) => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Edit task filters and task list properties - sort properties', () => {
|
||||
|
@ -97,10 +97,9 @@ describe('Edit task filters and task list properties', () => {
|
||||
await LocalStorageUtil.setConfigField('adf-edit-task-filter', JSON.stringify(taskFilterConfiguration));
|
||||
}, 5 * 60 * 1000);
|
||||
|
||||
afterAll(async (done) => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Edit task filters and task list properties - filter properties', () => {
|
||||
|
@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ModelsActions, ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ModelsActions } from '../../actions/APS/models.actions';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AppDefinitionsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Modify applications', () => {
|
||||
|
||||
@ -37,6 +37,7 @@ describe('Modify applications', () => {
|
||||
const apps = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const appsApi = new AppDefinitionsApi(apiService.getInstance());
|
||||
|
||||
let firstApp, appVersionToBeDeleted;
|
||||
|
||||
@ -105,8 +106,8 @@ describe('Modify applications', () => {
|
||||
|
||||
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
|
||||
|
||||
await modelActions.deleteVersionModel(appVersionToBeDeleted.id);
|
||||
await modelActions.deleteVersionModel(appVersionToBeDeleted.id);
|
||||
await modelActions.deleteModel(appVersionToBeDeleted.id);
|
||||
await modelActions.deleteModel(appVersionToBeDeleted.id);
|
||||
await apps.publishDeployApp(appVersionToBeDeleted.id);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
@ -134,7 +135,7 @@ describe('Modify applications', () => {
|
||||
}, 'publish': true
|
||||
};
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.updateAppDefinition(appVersionToBeDeleted.id, appDefinition);
|
||||
await appsApi.updateAppDefinition(appVersionToBeDeleted.id, appDefinition);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
|
@ -74,41 +74,36 @@ describe('Attach File - Content service', () => {
|
||||
const csIntegrations = ['adf dev', 'adf master'];
|
||||
let user: UserModel;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
beforeAll(async () => {
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ALL');
|
||||
try {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiServiceExternal.loginWithProfile('admin');
|
||||
await usersActionsExternal.createUser(user);
|
||||
await apiServiceExternal.loginWithProfile('admin');
|
||||
await usersActionsExternal.createUser(user);
|
||||
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[0],
|
||||
host: browser.params.testConfig.appConfig.ecmHost
|
||||
});
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[1],
|
||||
host: browser.params.testConfig.adf_external_acs.host
|
||||
});
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[0],
|
||||
host: browser.params.testConfig.appConfig.ecmHost
|
||||
});
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[1],
|
||||
host: browser.params.testConfig.adf_external_acs.host
|
||||
});
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
await apiService.login(user.username, user.password);
|
||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await searchService.isSearchable(pdfFileTwo.name);
|
||||
await searchService.isSearchable(externalFile);
|
||||
} catch (error) {
|
||||
console.error('Preconditions failed check if the external env is up and running');
|
||||
}
|
||||
done();
|
||||
await searchService.isSearchable(pdfFileTwo.name);
|
||||
await searchService.isSearchable(externalFile);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -61,7 +61,7 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C274690] Should be able to open a file attached to a start form', async () => {
|
||||
|
@ -72,7 +72,7 @@ describe('Attach Folder', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C246534] Attach folder - ACS', async () => {
|
||||
|
@ -15,13 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, FormFields, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
FormFields,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AttachFormPage } from './../pages/attach-form.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Attach Form Component', () => {
|
||||
@ -37,6 +44,8 @@ describe('Attach Form Component', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
const formTextField = app.form_fields.form_fieldId;
|
||||
let user, tenantId, appModel;
|
||||
@ -60,15 +69,14 @@ describe('Attach Form Component', () => {
|
||||
|
||||
appModel = await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: testNames.taskName }));
|
||||
|
||||
await taskUtil.createStandaloneTask(testNames.taskName);
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appModel.id);
|
||||
await modelsActions.deleteModel(appModel.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C280047] Should be able to view the attach-form component after creating a standalone task', async () => {
|
||||
|
@ -15,15 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ApiService, 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 { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Checklist component', () => {
|
||||
@ -38,6 +35,8 @@ describe('Checklist component', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
|
||||
@ -51,15 +50,12 @@ describe('Checklist component', () => {
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
|
||||
for (let i = 0; i < tasks.length; i++) {
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[i] }));
|
||||
await taskUtil.createStandaloneTask(tasks[i]);
|
||||
}
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
|
@ -20,7 +20,7 @@ import {
|
||||
ApplicationsUtil,
|
||||
DatePickerCalendarPage,
|
||||
DateUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
@ -37,8 +37,10 @@ describe('Dynamic Table', () => {
|
||||
const datePicker = new DatePickerCalendarPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
let user, tenantId, appId;
|
||||
|
||||
@ -50,7 +52,7 @@ describe('Dynamic Table', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
describe('Date Picker', () => {
|
||||
@ -77,7 +79,7 @@ describe('Dynamic Table', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.login(user.username, user.password);
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@ -140,7 +142,7 @@ describe('Dynamic Table', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.login(user.username, user.password);
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -63,7 +63,7 @@ describe('Form Component', () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C286505] Should be able to display errors under the Error Log section', async () => {
|
||||
|
@ -29,6 +29,7 @@ import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { TaskFormsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Form widgets - People ', () => {
|
||||
|
||||
@ -44,6 +45,7 @@ describe('Form widgets - People ', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
@ -65,7 +67,7 @@ describe('Form widgets - People ', () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
@ -83,7 +85,7 @@ describe('Form widgets - People ', () => {
|
||||
await processDetailsPage.activeTask.click();
|
||||
|
||||
const taskId = await taskDetails.getId();
|
||||
const taskForm: any = await apiService.getInstance().activiti.taskApi.getTaskForm(taskId);
|
||||
const taskForm: any = await taskFormsApi.getTaskForm(taskId);
|
||||
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
|
||||
await expect(userEmail).toEqual(processUserModel.email);
|
||||
});
|
||||
@ -103,7 +105,7 @@ describe('Form widgets - People ', () => {
|
||||
await processDetailsPage.completedTask.click();
|
||||
|
||||
const taskId = await taskDetails.getId();
|
||||
const taskForm: any = await apiService.getInstance().activiti.taskApi.getTaskForm(taskId);
|
||||
const taskForm: any = await taskFormsApi.getTaskForm(taskId);
|
||||
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
|
||||
await expect(userEmail).toEqual(processUserModel.email);
|
||||
});
|
||||
|
@ -28,6 +28,7 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import FormDefinitionModel = require('../../models/APS/FormDefinitionModel');
|
||||
import { TaskFormsApi } from '@alfresco/js-api';
|
||||
|
||||
const formInstance = new FormDefinitionModel();
|
||||
|
||||
@ -40,6 +41,8 @@ describe('Form widgets', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
const newTask = 'First task';
|
||||
let processUserModel;
|
||||
@ -76,7 +79,7 @@ describe('Form widgets', () => {
|
||||
|
||||
const response = await taskPage.taskDetails().getId();
|
||||
|
||||
const formDefinition = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(response);
|
||||
const formDefinition = await taskFormsApi.getTaskForm(response);
|
||||
formInstance.setFields(formDefinition.fields);
|
||||
formInstance.setAllWidgets(formDefinition.fields);
|
||||
});
|
||||
@ -85,7 +88,7 @@ describe('Form widgets', () => {
|
||||
await new NavigationBarPage().clickLogoutButton();
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
await apiService.getInstance().logout();
|
||||
});
|
||||
|
||||
@ -206,7 +209,6 @@ describe('Form widgets', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
process = await processUtil.startProcessOfApp(appModel.name);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
@ -219,9 +221,9 @@ describe('Form widgets', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260405] Value fields configured with process variables', async () => {
|
||||
|
@ -15,14 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, TaskUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('People component', () => {
|
||||
@ -36,6 +33,8 @@ describe('People component', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const applicationUtil = new ApplicationsUtil(apiService);
|
||||
|
||||
let processUserModel, assigneeUserModel, secondAssigneeUserModel;
|
||||
const peopleTitle = 'People this task is shared with ';
|
||||
@ -49,18 +48,15 @@ describe('People component', () => {
|
||||
secondAssigneeUserModel = await usersActions.createUser(new UserModel({ tenantId: assigneeUserModel.tenantId }));
|
||||
processUserModel = await usersActions.createUser(new UserModel({ tenantId: assigneeUserModel.tenantId }));
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
await applicationUtil.importApplication(app.file_path);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[0] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[1] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[2] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[3] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[4] }));
|
||||
await taskUtil.createStandaloneTask(tasks[0]);
|
||||
await taskUtil.createStandaloneTask(tasks[1]);
|
||||
await taskUtil.createStandaloneTask(tasks[2]);
|
||||
await taskUtil.createStandaloneTask(tasks[3]);
|
||||
await taskUtil.createStandaloneTask(tasks[4]);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -64,7 +64,7 @@ describe('Stencil', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -16,10 +16,18 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} 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';
|
||||
|
||||
describe('Comment component for Processes', () => {
|
||||
|
||||
@ -33,6 +41,9 @@ describe('Comment component for Processes', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const commentsApi = new ActivitiCommentsApi(apiService.getInstance());
|
||||
const taskApi = new TasksApi(apiService.getInstance());
|
||||
|
||||
let user, appId, processInstanceId, addedComment;
|
||||
const processName = 'Comment APS';
|
||||
@ -54,20 +65,20 @@ describe('Comment component for Processes', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C260464] Should be able to add a comment on APS and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({ message: 'HELLO' }, processInstanceId);
|
||||
await commentsApi.addProcessInstanceComment({ message: 'HELLO' }, processInstanceId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList(processName);
|
||||
|
||||
addedComment = await apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
addedComment = await commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
@ -78,34 +89,34 @@ describe('Comment component for Processes', () => {
|
||||
});
|
||||
|
||||
it('[C260465] Should not be able to view process comment on included task', async () => {
|
||||
await apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({ message: 'GOODBYE' }, processInstanceId);
|
||||
await commentsApi.addProcessInstanceComment({ message: 'GOODBYE' }, processInstanceId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList(processName);
|
||||
|
||||
const taskQuery = await apiService.getInstance().activiti.taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
const taskQuery = await taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
|
||||
const taskId = taskQuery.data[0].id;
|
||||
|
||||
const taskComments = await apiService.getInstance().activiti.commentsApi.getTaskComments(taskId, { 'latestFirst': true });
|
||||
const taskComments = await commentsApi.getTaskComments(taskId, { 'latestFirst': true });
|
||||
await expect(taskComments.total).toEqual(0);
|
||||
});
|
||||
|
||||
it('[C260466] Should be able to display comments from Task on the related Process', async () => {
|
||||
const taskQuery = await apiService.getInstance().activiti.taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
const taskQuery = await taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
|
||||
const taskId = taskQuery.data[0].id;
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.addTaskComment({ message: 'Task Comment' }, taskId);
|
||||
await commentsApi.addTaskComment({ message: 'Task Comment' }, taskId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList(processName);
|
||||
|
||||
const addedTaskComment = await apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
const addedTaskComment = await commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
|
@ -17,10 +17,18 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} 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';
|
||||
|
||||
describe('Sorting for process filters', () => {
|
||||
|
||||
@ -33,6 +41,9 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
const processInstancesApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
|
||||
let tenantId, appId, user, processesQuery;
|
||||
let importedApp;
|
||||
@ -66,9 +77,9 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
afterEach(async () => {
|
||||
try {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
@ -76,7 +87,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.running_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'running' }
|
||||
});
|
||||
@ -89,7 +100,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);
|
||||
await filtersPage.goToFilter(processFilter.running_old_first);
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
@ -98,7 +109,7 @@ 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 apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'completed' }
|
||||
});
|
||||
@ -108,9 +119,9 @@ describe('Sorting for process filters', () => {
|
||||
const secondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const thirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
|
||||
await processUtil.cancelProcessInstance(firstProc.id);
|
||||
await processUtil.cancelProcessInstance(secondProc.id);
|
||||
await processUtil.cancelProcessInstance(thirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@ -118,7 +129,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_old_first);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
@ -127,7 +138,7 @@ 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 apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.all_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'all' }
|
||||
});
|
||||
@ -141,9 +152,9 @@ describe('Sorting for process filters', () => {
|
||||
const deleteSecondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const deleteThirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteFirstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteSecondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteThirdProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteFirstProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteSecondProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteThirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@ -151,7 +162,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.all_old_first);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
@ -163,7 +174,7 @@ 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 apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.running_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
|
||||
});
|
||||
@ -179,7 +190,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.running_new_first);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
@ -188,7 +199,7 @@ 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 apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'completed' }
|
||||
});
|
||||
@ -198,16 +209,16 @@ describe('Sorting for process filters', () => {
|
||||
const secondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const thirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
|
||||
await processUtil.cancelProcessInstance(firstProc.id);
|
||||
await processUtil.cancelProcessInstance(secondProc.id);
|
||||
await processUtil.cancelProcessInstance(thirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.completed_new_first);
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_new_first);
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
@ -216,7 +227,7 @@ 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 apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.all_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'all' }
|
||||
});
|
||||
@ -230,9 +241,9 @@ describe('Sorting for process filters', () => {
|
||||
const deleteSecondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const deleteThirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteFirstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteSecondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteThirdProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteFirstProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteSecondProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteThirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@ -240,7 +251,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.all_new_first);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(deleteThirdProc.name);
|
||||
@ -252,7 +263,7 @@ 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 apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_most_recently, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'ended-asc', 'name': '', 'state': 'completed' }
|
||||
});
|
||||
@ -262,9 +273,9 @@ describe('Sorting for process filters', () => {
|
||||
const secondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const thirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
|
||||
await processUtil.cancelProcessInstance(secondProc.id);
|
||||
await processUtil.cancelProcessInstance(firstProc.id);
|
||||
await processUtil.cancelProcessInstance(thirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@ -272,7 +283,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_most_recently);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(secondProc.name);
|
||||
@ -281,7 +292,7 @@ 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 apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_least_recently, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'ended-desc', 'name': '', 'state': 'completed' }
|
||||
});
|
||||
@ -291,9 +302,9 @@ describe('Sorting for process filters', () => {
|
||||
const secondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const thirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
|
||||
await processUtil.cancelProcessInstance(secondProc.id);
|
||||
await processUtil.cancelProcessInstance(firstProc.id);
|
||||
await processUtil.cancelProcessInstance(thirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@ -301,7 +312,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_least_recently);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
|
@ -20,6 +20,7 @@ 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 { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { UserFiltersApi } from '@alfresco/js-api';
|
||||
|
||||
describe('New Process Filters', () => {
|
||||
|
||||
@ -31,6 +32,7 @@ describe('New Process Filters', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
|
||||
let tenantId, user, filterId, customProcessFilter;
|
||||
|
||||
@ -59,7 +61,7 @@ describe('New Process Filters', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C279965] Should be able to view default filters on ADF', async () => {
|
||||
@ -71,7 +73,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C260473] Should be able to create a new filter on APS and display it on ADF', async () => {
|
||||
customProcessFilter = await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
|
||||
'name': processFilter.new_filter,
|
||||
'icon': 'glyphicon-random',
|
||||
@ -86,7 +88,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C286450] Should display the process filter icon when a custom filter is added', async () => {
|
||||
customProcessFilter = await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
|
||||
'name': processFilter.new_icon,
|
||||
'icon': 'glyphicon-cloud',
|
||||
@ -108,7 +110,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C260474] Should be able to edit a filter on APS and check it on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
await userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
'appId': null,
|
||||
'name': processFilter.edited,
|
||||
'icon': 'glyphicon-random',
|
||||
@ -121,7 +123,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C286451] Should display changes on a process filter when this filter icon is edited', async () => {
|
||||
customProcessFilter = await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
|
||||
'name': processFilter.edit_icon,
|
||||
'icon': 'glyphicon-random',
|
||||
@ -134,7 +136,7 @@ describe('New Process Filters', () => {
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
|
||||
|
||||
await apiService.getInstance().activiti.userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
await userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
'appId': null,
|
||||
'name': processFilter.edit_icon,
|
||||
'icon': 'glyphicon-cloud',
|
||||
@ -166,7 +168,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C260475] Should be able to delete a filter on APS and check it on ADF', async () => {
|
||||
customProcessFilter = await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
|
||||
'name': processFilter.deleted,
|
||||
'icon': 'glyphicon-random',
|
||||
@ -175,7 +177,7 @@ describe('New Process Filters', () => {
|
||||
|
||||
filterId = customProcessFilter.id;
|
||||
|
||||
await apiService.getInstance().activiti.userFiltersApi.deleteUserProcessInstanceFilter(filterId);
|
||||
await userFiltersApi.deleteUserProcessInstanceFilter(filterId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
|
@ -22,7 +22,8 @@ import {
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
ViewerPage,
|
||||
ModelsActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
@ -45,6 +46,7 @@ describe('Attachment list action menu for processes', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
const pngFile = new FileModel({
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
@ -85,9 +87,9 @@ describe('Attachment list action menu for processes', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C260228] Should be able to access options of a file attached to an active process', async () => {
|
||||
|
@ -29,7 +29,7 @@ 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 { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { RuntimeAppDefinitionsApi, UserFiltersApi, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
@ -51,6 +51,8 @@ describe('Process Filters Test', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
const appsApi = new RuntimeAppDefinitionsApi(apiService.getInstance());
|
||||
|
||||
let appModel, user;
|
||||
|
||||
@ -137,15 +139,12 @@ describe('Process Filters Test', () => {
|
||||
|
||||
it('[C280407] Should be able to access the filters with URL', async () => {
|
||||
const defaultFiltersNumber = 3;
|
||||
let deployedApp, processFilterUrl;
|
||||
let processFilterUrl;
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
const deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
processFilterUrl = browser.baseUrl + '/activiti/apps/' + deployedApp.id + '/processes/';
|
||||
const taskAppFilters = await apiService.getInstance().activiti.userFiltersApi.getUserProcessInstanceFilters({ appId: deployedApp.id });
|
||||
processFilterUrl = browser.baseUrl + '/activiti/apps/' + deployedAppId + '/processes/';
|
||||
const taskAppFilters = await userFiltersApi.getUserProcessInstanceFilters({ appId: deployedAppId });
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
@ -194,7 +193,7 @@ describe('Process Filters Test', () => {
|
||||
await processListDemoPage.checkProcessIsDisplayed(processTitle.one);
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.running);
|
||||
await processDetailsPage.propertiesList.waitVisible();
|
||||
await checkProcessInfoDrawer({ name: processTitle.one });
|
||||
await checkProcessInfoDrawer({ name: processTitle.one });
|
||||
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
@ -220,8 +219,8 @@ describe('Process Filters Test', () => {
|
||||
});
|
||||
|
||||
it('[C260384] Edit default filter', async () => {
|
||||
const runningFilter = (await getFilter()).find(filter => filter.name === 'Running');
|
||||
await apiService.getInstance().activiti.userFiltersApi
|
||||
const runningFilter = (await getFilter()).find(filter => filter.name === 'Running');
|
||||
await userFiltersApi
|
||||
.updateUserProcessInstanceFilter(runningFilter.id, { ...runningFilter, name: 'Edited Running' });
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
@ -231,8 +230,8 @@ describe('Process Filters Test', () => {
|
||||
});
|
||||
|
||||
it('[C260385] Delete default filter', async () => {
|
||||
const allFilter = (await getFilter()).find(filter => filter.name === 'All');
|
||||
await apiService.getInstance().activiti.userFiltersApi.deleteUserProcessInstanceFilter(allFilter.id);
|
||||
const allFilter = (await getFilter()).find(filter => filter.name === 'All');
|
||||
await userFiltersApi.deleteUserProcessInstanceFilter(allFilter.id);
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
@ -240,9 +239,10 @@ describe('Process Filters Test', () => {
|
||||
});
|
||||
|
||||
async function getFilter(): Promise<UserProcessInstanceFilterRepresentation[]> {
|
||||
const apps = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
const apps = await appsApi.getAppDefinitions();
|
||||
const { id: appId = 0 } = apps.data.find((application) => application.name === appModel.name);
|
||||
const filters = await apiService.getInstance().activiti.userFiltersApi.getUserProcessInstanceFilters({ appId });
|
||||
|
||||
const filters = await userFiltersApi.getUserProcessInstanceFilters({ appId });
|
||||
return filters.data;
|
||||
}
|
||||
|
||||
|
@ -16,13 +16,21 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} 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 moment = require('moment');
|
||||
import { ProcessInstancesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Process Instance Details', () => {
|
||||
|
||||
@ -38,6 +46,8 @@ describe('Process Instance Details', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const processApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
|
||||
let appModel, process, user;
|
||||
const PROCESS_DATE_FORMAT = 'll';
|
||||
@ -60,13 +70,13 @@ describe('Process Instance Details', () => {
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
process = await apiService.getInstance().activiti.processApi.getProcessInstance(processModel.id);
|
||||
process = await processApi.getProcessInstance(processModel.id);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appModel.id);
|
||||
await modelsActions.deleteModel(appModel.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C307031] Should display the created date in the default format', async () => {
|
||||
|
@ -19,12 +19,13 @@ import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TaskFormsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Process List Test', () => {
|
||||
|
||||
@ -37,6 +38,8 @@ describe('Process List Test', () => {
|
||||
const apiService = new ApiService();
|
||||
const applicationsUtil = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
|
||||
let appDateModel, appUserWidgetModel, user;
|
||||
|
||||
@ -81,19 +84,19 @@ describe('Process List Test', () => {
|
||||
|
||||
const procWithUserWidgetTaskId = await processUtil.getProcessTaskId(completedProcWithUserWidget.id);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.completeTaskForm(procWithDateTaskId.id, { values: { label: null } });
|
||||
await apiService.getInstance().activiti.taskFormsApi.completeTaskForm(procWithUserWidgetTaskId.id, { values: { label: null } });
|
||||
await taskFormsApi.completeTaskForm(procWithDateTaskId.id, { values: { label: null } });
|
||||
await taskFormsApi.completeTaskForm(procWithUserWidgetTaskId.id, { values: { label: null } });
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appDateModel.id);
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appUserWidgetModel.id);
|
||||
await modelsActions.deleteModel(appDateModel.id);
|
||||
await modelsActions.deleteModel(appUserWidgetModel.id);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -21,7 +21,7 @@ import {
|
||||
ApplicationsUtil, BrowserActions,
|
||||
FileBrowserUtil,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessInstanceTasksPage,
|
||||
SelectAppsDialog,
|
||||
StartProcessPage,
|
||||
@ -40,6 +40,7 @@ import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
|
||||
import { ProcessInstancesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Start Process Component', () => {
|
||||
|
||||
@ -63,6 +64,9 @@ describe('Start Process Component', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiServiceUserTwo = new ApiService();
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const processApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
|
||||
let procUserModel: UserModel;
|
||||
let secondProcUserModel: UserModel;
|
||||
@ -85,7 +89,6 @@ describe('Start Process Component', () => {
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
const usersActions = new UsersActions(apiService);
|
||||
procUserModel = await usersActions.createUser();
|
||||
secondProcUserModel = await usersActions.createUser(new UserModel({ tenantId: procUserModel.tenantId }));
|
||||
|
||||
@ -99,10 +102,10 @@ describe('Start Process Component', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiServiceUserTwo.getInstance().activiti.modelsApi.deleteModel(appCreated.id);
|
||||
await apiServiceUserTwo.getInstance().activiti.modelsApi.deleteModel(simpleAppCreated.id);
|
||||
await apiServiceUserTwo.getInstance().activiti.modelsApi.deleteModel(dateFormAppCreated.id);
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(procUserModel.tenantId);
|
||||
await modelsActions.deleteModel(appCreated.id);
|
||||
await modelsActions.deleteModel(simpleAppCreated.id);
|
||||
await modelsActions.deleteModel(dateFormAppCreated.id);
|
||||
await usersActions.deleteTenant(procUserModel.tenantId);
|
||||
});
|
||||
|
||||
describe(' Once logged with user without apps', () => {
|
||||
@ -205,7 +208,7 @@ describe('Start Process Component', () => {
|
||||
await processDetailsPage.checkProcessHeaderDetailsAreVisible();
|
||||
|
||||
const processId = await processDetailsPage.getId();
|
||||
const response = await apiService.getInstance().activiti.processApi.getProcessInstance(processId);
|
||||
const response = await processApi.getProcessInstance(processId);
|
||||
|
||||
await expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
|
||||
await expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
|
||||
@ -485,11 +488,11 @@ describe('Start Process Component', () => {
|
||||
hostBpm: browser.params.testConfig.appConfig.bpmHost
|
||||
});
|
||||
|
||||
const usersActions = new UsersActions(apiServiceAll);
|
||||
const usersActionsAll = new UsersActions(apiServiceAll);
|
||||
|
||||
await apiServiceAll.login(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActionsAll.createUser();
|
||||
|
||||
const alfrescoJsBPMAdminUser = new ApiService({ hostBpm: browser.params.testConfig.appConfig.bpmHost });
|
||||
|
||||
|
@ -17,12 +17,19 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
TaskUtil,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { CommentsPage } from '../../core/pages/comments.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import { ActivitiCommentsApi, TaskActionsApi } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Comment component for Processes', () => {
|
||||
@ -36,6 +43,10 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const activitiCommentsApi = new ActivitiCommentsApi(apiService.getInstance());
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
|
||||
let user, appId, secondUser;
|
||||
|
||||
@ -59,17 +70,17 @@ describe('Comment component for Processes', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C260237] Should not be able to add a comment on a completed task', async () => {
|
||||
const newTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: taskName.completed_task }));
|
||||
const newTask = await taskUtil.createStandaloneTask(taskName.completed_task);
|
||||
|
||||
const taskId = newTask.id;
|
||||
|
||||
await apiService.getInstance().activiti.taskActionsApi.completeTask(taskId);
|
||||
await taskActionsApi.completeTask(taskId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
@ -80,15 +91,15 @@ describe('Comment component for Processes', () => {
|
||||
});
|
||||
|
||||
it('[C212864] Should be able to add multiple comments on a single task using different users', async () => {
|
||||
const newTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: taskName.multiple_users }));
|
||||
const newTask = await taskUtil.createStandaloneTask(taskName.multiple_users);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.involveUser(newTask.id, { email: secondUser.email });
|
||||
await taskActionsApi.involveUser(newTask.id, { email: secondUser.email });
|
||||
|
||||
const taskComment = { message: 'Task Comment' };
|
||||
const secondTaskComment = { message: 'Second Task Comment' };
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.addTaskComment(taskComment, newTask.id);
|
||||
await apiService.getInstance().activiti.taskApi.addTaskComment(secondTaskComment, newTask.id);
|
||||
await activitiCommentsApi.addTaskComment(taskComment, newTask.id);
|
||||
await activitiCommentsApi.addTaskComment(secondTaskComment, newTask.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
@ -96,7 +107,7 @@ describe('Comment component for Processes', () => {
|
||||
await taskPage.tasksListPage().selectRow(taskName.multiple_users);
|
||||
await taskPage.taskDetails().selectActivityTab();
|
||||
|
||||
const totalCommentsLatest = await apiService.getInstance().activiti.taskApi.getTaskComments(newTask.id, { 'latestFirst': true });
|
||||
const totalCommentsLatest = await activitiCommentsApi.getTaskComments(newTask.id, { 'latestFirst': true });
|
||||
|
||||
const thirdTaskComment = { message: 'Third Task Comment' };
|
||||
|
||||
@ -117,7 +128,7 @@ describe('Comment component for Processes', () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(secondUser.username, secondUser.password);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.addTaskComment(thirdTaskComment, newTask.id);
|
||||
await activitiCommentsApi.addTaskComment(thirdTaskComment, newTask.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
@ -125,7 +136,7 @@ describe('Comment component for Processes', () => {
|
||||
await taskPage.tasksListPage().selectRow(taskName.multiple_users);
|
||||
await taskPage.taskDetails().selectActivityTab();
|
||||
|
||||
const totalComments = await apiService.getInstance().activiti.taskApi.getTaskComments(newTask.id, { 'latestFirst': true });
|
||||
const totalComments = await activitiCommentsApi.getTaskComments(newTask.id, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
@ -22,14 +22,13 @@ import {
|
||||
DateUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
ProcessUtil,
|
||||
ProcessUtil, TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { AppsRuntimeActions } from '../../actions/APS/apps-runtime.actions';
|
||||
import { TaskListDemoPage } from './../pages/task-list-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import { TaskActionsApi, TaskRepresentation, TasksApi } from '@alfresco/js-api';
|
||||
import moment = require('moment');
|
||||
|
||||
describe('Start Task - Custom App', () => {
|
||||
@ -43,10 +42,13 @@ describe('Start Task - Custom App', () => {
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const appsRuntime = new AppsRuntimeActions(apiService);
|
||||
const appsRuntime = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
|
||||
let processUserModel;
|
||||
let appRuntime, secondAppRuntime;
|
||||
@ -89,11 +91,11 @@ describe('Start Task - Custom App', () => {
|
||||
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
appRuntime = await appsRuntime.getRuntimeAppByName(app.title);
|
||||
appRuntime = await appsRuntime.getAppDefinitionByName(app.title);
|
||||
|
||||
await applicationsService.importPublishDeployApp(secondApp.file_path);
|
||||
|
||||
secondAppRuntime = await appsRuntime.getRuntimeAppByName(secondApp.title);
|
||||
secondAppRuntime = await appsRuntime.getAppDefinitionByName(secondApp.title);
|
||||
|
||||
processDefinitionId = await processUtil.startProcessOfApp(appModel.name);
|
||||
await processUtil.startProcessOfApp(appModel.name);
|
||||
@ -101,18 +103,18 @@ describe('Start Task - Custom App', () => {
|
||||
await processUtil.startProcessOfApp(appModel.name);
|
||||
|
||||
for (let i = 1; i < paginationTasksName.length; i++) {
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ 'name': paginationTasksName[i] }));
|
||||
await taskUtil.createStandaloneTask(paginationTasksName[i]);
|
||||
}
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
completedTasks[i] = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({
|
||||
completedTasks[i] = await tasksApi.createNewTask(new TaskRepresentation({
|
||||
'name': completedTasksName[i],
|
||||
'dueDate': DateUtil.formatDate('YYYY-MM-DDTHH:mm:ss.SSSZ', new Date(), i + 2)
|
||||
}));
|
||||
await apiService.getInstance().activiti.taskActionsApi.completeTask(completedTasks[i].id);
|
||||
await taskActionsApi.completeTask(completedTasks[i].id);
|
||||
}
|
||||
|
||||
taskWithDueDate = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({
|
||||
taskWithDueDate = await tasksApi.createNewTask(new TaskRepresentation({
|
||||
'name': paginationTasksName[0],
|
||||
'dueDate': currentDateStandardFormat
|
||||
}));
|
||||
|
@ -21,7 +21,7 @@ import {
|
||||
BrowserActions,
|
||||
BrowserVisibility,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
StringUtil,
|
||||
UserModel,
|
||||
UsersActions
|
||||
@ -47,6 +47,8 @@ describe('Info Drawer', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const firstComment = 'comm1';
|
||||
|
||||
@ -72,8 +74,6 @@ describe('Info Drawer', () => {
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
const assigneeUserModel = await usersActions.createUser();
|
||||
@ -89,9 +89,9 @@ describe('Info Drawer', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appCreated.id);
|
||||
await modelsActions.deleteModel(appCreated.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -20,13 +20,12 @@ import {
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
StringUtil,
|
||||
StringUtil, TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Task List Pagination - Sorting', () => {
|
||||
@ -40,6 +39,7 @@ describe('Task List Pagination - Sorting', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
const nrOfTasks = 20;
|
||||
let processUserModel;
|
||||
@ -65,11 +65,11 @@ describe('Task List Pagination - Sorting', () => {
|
||||
await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
for (let i = 0; i < nrOfTasks; i++) {
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: taskNames[i] }));
|
||||
await taskUtil.createStandaloneTask(taskNames[i]);
|
||||
}
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C260308] Should be possible to sort tasks by name', async () => {
|
||||
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
|
||||
@ -79,13 +79,12 @@ describe('Task List Pagination - Sorting', () => {
|
||||
await taskPage.tasksListPage().getDataTable().waitForTableBody();
|
||||
await taskPage.filtersPage().sortByName('ASC');
|
||||
await taskPage.tasksListPage().getDataTable().waitForTableBody();
|
||||
await taskPage.filtersPage().getAllRowsNameColumn().then(async (list) => {
|
||||
await expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
|
||||
});
|
||||
const listAsc = await taskPage.filtersPage().getAllRowsNameColumn();
|
||||
await expect(JSON.stringify(listAsc) === JSON.stringify(taskNames)).toEqual(true);
|
||||
await taskPage.filtersPage().sortByName('DESC');
|
||||
await taskPage.filtersPage().getAllRowsNameColumn().then(async (list) => {
|
||||
taskNames.reverse();
|
||||
await expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
|
||||
});
|
||||
const listDesc = await taskPage.filtersPage().getAllRowsNameColumn();
|
||||
|
||||
taskNames.reverse();
|
||||
await expect(JSON.stringify(listDesc) === JSON.stringify(taskNames)).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
@ -17,13 +17,12 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { ApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import Task = require('../../models/APS/Task');
|
||||
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
|
||||
@ -34,24 +33,21 @@ describe('Start Task - Task App', () => {
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
let processUserModel;
|
||||
const tasks = ['Standalone task', 'Completed standalone task', 'Add a form', 'Remove form'];
|
||||
const noFormMessage = 'No forms attached';
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationUtil = new ApplicationsUtil(apiService);
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
|
||||
beforeAll(async () => {
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
await applicationUtil.importApplication(app.file_path);
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
@ -64,9 +60,9 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
it('[C260421] Should a standalone task be displayed when creating a new task without form', async () => {
|
||||
const task = await taskPage.createNewTask();
|
||||
await task.addName(tasks[0]);
|
||||
await task.addName('Standalone task');
|
||||
await task.clickStartButton();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Standalone task');
|
||||
await taskPage.taskDetails().noFormIsDisplayed();
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
@ -80,15 +76,16 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
it('[C268910] Should a standalone task be displayed in completed tasks when completing it', async () => {
|
||||
const task = await taskPage.createNewTask();
|
||||
await task.addName(tasks[1]);
|
||||
await task.addName('Completed standalone task');
|
||||
await task.clickStartButton();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Completed standalone task');
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
|
||||
await taskPage.completeTaskNoForm();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(tasks[1]);
|
||||
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + tasks[1] + ' completed');
|
||||
await taskPage.tasksListPage().selectRow('Completed standalone task');
|
||||
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + 'Completed standalone task' + ' completed');
|
||||
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
|
||||
@ -96,10 +93,10 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
it('[C268911] Should allow adding a form to a standalone task when clicking on Add form button', async () => {
|
||||
const task = await taskPage.createNewTask();
|
||||
await task.addName(tasks[2]);
|
||||
await task.addName('Add a form');
|
||||
await task.clickStartButton();
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Add a form');
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
await taskPage.taskDetails().clickAttachFormButton();
|
||||
|
||||
@ -116,19 +113,19 @@ describe('Start Task - Task App', () => {
|
||||
it('[C268912] Should a standalone task be displayed when removing the form from APS', async () => {
|
||||
const task = await taskPage.createNewTask();
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
await task.addName(tasks[3]);
|
||||
await task.addName('Remove form');
|
||||
await task.selectForm(app.formName);
|
||||
await task.clickStartButton();
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Remove form');
|
||||
await taskPage.taskDetails().waitFormNameEqual(app.formName);
|
||||
|
||||
const listOfTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
await apiService.getInstance().activiti.taskApi.removeForm(listOfTasks.data[0].id);
|
||||
const listOfTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
await taskActionsApi.removeForm(listOfTasks.data[0].id);
|
||||
|
||||
await browser.refresh();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
|
||||
await taskPage.checkTaskTitle(tasks[3]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Remove form');
|
||||
await taskPage.checkTaskTitle('Remove form');
|
||||
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
|
||||
|
@ -15,7 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, StringUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
TaskUtil,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
@ -23,9 +31,6 @@ 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 * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
@ -39,6 +44,8 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const applicationsUtil = new ApplicationsUtil(apiService);
|
||||
|
||||
let processUserModel, assigneeUserModel;
|
||||
const formTextField = app.form_fields.form_fieldId;
|
||||
@ -62,14 +69,11 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
processUserModel = await usersActions.createUser(new UserModel({ tenantId: assigneeUserModel.tenantId }));
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
await applicationsUtil.importApplication(app.file_path);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: showHeaderTask }));
|
||||
await taskUtil.createStandaloneTask(showHeaderTask);
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
@ -33,6 +33,7 @@ import { ProcessListPage } from './../pages/process-list.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AdminGroupsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Task Assignee', () => {
|
||||
|
||||
@ -51,6 +52,7 @@ describe('Task Assignee', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const adminGroupsApi = new AdminGroupsApi(apiService.getInstance());
|
||||
|
||||
describe('Candidate User Assignee', () => {
|
||||
|
||||
@ -65,7 +67,7 @@ describe('Task Assignee', () => {
|
||||
}));
|
||||
|
||||
try {// creates group if not available
|
||||
await apiService.getInstance().activiti.adminGroupsApi.createNewGroup({
|
||||
await adminGroupsApi.createNewGroup({
|
||||
'name': app.candidateGroup,
|
||||
'tenantId': user.tenantId,
|
||||
'type': 1
|
||||
@ -81,7 +83,7 @@ describe('Task Assignee', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@ -132,21 +134,21 @@ describe('Task Assignee', () => {
|
||||
candidate1 = await usersActions.createUser(new UserModel({ tenantId: user.tenantId }));
|
||||
candidate2 = await usersActions.createUser(new UserModel({ tenantId: user.tenantId }));
|
||||
|
||||
const adminGroup = await apiService.getInstance().activiti.adminGroupsApi.createNewGroup(
|
||||
const adminGroup = await adminGroupsApi.createNewGroup(
|
||||
{ 'name': app.adminGroup, 'tenantId': user.tenantId }
|
||||
);
|
||||
|
||||
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(adminGroup.id, user.id);
|
||||
await adminGroupsApi.addGroupMember(adminGroup.id, user.id);
|
||||
|
||||
await apiService.getInstance().activiti.adminGroupsApi.addGroupCapabilities(adminGroup.id, { capabilities: app.adminCapabilities });
|
||||
await adminGroupsApi.addGroupCapabilities(adminGroup.id, { capabilities: app.adminCapabilities });
|
||||
|
||||
const candidateGroup = await apiService.getInstance().activiti.adminGroupsApi.createNewGroup(
|
||||
const candidateGroup = await adminGroupsApi.createNewGroup(
|
||||
{ 'name': app.candidateGroup, 'tenantId': user.tenantId, 'type': 1 }
|
||||
);
|
||||
|
||||
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(candidateGroup.id, candidate1.id);
|
||||
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(candidateGroup.id, candidate2.id);
|
||||
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(candidateGroup.id, user.id);
|
||||
await adminGroupsApi.addGroupMember(candidateGroup.id, candidate1.id);
|
||||
await adminGroupsApi.addGroupMember(candidateGroup.id, candidate2.id);
|
||||
await adminGroupsApi.addGroupMember(candidateGroup.id, user.id);
|
||||
|
||||
try {// for creates user if not available
|
||||
await usersActions.createUser(new UserModel({
|
||||
@ -165,7 +167,7 @@ describe('Task Assignee', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C216430] Start Task - Claim and Requeue a task', async () => {
|
||||
|
@ -20,7 +20,7 @@ import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
FileBrowserUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions, TaskUtil,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
@ -30,8 +30,9 @@ 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 { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { Activiti } from '@alfresco/js-api';
|
||||
import ContentApi = Activiti.ContentApi;
|
||||
|
||||
describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
@ -45,6 +46,10 @@ describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const contentApi = new ContentApi();
|
||||
contentApi.init(apiService.getInstance());
|
||||
|
||||
const pngFile = new FileModel({
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
@ -74,9 +79,9 @@ describe('Attachment list action menu for tasks', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C277311] Should be able to View /Download /Remove from Attachment List on an active task', async () => {
|
||||
@ -166,12 +171,12 @@ describe('Attachment list action menu for tasks', () => {
|
||||
});
|
||||
|
||||
it('[C260234] Should be able to attache a file on a task on APS and check on ADF', async () => {
|
||||
const newTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: 'SHARE KNOWLEDGE' }));
|
||||
const newTask = await taskUtil.createStandaloneTask('SHARE KNOWLEDGE');
|
||||
const newTaskId = newTask.id;
|
||||
const filePath = path.join(browser.params.testConfig.main.rootPath + pngFile.location);
|
||||
const file = fs.createReadStream(filePath);
|
||||
|
||||
relatedContent = await apiService.getInstance().activiti.contentApi.createRelatedContentOnTask(newTaskId, file, { 'isRelatedContent': true });
|
||||
relatedContent = await contentApi.createRelatedContentOnTask(newTaskId, file, { 'isRelatedContent': true });
|
||||
relatedContentId = relatedContent.id;
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
@ -181,7 +186,7 @@ describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
await attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
|
||||
await apiService.getInstance().activiti.contentApi.deleteContent(relatedContentId);
|
||||
await contentApi.deleteContent(relatedContentId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
|
@ -15,12 +15,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowserActions, FileBrowserUtil, ApplicationsUtil, ApiService, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
LoginPage,
|
||||
BrowserActions,
|
||||
FileBrowserUtil,
|
||||
ApplicationsUtil,
|
||||
ApiService,
|
||||
UsersActions,
|
||||
TaskUtil
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { browser } from 'protractor';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Task Audit', () => {
|
||||
|
||||
@ -32,6 +39,7 @@ describe('Task Audit', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
|
||||
@ -45,7 +53,7 @@ describe('Task Audit', () => {
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: taskTaskApp }));
|
||||
await taskUtil.createStandaloneTask(taskTaskApp);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
@ -54,7 +62,7 @@ describe('Task Audit', () => {
|
||||
|
||||
afterAll( async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -18,25 +18,27 @@
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessUtil,
|
||||
StringUtil,
|
||||
StringUtil, TaskUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
Widget,
|
||||
FormUtil
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { FormModelActions } from '../../actions/APS/form-model.actions';
|
||||
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 { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Task Details - Form', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const tasksListPage = new TasksListPage();
|
||||
const taskDetailsPage = new TaskDetailsPage();
|
||||
@ -46,9 +48,14 @@ describe('Task Details - Form', () => {
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const formActions = new FormModelActions(apiService);
|
||||
const formActions = new FormUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
|
||||
let task, otherTask, user, newForm, attachedForm, otherAttachedForm;
|
||||
|
||||
@ -76,27 +83,28 @@ describe('Task Details - Form', () => {
|
||||
user = await usersActions.createUser();
|
||||
await apiService.login(user.username, user.password);
|
||||
|
||||
attachedForm = await apiService.getInstance().activiti.modelsApi.createModel(attachedFormModel);
|
||||
newForm = await apiService.getInstance().activiti.modelsApi.createModel(newFormModel);
|
||||
attachedForm = await modelsActions.modelsApi.createModel(attachedFormModel);
|
||||
newForm = await modelsActions.modelsApi.createModel(newFormModel);
|
||||
|
||||
const otherEmptyTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: StringUtil.generateRandomString() }));
|
||||
otherAttachedForm = await apiService.getInstance().activiti.modelsApi.createModel(otherAttachedFormModel);
|
||||
const otherEmptyTask = await taskUtil.createStandaloneTask();
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.attachForm(otherEmptyTask.id, { 'formId': otherAttachedForm.id });
|
||||
otherTask = await apiService.getInstance().activiti.taskApi.getTask(otherEmptyTask.id);
|
||||
otherAttachedForm = await modelsActions.modelsApi.createModel(otherAttachedFormModel);
|
||||
|
||||
await taskActionsApi.attachForm(otherEmptyTask.id, { 'formId': otherAttachedForm.id });
|
||||
otherTask = await tasksApi.getTask(otherEmptyTask.id);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
const emptyTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: StringUtil.generateRandomString() }));
|
||||
await apiService.getInstance().activiti.taskApi.attachForm(emptyTask.id, { 'formId': attachedForm.id });
|
||||
task = await apiService.getInstance().activiti.taskApi.getTask(emptyTask.id);
|
||||
const emptyTask = await taskUtil.createStandaloneTask();
|
||||
await taskActionsApi.attachForm(emptyTask.id, { 'formId': attachedForm.id });
|
||||
task = await tasksApi.getTask(emptyTask.id);
|
||||
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
await filtersPage.goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
||||
@ -176,17 +184,16 @@ describe('Task Details - Form', () => {
|
||||
tabFieldVar: 'tabBasicFieldVar'
|
||||
};
|
||||
|
||||
let app, newTask;
|
||||
let newTask, appModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
newTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: StringUtil.generateRandomString() }));
|
||||
newTask = await taskUtil.createStandaloneTask();
|
||||
const form = await formActions.getFormByName(app.visibilityProcess.formName);
|
||||
await apiService.getInstance().activiti.taskApi.attachForm(newTask.id, { 'formId': form.id });
|
||||
await taskActionsApi.attachForm(newTask.id, { 'formId': form.id });
|
||||
|
||||
await browser.refresh();
|
||||
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
|
||||
@ -350,7 +357,7 @@ describe('Task Details - Form', () => {
|
||||
});
|
||||
|
||||
it('[C315197] Should be able to complete a process task with visible tab with empty value for field', async () => {
|
||||
await new ProcessUtil(apiService).startProcessByDefinitionName(app.name, app.visibilityProcess.name);
|
||||
await processUtil.startProcessByDefinitionName(appModel.name, app.visibilityProcess.name);
|
||||
|
||||
await filtersPage.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
@ -384,7 +391,7 @@ describe('Task Details - Form', () => {
|
||||
});
|
||||
|
||||
it('[C212922] Should a User task form be refreshed, saved or completed.', async () => {
|
||||
await new ProcessUtil(apiService).startProcessByDefinitionName(app.name, app.processName);
|
||||
await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
|
||||
await filtersPage.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
|
@ -27,16 +27,16 @@ describe('Task Details - No form', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel;
|
||||
const taskPage = new TasksPage();
|
||||
const noFormMessage = 'No forms attached';
|
||||
let importedApp;
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
@ -49,7 +49,7 @@ describe('Task Details - No form', () => {
|
||||
|
||||
afterAll( async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C289311] Should attach form and complete buttons to be displayed when no form is attached', async () => {
|
||||
|
@ -19,15 +19,15 @@ import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessUtil,
|
||||
StringUtil,
|
||||
StringUtil, TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import { 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');
|
||||
@ -43,6 +43,12 @@ describe('Task Details component', () => {
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
|
||||
let processUserModel, appModel;
|
||||
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
|
||||
@ -57,8 +63,6 @@ describe('Task Details component', () => {
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
@ -70,7 +74,7 @@ describe('Task Details component', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
@ -85,7 +89,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.createTask({ name: tasks[1], description: 'Description', formName: app.formName });
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@ -101,7 +105,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
|
||||
|
||||
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
formModel = new FormModel(taskForm);
|
||||
|
||||
await taskPage.taskDetails().waitFormNameEqual(formModel.getName());
|
||||
@ -114,7 +118,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.createTask({ name: tasks[1], description: 'Description', formName: app.formName });
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@ -132,7 +136,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
|
||||
|
||||
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
|
||||
formModel = new FormModel(taskForm);
|
||||
|
||||
@ -148,7 +152,7 @@ describe('Task Details component', () => {
|
||||
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
|
||||
@ -165,7 +169,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
|
||||
|
||||
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
|
||||
formModel = new FormModel(taskForm);
|
||||
|
||||
@ -180,7 +184,7 @@ describe('Task Details component', () => {
|
||||
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@ -196,7 +200,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
|
||||
|
||||
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
|
||||
formModel = new FormModel(taskForm);
|
||||
|
||||
@ -206,8 +210,7 @@ describe('Task Details component', () => {
|
||||
it('[C286708] Should display task details for subtask - Task App', async () => {
|
||||
const taskName = 'TaskAppSubtask';
|
||||
const checklistName = 'TaskAppChecklist';
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ 'name': taskName }));
|
||||
|
||||
await taskUtil.createStandaloneTask(taskName);
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
@ -223,7 +226,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(checklistName);
|
||||
await taskPage.tasksListPage().selectRow(checklistName);
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@ -260,7 +263,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(checklistName);
|
||||
await taskPage.tasksListPage().selectRow(checklistName);
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@ -279,7 +282,7 @@ describe('Task Details component', () => {
|
||||
|
||||
it('[C286709] Should display task details for completed task - Task App', async () => {
|
||||
const taskName = 'TaskAppCompleted';
|
||||
const taskId = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ 'name': taskName }));
|
||||
const taskId = await taskUtil.createStandaloneTask(taskName);
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
@ -291,7 +294,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(taskName);
|
||||
|
||||
const getTaskResponse = await apiService.getInstance().activiti.taskApi.getTask(taskId.id);
|
||||
const getTaskResponse = await tasksApi.getTask(taskId.id);
|
||||
|
||||
const taskModel = new TaskModel(getTaskResponse);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@ -310,10 +313,11 @@ describe('Task Details component', () => {
|
||||
|
||||
it('[C260321] Should not be able to edit a completed task\'s details', async () => {
|
||||
const taskName = 'TaskCompleted';
|
||||
const form = await apiService.getInstance().activiti.modelsApi.createModel(taskFormModel);
|
||||
const task = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ 'name': taskName }));
|
||||
await apiService.getInstance().activiti.taskApi.attachForm(task.id, { 'formId': form.id });
|
||||
await apiService.getInstance().activiti.taskApi.completeTaskForm(task.id, { values: { label: null } });
|
||||
const form = await modelsActions.modelsApi.createModel(taskFormModel);
|
||||
const task = await taskUtil.createStandaloneTask(taskName);
|
||||
|
||||
await taskActionsApi.attachForm(task.id, { 'formId': form.id });
|
||||
await taskFormsApi.completeTaskForm(task.id, { values: { label: null } });
|
||||
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
|
||||
|
@ -15,7 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
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';
|
||||
@ -43,6 +50,7 @@ describe('Task', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
let appId: number, user: UserModel;
|
||||
|
||||
@ -62,9 +70,9 @@ describe('Task', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@ -177,7 +185,10 @@ describe('Task', () => {
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const appSettingsToggles = new AppSettingsTogglesPage();
|
||||
const taskFiltersDemoPage = new TaskFiltersDemoPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const userFiltersApi = new UserFiltersUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let user;
|
||||
let appId: number;
|
||||
@ -185,22 +196,20 @@ describe('Task', () => {
|
||||
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
appId = appDefinitions.data.find((currentApp) => currentApp.modelId === importedApp.id).id;
|
||||
appId = await applicationsService.getAppDefinitionId(importedApp.id);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
@ -216,11 +225,11 @@ describe('Task', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
const { id } = await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
const { id } = await userFiltersApi.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed();
|
||||
await apiService.getInstance().activiti.userFiltersApi.deleteUserTaskFilter(id);
|
||||
await userFiltersApi.deleteUserTaskFilter(id);
|
||||
});
|
||||
|
||||
it('[C286447] Should display the task filter icon when a custom filter is added', async () => {
|
||||
@ -230,7 +239,7 @@ describe('Task', () => {
|
||||
icon: 'glyphicon-cloud',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
const { id } = await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
const { id } = await userFiltersApi.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
@ -240,7 +249,7 @@ describe('Task', () => {
|
||||
|
||||
await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').checkTaskFilterIsDisplayed();
|
||||
await expect(await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').getTaskFilterIcon()).toEqual('cloud');
|
||||
await apiService.getInstance().activiti.userFiltersApi.deleteUserTaskFilter(id);
|
||||
await userFiltersApi.deleteUserTaskFilter(id);
|
||||
});
|
||||
|
||||
it('[C286449] Should display task filter icons only when showIcon property is set on true', async () => {
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, 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';
|
||||
@ -39,6 +39,7 @@ describe('Task Filters Sorting', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const userFiltersUtil = new UserFiltersUtil(apiService);
|
||||
|
||||
let user;
|
||||
let appId;
|
||||
@ -57,9 +58,9 @@ describe('Task Filters Sorting', () => {
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
appId = appDefinitions.data.find((currentApp) => currentApp.modelId === importedApp.id).id;
|
||||
|
||||
const appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
@ -82,7 +83,7 @@ describe('Task Filters Sorting', () => {
|
||||
|
||||
afterAll( async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', async () => {
|
||||
@ -92,7 +93,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@ -109,7 +110,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-asc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@ -126,7 +127,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@ -143,7 +144,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-asc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@ -160,7 +161,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@ -177,7 +178,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-asc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@ -194,7 +195,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-desc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@ -211,7 +212,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-asc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
|
@ -35,7 +35,9 @@ describe('Task List Pagination', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const taskPage = new TasksPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel: UserModel;
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
@ -56,8 +58,6 @@ describe('Task List Pagination', () => {
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
@ -74,7 +74,7 @@ describe('Task List Pagination', () => {
|
||||
|
||||
afterAll( async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260301] Should display default pagination', async () => {
|
||||
|
@ -29,7 +29,7 @@ describe('Amount Widget', () => {
|
||||
const widget = new Widget();
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
const apiService = new ApiService();
|
||||
@ -45,16 +45,14 @@ describe('Amount Widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async() => {
|
||||
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedAppId}/tasks/`;
|
||||
await BrowserActions.getUrl(urlToNavigateTo);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
|
||||
@ -63,9 +61,9 @@ describe('Amount Widget', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C274703] Should be possible to set general, advance and visibility properties for Amount Widget', async () => {
|
||||
|
@ -80,7 +80,7 @@ describe('Attach widget - File', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268067] Should be able to preview, download and remove attached files from an active form', async () => {
|
||||
|
@ -39,7 +39,7 @@ describe('Attach Folder widget', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
const apiService = new ApiService();
|
||||
@ -55,26 +55,24 @@ describe('Attach Folder widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C276745] Should be possible to set visibility properties for Attach Folder Widget', async () => {
|
||||
|
@ -38,11 +38,12 @@ describe('Checkbox Widget', () => {
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@ -52,24 +53,22 @@ describe('Checkbox Widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268554] Should be able to set general settings for Checkbox widget ', async () => {
|
||||
|
@ -41,10 +41,11 @@ describe('Date and time widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@ -54,26 +55,24 @@ describe('Date and time widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268818] Should be able to set general settings for Date Time widget', async () => {
|
||||
|
@ -45,11 +45,12 @@ describe('Date widget', () => {
|
||||
const dateWidget = widget.dateWidget();
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@ -59,24 +60,22 @@ describe('Date widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
describe('Simple App', () => {
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
|
@ -41,9 +41,10 @@ describe('Document Template widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -54,26 +55,24 @@ describe('Document Template widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp( app.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessOfApp(appModel.name);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessOfApp(appModel.name);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260406] should check that the template contains assigned file ', async () => {
|
||||
|
@ -40,9 +40,10 @@ describe('Dropdown widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -53,26 +54,24 @@ describe('Dropdown widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C269051] Should be possible to set general and options properties for Dropdown widget ', async () => {
|
||||
|
@ -39,13 +39,12 @@ describe('Dynamic Table widget ', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
describe('with Date Time Widget App', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -53,26 +52,26 @@ describe('Dynamic Table widget ', () => {
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
const appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => currentApp.modelId === appModel.id);
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@ -103,24 +102,24 @@ describe('Dynamic Table widget ', () => {
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
const appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => currentApp.modelId === appModel.id);
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
@ -159,24 +158,24 @@ describe('Dynamic Table widget ', () => {
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
const application = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
const appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => currentApp.modelId === application.id);
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(application.name, app.CUSTOM_VALIDATOR.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.CUSTOM_VALIDATOR.processName);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
@ -195,7 +194,7 @@ describe('Dynamic Table widget ', () => {
|
||||
|
||||
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();
|
||||
|
@ -41,9 +41,10 @@ describe('Header widget', async () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -54,26 +55,24 @@ describe('Header widget', async () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C276737] Should be able to set general and visibility properties for Header widget', async () => {
|
||||
|
@ -41,10 +41,11 @@ describe('Hyperlink widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@ -54,26 +55,24 @@ describe('Hyperlink widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C276728] Should be able to set visibility properties for Hyperlink widget', async () => {
|
||||
|
@ -40,10 +40,11 @@ describe('Multi-line Widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@ -53,26 +54,24 @@ describe('Multi-line Widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268182] Should be able to set general properties for Multi-line Text Widget', async () => {
|
||||
|
@ -41,9 +41,10 @@ describe('Number widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -54,26 +55,24 @@ describe('Number widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C269111] Should be able to set general properties for Number Widget', async () => {
|
||||
|
@ -20,6 +20,7 @@ import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AdminGroupsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('People and Group widget', () => {
|
||||
|
||||
@ -33,6 +34,7 @@ describe('People and Group widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const adminGroupsApi = new AdminGroupsApi(apiService.getInstance());
|
||||
|
||||
let user: UserModel;
|
||||
|
||||
@ -129,16 +131,16 @@ describe('People and Group widget', () => {
|
||||
tenantId: tenantId, firstName: app.subGroupUser.firstName, lastName: app.subGroupUser.lastName
|
||||
}));
|
||||
|
||||
const group = await apiService.getInstance().activiti.adminGroupsApi.createNewGroup({
|
||||
const group = await adminGroupsApi.createNewGroup({
|
||||
name: app.group.name,
|
||||
tenantId,
|
||||
type: 1
|
||||
});
|
||||
|
||||
await Promise.all(userCreated.map((userToAddGroup: UserModel) => apiService.getInstance().activiti.adminGroupsApi.addGroupMember(group.id, userToAddGroup.id)));
|
||||
await Promise.all(userCreated.map((userToAddGroup: UserModel) => adminGroupsApi.addGroupMember(group.id, userToAddGroup.id)));
|
||||
|
||||
const subgroups: any[] = await Promise.all(getSubGroupsName().map((name) =>
|
||||
apiService.getInstance().activiti.adminGroupsApi.createNewGroup({
|
||||
adminGroupsApi.createNewGroup({
|
||||
name,
|
||||
tenantId,
|
||||
type: 1,
|
||||
@ -146,7 +148,7 @@ describe('People and Group widget', () => {
|
||||
})
|
||||
));
|
||||
|
||||
await Promise.all(subgroups.map((subgroup) => apiService.getInstance().activiti.adminGroupsApi.addGroupMember(subgroup.id, subgroupUser.id)));
|
||||
await Promise.all(subgroups.map((subgroup) => adminGroupsApi.addGroupMember(subgroup.id, subgroupUser.id)));
|
||||
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,10 @@ describe('People widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -54,26 +55,24 @@ describe('People widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessOfApp(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessOfApp(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260435][C274707] Should be possible to set visibility properties for People Widget', async () => {
|
||||
|
@ -41,9 +41,10 @@ describe('Radio Buttons Widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let appId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -53,28 +54,24 @@ describe('Radio Buttons Widget', () => {
|
||||
|
||||
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);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(appId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C277316] Should display empty radio buttons when no preselection is configured', async () => {
|
||||
|
@ -41,9 +41,10 @@ describe('Text widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -54,26 +55,24 @@ describe('Text widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268157] Should be able to set general properties for Text widget', async () => {
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions, Widget } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Typeahead widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
let user: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
await applicationsService.importPublishDeployApp(app.file_path, { renewIdmEntries: true });
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
});
|
||||
|
||||
it('[C307988] Type ahead form control should work for URLs', async () => {
|
||||
const name = 'typahead widget task';
|
||||
const typeaheadWidget = app.TYPE_AHEAD_WIDGET;
|
||||
await taskPage.createTask({name, formName: typeaheadWidget.formName});
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
await widget.typeahedWidget().checkTypeaheadFieldIsDisplayed();
|
||||
await widget.typeahedWidget().fillTypeaheadField(typeaheadWidget.case1.searchTerm);
|
||||
await widget.typeahedWidget().checkDropDownListIsDisplayed();
|
||||
let suggestions = await widget.typeahedWidget().getDropDownList();
|
||||
await expect(suggestions.sort()).toEqual(typeaheadWidget.case1.result.sort());
|
||||
|
||||
await widget.typeahedWidget().fillTypeaheadField(typeaheadWidget.case2.searchTerm);
|
||||
|
||||
await widget.typeahedWidget().checkDropDownListIsDisplayed();
|
||||
suggestions = await widget.typeahedWidget().getDropDownList();
|
||||
await expect(suggestions.sort()).toEqual(typeaheadWidget.case2.result);
|
||||
|
||||
await widget.typeahedWidget().selectOptionFromDropdown();
|
||||
await taskPage.taskDetails().clickCompleteFormTask();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
|
||||
await taskPage.tasksListPage().selectRow(name);
|
||||
await widget.typeahedWidget().checkTypeaheadFieldIsDisplayed();
|
||||
|
||||
await browser.sleep(1000);
|
||||
|
||||
await expect(await widget.typeahedWidget().getFieldValue('1583773306434')).toBe(typeaheadWidget.case2.result[0]);
|
||||
});
|
||||
});
|
@ -63,9 +63,10 @@ describe('Process-Services - Visibility conditions', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -76,25 +77,23 @@ describe('Process-Services - Visibility conditions', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C309647] Should be able to see Checkbox widget when visibility condition refers to another field with specific value', async () => {
|
||||
|
@ -30,6 +30,7 @@ import { SearchBarPage } from '../pages/search-bar.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { SearchConfiguration } from '../search.config';
|
||||
import { browser } from 'protractor';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Search Checklist Component', () => {
|
||||
|
||||
@ -40,10 +41,11 @@ describe('Search Checklist Component', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const acsUser = new UserModel();
|
||||
const apiService = new ApiService();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const filterType = {
|
||||
folder: 'Folder',
|
||||
@ -66,11 +68,11 @@ describe('Search Checklist Component', () => {
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
createdFolder = await apiService.getInstance().nodes.addNode('-my-', {
|
||||
createdFolder = await nodesApi.createNode('-my-', {
|
||||
name: nodeNames.folder,
|
||||
nodeType: 'cm:folder'
|
||||
});
|
||||
createdFile = await apiService.getInstance().nodes.addNode('-my-', {
|
||||
createdFile = await nodesApi.createNode('-my-', {
|
||||
name: nodeNames.document,
|
||||
nodeType: 'cm:content'
|
||||
});
|
||||
|
@ -31,6 +31,7 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { SearchBarPage } from '../pages/search-bar.page';
|
||||
import { SearchConfiguration } from '../search.config';
|
||||
import { browser } from 'protractor';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Search Radio Component', () => {
|
||||
|
||||
@ -42,7 +43,7 @@ describe('Search Radio Component', () => {
|
||||
|
||||
const acsUser = new UserModel();
|
||||
const apiService = new ApiService();
|
||||
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
@ -68,11 +69,11 @@ describe('Search Radio Component', () => {
|
||||
await usersActions.createUser(acsUser);
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
createdFolder = await apiService.getInstance().nodes.addNode('-my-', {
|
||||
createdFolder = await nodesApi.createNode('-my-', {
|
||||
name: nodeNames.folder,
|
||||
nodeType: 'cm:folder'
|
||||
});
|
||||
createdFile = await apiService.getInstance().nodes.addNode('-my-', {
|
||||
createdFile = await nodesApi.createNode('-my-', {
|
||||
name: nodeNames.document,
|
||||
nodeType: 'cm:content'
|
||||
});
|
||||
|
@ -31,6 +31,7 @@ import { SearchFiltersPage } from '../pages/search-filters.page';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import { SearchConfiguration } from '../search.config';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Search Sorting Picker', () => {
|
||||
|
||||
@ -58,6 +59,7 @@ describe('Search Sorting Picker', () => {
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const search = '_png_file.png';
|
||||
let jsonFile;
|
||||
@ -234,7 +236,7 @@ describe('Search Sorting Picker', () => {
|
||||
|
||||
for (let i = 0; i < (numberOfElements - 1); i++) {
|
||||
if (idList[i] && idList[i].trim() !== '') {
|
||||
promises.push(apiService.getInstance().core.nodesApi.getNode(idList[i]));
|
||||
promises.push(nodesApi.getNode(idList[i]));
|
||||
}
|
||||
}
|
||||
nodeList = await Promise.all(promises);
|
||||
|
@ -33,6 +33,7 @@ import { SearchFiltersPage } from '../pages/search-filters.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
import { SearchConfiguration } from '../search.config';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Search component - Text widget', () => {
|
||||
|
||||
@ -45,6 +46,7 @@ describe('Search component - Text widget', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
|
||||
const acsUser = new UserModel();
|
||||
const newFolderModel = new FolderModel({ 'description': 'newDescription' });
|
||||
@ -56,7 +58,7 @@ describe('Search component - Text widget', () => {
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
await apiService.getInstance().nodes.addNode('-my-', {
|
||||
await nodesApi.createNode('-my-', {
|
||||
'name': newFolderModel.name,
|
||||
'nodeType': 'cm:folder',
|
||||
'properties':
|
||||
|
@ -16,13 +16,13 @@
|
||||
*/
|
||||
|
||||
import { Locator, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { BrowserVisibility, BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchBarPage {
|
||||
|
||||
searchIcon = element(by.css(`button[class*='adf-search-button']`));
|
||||
searchBar = element(by.css(`adf-search-control input`));
|
||||
searchBarExpanded = element(by.css(`adf-search-control mat-form-field[class*="mat-focused"] input`));
|
||||
searchBarExpanded: TestElement = TestElement.byCss(`adf-search-control mat-form-field[class*="mat-focused"] input`);
|
||||
noResultMessage = element(by.css(`p[class*='adf-search-fixed-text']`));
|
||||
rowsAuthor: Locator = by.css(`.mat-list-text p[class*='adf-search-fixed-text']`);
|
||||
completeName: Locator = by.css(`h4[class*='adf-search-fixed-text']`);
|
||||
@ -48,7 +48,7 @@ export class SearchBarPage {
|
||||
}
|
||||
|
||||
async checkSearchBarIsNotVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.searchBarExpanded);
|
||||
await this.searchBarExpanded.waitNotVisible();
|
||||
}
|
||||
|
||||
async checkNoResultMessageIsDisplayed(): Promise<void> {
|
||||
@ -61,12 +61,12 @@ export class SearchBarPage {
|
||||
|
||||
async enterText(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
||||
await this.searchBar.sendKeys(text);
|
||||
await BrowserActions.clearSendKeys(this.searchBar, text);
|
||||
}
|
||||
|
||||
async enterTextAndPressEnter(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
||||
await this.searchBar.sendKeys(text);
|
||||
await BrowserActions.clearSendKeys(this.searchBar, text);
|
||||
await this.searchBar.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ import { FileModel } from '../models/ACS/file.model';
|
||||
import { FolderModel } from '../models/ACS/folder.model';
|
||||
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
|
||||
import { SearchConfiguration } from './search.config';
|
||||
import { NodesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Search component - Search Bar', () => {
|
||||
|
||||
@ -58,7 +59,7 @@ describe('Search component - Search Bar', () => {
|
||||
const acsUser = new UserModel();
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
||||
const filename = StringUtil.generateRandomString(16);
|
||||
@ -93,7 +94,7 @@ describe('Search component - Search Bar', () => {
|
||||
const firstFileUploaded = await uploadActions.uploadFile(firstFileModel.location, firstFileModel.name, '-my-');
|
||||
Object.assign(firstFileModel, firstFileUploaded.entry);
|
||||
|
||||
fileHighlightUploaded = await apiService.getInstance().nodes.addNode('-my-', {
|
||||
fileHighlightUploaded = await nodesApi.createNode('-my-', {
|
||||
'name': StringUtil.generateRandomString(16),
|
||||
'nodeType': 'cm:content',
|
||||
'properties': {
|
||||
@ -126,11 +127,8 @@ describe('Search component - Search Bar', () => {
|
||||
});
|
||||
|
||||
it('[C272798] Search bar should be visible', async () => {
|
||||
await searchBarPage.checkSearchBarIsNotVisible();
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
@ -140,14 +138,14 @@ describe('Search component - Search Bar', () => {
|
||||
});
|
||||
|
||||
it('[C272799] Should be possible to hide search bar after input', async () => {
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.enterText(firstFolderModel.shortName);
|
||||
});
|
||||
|
||||
it('[C260255] Should display message when searching for an inexistent file', async () => {
|
||||
await searchBarPage.checkSearchBarIsNotVisible();
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.checkNoResultMessageIsNotDisplayed();
|
||||
await searchBarPage.enterText(search.inactive.name);
|
||||
await searchResultPage.dataTable.waitTillContentLoaded();
|
||||
@ -156,8 +154,7 @@ describe('Search component - Search Bar', () => {
|
||||
});
|
||||
|
||||
it('[C260256] Should display file/folder in search suggestion when typing first characters', async () => {
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await openSearchBar();
|
||||
await searchBarPage.enterText(firstFolderModel.shortName);
|
||||
|
||||
await searchBarPage.resultTableContainsRow(firstFolderModel.name);
|
||||
@ -179,8 +176,8 @@ describe('Search component - Search Bar', () => {
|
||||
});
|
||||
|
||||
it('[C272800] Should display file/folder in search suggestion when typing name', async () => {
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.enterText(firstFolderModel.name);
|
||||
|
||||
await searchBarPage.resultTableContainsRow(firstFolderModel.name);
|
||||
@ -203,8 +200,8 @@ describe('Search component - Search Bar', () => {
|
||||
});
|
||||
|
||||
it('[C260257] Should display content when clicking on folder from search suggestions', async () => {
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.enterText(firstFolderModel.shortName);
|
||||
|
||||
await searchBarPage.resultTableContainsRow(firstFolderModel.name);
|
||||
@ -227,9 +224,8 @@ describe('Search component - Search Bar', () => {
|
||||
});
|
||||
|
||||
it('[C272801] Should display message when searching for non-existent folder', async () => {
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.enterTextAndPressEnter(search.inactive.name);
|
||||
await searchResultPage.dataTable.waitTillContentLoaded();
|
||||
|
||||
@ -237,9 +233,8 @@ describe('Search component - Search Bar', () => {
|
||||
});
|
||||
|
||||
it('[C272802] Should be able to find an existent folder in search results', async () => {
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.enterTextAndPressEnter(firstFolderModel.name);
|
||||
await searchResultPage.dataTable.waitTillContentLoaded();
|
||||
|
||||
@ -247,28 +242,17 @@ describe('Search component - Search Bar', () => {
|
||||
});
|
||||
|
||||
it('[C260258] Should be able to find an existent file in search results', async () => {
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.enterTextAndPressEnter(firstFileModel.name);
|
||||
await searchResultPage.dataTable.waitTillContentLoaded();
|
||||
|
||||
await searchResultPage.checkContentIsDisplayed(firstFileModel.name);
|
||||
});
|
||||
|
||||
it('[C91321] Should be able to use down arrow key when navigating throw suggestions', async () => {
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await searchBarPage.enterText(secondFolder.shortName);
|
||||
await searchBarPage.pressDownArrowAndEnter();
|
||||
await searchResultPage.dataTable.waitTillContentLoaded();
|
||||
|
||||
await expect(await contentServicesPage.currentFolderName()).toEqual(secondFolder.name);
|
||||
});
|
||||
|
||||
it('[C290137] Should be able to search by \'%\'', async () => {
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.enterTextAndPressEnter('%');
|
||||
await searchResultPage.dataTable.waitTillContentLoaded();
|
||||
});
|
||||
@ -281,9 +265,8 @@ describe('Search component - Search Bar', () => {
|
||||
|
||||
await LocalStorageUtil.setConfigField('search', JSON.stringify(searchConfiguration));
|
||||
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
await openSearchBar();
|
||||
|
||||
await searchBarPage.enterTextAndPressEnter(term);
|
||||
await searchResultPage.dataTable.waitTillContentLoaded();
|
||||
|
||||
@ -295,4 +278,14 @@ describe('Search component - Search Bar', () => {
|
||||
await expect(text.includes(`(${term})`)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
async function openSearchBar(): Promise<void> {
|
||||
if (await searchBarPage.searchBarExpanded.isDisplayed()) {
|
||||
await searchBarPage.clearText();
|
||||
await searchBarPage.checkSearchBarIsNotVisible();
|
||||
}
|
||||
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.checkSearchBarIsVisible();
|
||||
}
|
||||
});
|
||||
|
@ -98,7 +98,6 @@ describe('Search Component - Multi-Select Facet', () => {
|
||||
uploadActions.deleteFileOrFolder(txtFileSite.entry.id)
|
||||
]);
|
||||
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
await sitesApi.deleteSite(site.entry.id, { permanent: true });
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
@ -216,7 +215,6 @@ describe('Search Component - Multi-Select Facet', () => {
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
site = await sitesApi.createSite({
|
||||
title: StringUtil.generateRandomString(8),
|
||||
visibility: 'PUBLIC'
|
||||
@ -239,7 +237,6 @@ describe('Search Component - Multi-Select Facet', () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await uploadActions.deleteFileOrFolder(txtFile.entry.id);
|
||||
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
await sitesApi.deleteSite(site.entry.id, { permanent: true });
|
||||
});
|
||||
|
||||
|
@ -82,7 +82,7 @@ describe('Search component - Search Page', () => {
|
||||
|
||||
await uploadActions.uploadFile(firstFileModel.location, firstFileModel.name, '-my-');
|
||||
|
||||
await apiService.login(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await uploadActions.createEmptyFiles(adminFileNames, newFolderModelUploaded.entry.id);
|
||||
|
||||
|
@ -88,7 +88,7 @@ async function deleteDescriptor(args: ConfigArgs, apiService: any, name: string)
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam, contentTypes, accepts);
|
||||
} catch (error) {
|
||||
logger.error(`Not possible to delete the descriptor ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error.response.text)}`);
|
||||
logger.error(`Not possible to delete the descriptor ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error?.response?.text)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ async function deleteProject(args: ConfigArgs, apiService: any, projectId: strin
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam, contentTypes, accepts);
|
||||
} catch (error) {
|
||||
logger.error(`Not possible to delete the project ${projectId} status : ${JSON.stringify(error.status)} ${JSON.stringify(error.response.text)}`);
|
||||
logger.error(`Not possible to delete the project ${projectId} status : ${JSON.stringify(error.status)} ${JSON.stringify(error?.response?.text)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ async function undeployApplication(args: ConfigArgs, apiService: any, name: stri
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam, contentTypes, accepts);
|
||||
} catch (error) {
|
||||
logger.error(`Not possible to undeploy the applications ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error.response.text)}`);
|
||||
logger.error(`Not possible to undeploy the applications ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error?.response?.text)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,9 +97,9 @@ async function handleLoginError(loginError) {
|
||||
checkEnvReachable(loginError);
|
||||
loginAttempts++;
|
||||
if (MAX_ATTEMPTS === loginAttempts) {
|
||||
if (loginError && loginError.response && loginError.response.text) {
|
||||
if (loginError && loginError.response && loginError?.response?.text) {
|
||||
try {
|
||||
const parsedJson = JSON.parse(loginError.response.text);
|
||||
const parsedJson = JSON.parse(loginError?.response?.text);
|
||||
if (typeof parsedJson === 'object' && parsedJson.error) {
|
||||
const { stackTrace, ...errorWithoutDeprecatedProperty } = parsedJson.error;
|
||||
logger.error(errorWithoutDeprecatedProperty);
|
||||
@ -208,9 +208,9 @@ async function getFilesCount(): Promise<number> {
|
||||
|
||||
function handleError(error) {
|
||||
logger.error(` ${red}Error encountered${reset}`);
|
||||
if (error && error.response && error.response.text) {
|
||||
if (error && error.response && error?.response?.text) {
|
||||
try {
|
||||
const parsedJson = JSON.parse(error.response.text);
|
||||
const parsedJson = JSON.parse(error?.response?.text);
|
||||
if (typeof parsedJson === 'object' && parsedJson.error) {
|
||||
const { stackTrace, ...errorWithoutDeprecatedProperty } = parsedJson.error;
|
||||
logger.error(errorWithoutDeprecatedProperty);
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService } from '../../../../core/services';
|
||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { AuditApi, AuditAppPaging, AuditAppEntry, AuditApp, AuditBodyUpdate, AuditEntryPaging, AuditEntryEntry } from '@alfresco/js-api';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@ -28,8 +28,7 @@ export class AuditService {
|
||||
|
||||
auditApi: AuditApi;
|
||||
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService) {
|
||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||
this.auditApi = new AuditApi(this.apiService.getInstance());
|
||||
}
|
||||
|
||||
@ -111,7 +110,7 @@ export class AuditService {
|
||||
}
|
||||
|
||||
private handleError(error: any): any {
|
||||
console.error(error);
|
||||
this.logService.error(error);
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { RatingEntry, RatingBody } from '@alfresco/js-api';
|
||||
import { from, throwError, Observable } from 'rxjs';
|
||||
@ -26,7 +26,7 @@ import { catchError } from 'rxjs/operators';
|
||||
})
|
||||
export class RatingService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService) {
|
||||
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,7 +74,7 @@ export class RatingService {
|
||||
}
|
||||
|
||||
private handleError(error: any): any {
|
||||
console.error(error);
|
||||
this.logService.error(error);
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user