[ACS-7336] Added Playwright e2e Search - Tags & Deleted Protractor Search tests (#3812)

* ACS-7336 [Added] playwright e2e Search - Tags
[Deleted] Protractor Search tests
This commit is contained in:
Katarzyna Kita
2024-04-24 15:49:00 +02:00
committed by GitHub
parent 27a14426bc
commit e670441499
7 changed files with 170 additions and 533 deletions

View File

@@ -41,7 +41,8 @@ import {
TrashcanApi,
PersonEntry,
CommentsApi,
CategoriesApi
CategoriesApi,
TagsApi
} from '@alfresco/js-api';
import { ActionTypes, Rule } from './rules-api';
import { users } from '../base-config';
@@ -88,6 +89,7 @@ export class ApiClientFactory {
public commentsApi: CommentsApi;
public queriesApi: QueriesApi;
public categoriesApi: CategoriesApi;
public tagsApi: TagsApi;
constructor() {
this.alfrescoApi = new AlfrescoApi(config);
@@ -113,6 +115,7 @@ export class ApiClientFactory {
this.commentsApi = new CommentsApi(this.alfrescoApi);
this.queriesApi = new QueriesApi(this.alfrescoApi);
this.categoriesApi = new CategoriesApi(this.alfrescoApi);
this.tagsApi = new TagsApi(this.alfrescoApi);
return this;
}

View File

@@ -35,3 +35,4 @@ export * from './search-api';
export * from './trashcan-api';
export * from './queries-api';
export * from './categories-api';
export * from './tags-api';

View File

@@ -0,0 +1,66 @@
/*!
* Copyright © 2005-2024 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
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { TagBody, TagEntry } from '@alfresco/js-api';
import { ApiClientFactory } from './api-client-factory';
export class TagsApi {
private apiService: ApiClientFactory;
constructor() {
this.apiService = new ApiClientFactory();
}
static async initialize(userName: string, password?: string): Promise<TagsApi> {
const classObj = new TagsApi();
await classObj.apiService.setUpAcaBackend(userName, password);
return classObj;
}
async createTags(tags: TagBody[]): Promise<TagEntry[]> {
try {
return await this.apiService.tagsApi.createTags(tags);
} catch (error) {
console.error(error);
return null;
}
}
async assignTagToNode(nodeId: string, tag: TagBody): Promise<TagEntry> {
try {
return await this.apiService.tagsApi.assignTagToNode(nodeId, tag);
} catch (error) {
console.error(error);
return null;
}
}
async deleteTag(tagId: string): Promise<void> {
try {
return await this.apiService.tagsApi.deleteTag(tagId);
} catch (error) {
console.error(error);
}
}
}

View File

@@ -34,13 +34,12 @@ export class SearchFiltersLocation extends BaseComponent {
}
public addOptionInput = this.getChild(`[data-automation-id$='adf-search-chip-autocomplete-input']`);
public applyButton = this.page.locator('#apply-filter-button');
async filterByLocation(page: SearchPage, location: string): Promise<void> {
await page.searchFilters.locationFilter.click();
await page.searchFiltersLocation.addOptionInput.fill(location);
await page.page.keyboard.press('Enter');
await page.searchFiltersLocation.applyButton.click();
await page.searchFilters.menuCardApply.click();
await page.dataTable.progressBarWaitForReload();
}
}

View File

@@ -22,6 +22,7 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { SearchPage } from '@alfresco/playwright-shared';
import { BaseComponent } from '../../base.component';
import { Page } from '@playwright/test';
@@ -33,4 +34,12 @@ export class SearchFiltersTags extends BaseComponent {
}
public addOptionInput = this.getChild(`[data-automation-id$='adf-search-chip-autocomplete-input']`);
async filterByTag(page: SearchPage, tag: string): Promise<void> {
await page.searchFilters.tagsFilter.click();
await page.searchFiltersTags.addOptionInput.fill(tag);
await page.page.keyboard.press('Enter');
await page.searchFilters.menuCardApply.click();
await page.dataTable.progressBarWaitForReload();
}
}