[ACS-6443] cleanup for redundant e2es and unused methods (#3547)

* [ACS-6443] removed redundant e2es and unused methods

* [ACS-6443] cleanup

* [ACS-6443] cleanup

* [ACS-6443] undo cleanup

* [ACS-6443] linting fix

* [ACS-6443] cleanup

* [ACS-6443] cleanup

* [ACS-6443] addressed review comments
This commit is contained in:
SheenaMalhotra182
2023-12-01 13:33:23 +05:30
committed by GitHub
parent 437cf9154e
commit 78b1e3e460
9 changed files with 0 additions and 1035 deletions

View File

@@ -25,7 +25,6 @@
import { Logger } from '@alfresco/adf-testing';
import { AlfrescoApi, Comment, CommentsApi, NodesApi, TrashcanApi, SitesApi, SharedlinksApi } from '@alfresco/js-api';
import { browser } from 'protractor';
import { Utils } from './utils';
export class UserActions {
protected readonly alfrescoApi: AlfrescoApi;
@@ -109,43 +108,6 @@ export class UserActions {
}
}
/**
* Returns the amount of deleted nodes in the trashcan.
* TODO: limited to 1000 items only, needs improvements.
*/
async getTrashcanSize(): Promise<number> {
try {
const response = await this.trashcanApi.listDeletedNodes({
maxItems: 1000
});
return response?.list?.pagination?.totalItems || 0;
} catch (error) {
this.handleError('User Actions - getTrashcanSize failed : ', error);
return -1;
}
}
/**
* Performs multiple calls to retrieve the size of the trashcan until the expectedSize is reached.
* Used with eventual consistency calls.
* @param expectedSize Size of the trashcan to wait for.
*/
async waitForTrashcanSize(expectedSize: number): Promise<number> {
return Utils.retryCall(async () => {
const totalItems = await this.getTrashcanSize();
if (totalItems !== expectedSize) {
return Promise.reject(totalItems);
} else {
return Promise.resolve(totalItems);
}
}).catch((error) => {
this.handleError('User Actions - waitForTrashcanSize failed : ', error);
return -1;
});
}
async lockNodes(nodeIds: string[], lockType: string = 'ALLOW_OWNER_CHANGES') {
try {
for (const nodeId of nodeIds) {