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
@@ -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);
}
+7
View File
@@ -92,6 +92,13 @@ export class Utils {
}
}
static async clearFieldWithBackspace(elem: ElementFinder): Promise<void> {
const text = await elem.getAttribute('value');
for (let i = 0; i < text.length; i++) {
await elem.sendKeys(protractor.Key.BACK_SPACE);
}
}
static async fileExistsOnOS(fileName: string, folderName: string = '', subFolderName: string = '') {
const config = await browser.getProcessedConfig();
const filePath = path.join(config.params.downloadFolder, folderName, subFolderName, fileName);