automate tests for search filters and search results sorting

This commit is contained in:
Adina Parpalita
2020-01-05 19:00:19 +02:00
parent 03bb0b139f
commit e27a517ad7
9 changed files with 869 additions and 94 deletions

View File

@@ -51,8 +51,15 @@ export class UploadApi extends RepoApi {
}
}
async uploadFileWithRename(fileName: string, parentFolderId: string = '-my-', newName: string) {
async uploadFileWithRename(fileName: string, parentId: string = '-my-', newName: string, title: string = '', description: string = '') {
const file = fs.createReadStream(`${E2E_ROOT_PATH}/resources/test-files/${fileName}`);
const nodeProps = {
properties: {
'cm:title': title,
'cm:description': description
}
};
const opts = {
name: newName,
nodeType: 'cm:content'
@@ -60,7 +67,7 @@ export class UploadApi extends RepoApi {
try {
await this.apiAuth();
return await this.upload.uploadFile(file, '', parentFolderId, null, opts);
return await this.upload.uploadFile(file, '', parentId, nodeProps, opts);
} catch (error) {
this.handleError(`${this.constructor.name} ${this.uploadFileWithRename.name}`, error);
}