[ACS-6239] Migrated personal files of pagination suit to playwright (#3528)

* [ACS-6239] Migrated personal files of pagination suit to playwright

* [ACS-6239] Remove only

* Added path in json file

* [ACS-6239] Addressed review comments

* [ACS-6239] Addressed review comments

* [ACS-6239] Removed material classes and used roles for test cases

* Addressed review comments
This commit is contained in:
Kritagya Jaiswal
2023-11-23 19:07:03 +05:30
committed by GitHub
parent 207410c44c
commit f705c462be
14 changed files with 408 additions and 147 deletions

View File

@@ -23,7 +23,7 @@
*/
import { ApiClientFactory } from './api-client-factory';
import { NodeChildAssociationPaging, NodeEntry } from '@alfresco/js-api';
import { NodeChildAssociationPaging, NodeEntry, NodePaging } from '@alfresco/js-api';
import { logger } from '@alfresco/adf-cli/scripts/logger';
import { NodeContentTree, flattenNodeContentTree } from './node-content-tree';
@@ -73,6 +73,15 @@ export class NodesApi {
}
}
async createFiles(names: string[], relativePath = '/'): Promise<NodePaging> {
try {
return await this.createContent({ files: names }, relativePath);
} catch (error) {
logger.error(`${this.constructor.name} ${this.createFiles.name}: ${error}`);
return null;
}
}
private async createNode(
nodeType: string,
name: string,
@@ -137,9 +146,9 @@ export class NodesApi {
}
/**
* Delete all nodes of the currently logged in user
* @param userNodeId The id of User node, all child nodes of "userNodeId" will be gathered as a list and deleted ( e.g.: "-my-" - User Homes folder)
*/
* Delete all nodes of the currently logged in user
* @param userNodeId The id of User node, all child nodes of "userNodeId" will be gathered as a list and deleted ( e.g.: "-my-" - User Homes folder)
*/
async deleteCurrentUserNodes(): Promise<void> {
try {
const userNodes = (await this.getNodeChildren('-my-')).list.entries;
@@ -160,11 +169,12 @@ export class NodesApi {
}
}
async createContent(content: NodeContentTree, relativePath: string = '/'): Promise<NodeEntry | any> {
async createContent(content: NodeContentTree, relativePath: string = '/'): Promise<NodePaging> {
try {
return await this.apiService.nodes.createNode('-my-', flattenNodeContentTree(content, relativePath) as any);
} catch (error) {
logger.error(`${this.constructor.name} ${this.createContent.name}`, error);
return null;
}
}
@@ -250,11 +260,10 @@ export class NodesApi {
}
private async getDataDictionaryId(): Promise<string> {
return this.getNodeIdFromParent('Data Dictionary', '-root-')
.catch((error) => {
logger.error('Admin Actions - getDataDictionaryId failed : ', error);
return '';
});
return this.getNodeIdFromParent('Data Dictionary', '-root-').catch((error) => {
logger.error('Admin Actions - getDataDictionaryId failed : ', error);
return '';
});
}
async setGranularPermission(nodeId: string, inheritPermissions: boolean = false, username: string, role: string): Promise<NodeEntry | null> {