[ACA-1767] add viewer actions tests in other list views (#646)

This commit is contained in:
Adina Parpalita
2018-09-19 15:56:04 +03:00
committed by Denys Vuika
parent 85599f6739
commit 0f3fffcff4
5 changed files with 763 additions and 151 deletions

View File

@@ -85,6 +85,12 @@ export class NodesApi extends RepoApi {
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId);
}
async deleteNodeChildren(parentId: string) {
const nodeIds = (await this.getNodeChildren(parentId)).list.entries
.map(entries => entries.entry.id);
return await this.deleteNodesById(nodeIds);
}
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '') {
const nodeBody = {
name,

View File

@@ -37,7 +37,7 @@ export class UploadApi extends RepoApi {
async uploadFile(fileName: string, parentFolderId: string = '-my-') {
const file = fs.createReadStream(`${E2E_ROOT_PATH}/resources/test-files/${fileName}`);
const opts = {
mane: file.name,
name: file.name,
nodeType: 'cm:content'
};
@@ -45,4 +45,15 @@ export class UploadApi extends RepoApi {
return await this.alfrescoJsApi.upload.uploadFile(file, '', parentFolderId, null, opts);
}
async uploadFileWithRename(fileName: string, parentFolderId: string = '-my-', newName: string) {
const file = fs.createReadStream(`${E2E_ROOT_PATH}/resources/test-files/${fileName}`);
const opts = {
name: newName,
nodeType: 'cm:content'
};
await this.apiAuth();
return await this.alfrescoJsApi.upload.uploadFile(file, '', parentFolderId, null, opts);
}
}