mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-16 18:12:50 +00:00
[ACS-12816] Automated MNT-25876 (#5390)
This commit is contained in:
@@ -123,16 +123,4 @@ export class FavoritesApi {
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
async removeFavoritesByIds(username: string, ids: string[]): Promise<void> {
|
||||
try {
|
||||
if (ids && ids.length > 0) {
|
||||
for (const id of ids) {
|
||||
await this.apiService.favorites.deleteFavorite(username, id);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`FavoritesApi: removeFavoritesByIds failed: ${error}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ export class NodesApi {
|
||||
try {
|
||||
await this.apiService.nodes.deleteNodes(nodeIds, { permanent });
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.deleteNodes.name}: ${error}`);
|
||||
logger.error(`${this.constructor.name} ${this.deleteNodes.name}: ${JSON.stringify(error)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,6 +248,21 @@ export class NodesApi {
|
||||
}
|
||||
}
|
||||
|
||||
async getRepositoryFolderId(): Promise<string> {
|
||||
try {
|
||||
const folder = (await this.createFolder(`e2e-deleteMe-${Utils.random()}`, '-my-')).entry;
|
||||
await this.deleteNodeById(folder.id);
|
||||
if (!folder.parentId) {
|
||||
throw new Error('getRepositoryFolderId: parent id (repository folder) is undefined');
|
||||
}
|
||||
return folder.parentId;
|
||||
} catch (error) {
|
||||
const message = `${this.constructor.name} ${this.getRepositoryFolderId.name}: ${error}`;
|
||||
logger.error(message);
|
||||
throw new Error(message);
|
||||
}
|
||||
}
|
||||
|
||||
async getNodeIdFromParent(name: string, parentId: string): Promise<string> {
|
||||
try {
|
||||
const children = (await this.getNodeChildren(parentId))?.list?.entries ?? [];
|
||||
|
||||
@@ -33,7 +33,8 @@ import {
|
||||
SharedPage,
|
||||
SearchPage,
|
||||
FavoritesPage,
|
||||
TrashPage
|
||||
TrashPage,
|
||||
RepositoryPage
|
||||
} from '../page-objects';
|
||||
import { FileActionsApi, SharedLinksApi, FavoritesApi, NodesApi, SitesApi } from '../api';
|
||||
import { users } from '../base-config';
|
||||
@@ -50,6 +51,7 @@ interface Pages {
|
||||
trashPage: TrashPage;
|
||||
loginPage: LoginPage;
|
||||
favoriteLibrariesPage: FavoritesLibrariesPage;
|
||||
repositoryPage: RepositoryPage;
|
||||
}
|
||||
|
||||
interface Api {
|
||||
@@ -88,6 +90,9 @@ export const test = base.extend<Pages & Api>({
|
||||
loginPage: async ({ page }, use) => {
|
||||
await use(new LoginPage(page));
|
||||
},
|
||||
repositoryPage: async ({ page }, use) => {
|
||||
await use(new RepositoryPage(page));
|
||||
},
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
fileAction: async ({}, use) => {
|
||||
await use(await FileActionsApi.initialize(users.hruser.username));
|
||||
|
||||
@@ -33,3 +33,4 @@ export * from './search.page';
|
||||
export * from './favorites.page';
|
||||
export * from './trash.page';
|
||||
export * from './favorites-libraries.page';
|
||||
export * from './repository.page';
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*!
|
||||
* Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Page } from '@playwright/test';
|
||||
import { BasePage } from './base.page';
|
||||
|
||||
export class RepositoryPage extends BasePage {
|
||||
private static readonly pageUrl = 'repository';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, RepositoryPage.pageUrl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user