[ACS-6510] playwright List View e2e test (#3566)

* [ACS-6435] playwright e2e for list views personal files

* e2e test for trash page

* e2e test for trash page

* e2e test for file-libraries page

* e2e test for file-libraries page fix

* e2e test for file-libraries page fix

* e2e test shared recent  page

* e2e test shared recent  page fix

* e2e test review comment fix

* e2e test review fix flaky test fix

* e2e test fail test fix

* e2e test fail  fix

* test code fix

* protractor list-view test enable

* [ACS-6510] listview playwright e2e test

* code fix

* code fix

* code fix

* code fix

* code fix

* code fix

* code fix for review

* code fix for review
This commit is contained in:
Akash Rathod
2023-12-22 09:36:32 +01:00
committed by GitHub
parent 1d0752ce8f
commit 7465bbbf6d
20 changed files with 859 additions and 817 deletions

View File

@@ -41,7 +41,7 @@ export class FileActionsApi {
return classObj;
}
async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise<any> {
async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise<NodeEntry> {
const file = fs.createReadStream(fileLocation);
return this.apiService.upload.uploadFile(file, '', parentFolderId, null, {
name: fileName,
@@ -50,7 +50,13 @@ export class FileActionsApi {
});
}
async uploadFileWithRename(fileLocation: string, newName: string, parentId: string = '-my-', title: string = '', description: string = '') {
async uploadFileWithRename(
fileLocation: string,
newName: string,
parentId: string = '-my-',
title: string = '',
description: string = ''
): Promise<NodeEntry> {
const file = fs.createReadStream(fileLocation);
const nodeProps = {
properties: {
@@ -68,10 +74,11 @@ export class FileActionsApi {
return await this.apiService.upload.uploadFile(file, '', parentId, nodeProps, opts);
} catch (error) {
Logger.error(`${this.constructor.name} ${this.uploadFileWithRename.name}`, error);
return Promise.reject(error);
}
}
async lockNodes(nodeIds: string[], lockType: string = 'ALLOW_OWNER_CHANGES') {
async lockNodes(nodeIds: string[], lockType: string = 'ALLOW_OWNER_CHANGES'): Promise<void> {
try {
for (const nodeId of nodeIds) {
await this.apiService.nodes.lockNode(nodeId, { type: lockType });
@@ -93,7 +100,7 @@ export class FileActionsApi {
async getNodeProperty(nodeId: string, property: string): Promise<string> {
try {
const node = await this.getNodeById(nodeId);
return (node.entry.properties?.[property]) || '';
return node.entry.properties?.[property] || '';
} catch (error) {
Logger.error(`${this.constructor.name} ${this.getNodeProperty.name}`, error);
return '';
@@ -145,7 +152,7 @@ export class FileActionsApi {
return this.apiService.search.search(data);
} catch (error) {
Logger.error(`SearchApi queryNodesNames : catch : `, error);
return new ResultSetPaging;
return new ResultSetPaging();
}
}
@@ -167,4 +174,18 @@ export class FileActionsApi {
Logger.error(`\tExpected: ${data.expect} items, but found ${error}`);
}
}
async updateNodeContent(nodeId: string, content: string, majorVersion: boolean = true, comment?: string, newName?: string): Promise<NodeEntry> {
try {
const opts: { [key: string]: string | boolean } = {
majorVersion: majorVersion,
comment: comment,
name: newName
};
return await this.apiService.nodes.updateNodeContent(nodeId, content, opts);
} catch (error) {
console.error(`${this.constructor.name} ${this.updateNodeContent.name}`, error);
return Promise.reject(error);
}
}
}