[ACS-8951] [E2E] tags and categories e2es added in ACA (#4210)

* [ACS-8951] [E2E] tags and categories e2es added in ACA

* [ACS-8951] sonar fix 1

* [ACS-8951] added tag deletion in afterAll

* [ACS-8951] added tag deletion

* [ACS-8951] sonar fix 2

* [ACS-8951] review fix 1

* [ACS-8951] Small code cleanup

* [ACS-8951] review fix 2

* [ACS-8951] review fix 3
This commit is contained in:
Adam Świderski
2024-11-06 08:54:17 +01:00
committed by GitHub
parent b68db2e7c5
commit 62f38ee8a6
3 changed files with 228 additions and 21 deletions

View File

@@ -22,7 +22,7 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { TagBody, TagEntry } from '@alfresco/js-api';
import { TagBody, TagEntry, TagPaging } from '@alfresco/js-api';
import { ApiClientFactory } from './api-client-factory';
export class TagsApi {
@@ -63,4 +63,13 @@ export class TagsApi {
console.error(error);
}
}
async listTagsForNode(nodeId: string): Promise<TagPaging> {
try {
return this.apiService.tagsApi.listTagsForNode(nodeId);
} catch (error) {
console.error(error);
return null;
}
}
}

View File

@@ -32,6 +32,9 @@ export class AdfInfoDrawerComponent extends BaseComponent {
super(page, AdfInfoDrawerComponent.rootElement);
}
private readonly categoriesManagement = this.getChild('adf-categories-management');
private readonly tagsCreator = this.getChild('adf-tags-creator');
public getNameField = (labelText: string) =>
this.getChild(`[data-automation-id="library-name-properties-wrapper"] input[placeholder='${labelText}']`);
public getIdField = (labelText: string) => this.getChild(`[data-automation-id="library-id-properties-wrapper"] input[placeholder='${labelText}']`);
@@ -63,6 +66,22 @@ export class AdfInfoDrawerComponent extends BaseComponent {
public descriptionField = this.page.locator('textarea[placeholder=Description]');
public visibilityField = this.infoDrawerPanel.getByRole('combobox');
public selectVisibility = (visibilityOption: string) => this.page.getByRole('listbox').getByRole('option', { name: visibilityOption }).click();
public tagsAccordion = this.getChild('[data-automation-id="adf-content-metadata-tags-panel"]');
public categoriesAccordion = this.getChild('[data-automation-id="adf-content-metadata-categories-panel"]');
public tagsAccordionPenButton = this.tagsAccordion.locator('[data-automation-id="showing-tag-input-button"]');
public categoriesAccordionPenButton = this.categoriesAccordion.locator('[data-automation-id="meta-data-categories-edit"]');
public tagsInput = this.tagsCreator.locator('input');
public createTagButton = this.tagsCreator.locator('[role="button"]');
public tagsChips = this.tagsCreator.locator('mat-chip');
public tagsChipsXButton = this.tagsChips.locator('button');
public tagsAccordionCancelButton = this.getChild('[data-automation-id="reset-tags-metadata"]');
public tagsAccordionConfirmButton = this.getChild('[data-automation-id="save-tags-metadata"]');
public categoriesAccordionCancelButton = this.getChild('[data-automation-id="reset-metadata"]');
public categoriesAccordionConfirmButton = this.getChild('[data-automation-id="save-categories-metadata"]');
public categoriesInput = this.categoriesManagement.locator('input');
public categoriesListItems = this.categoriesManagement.locator('mat-list-item');
public categoriesItemRemoveButton = this.categoriesManagement.locator('[data-automation-id="categories-remove-category-button"]');
public categoriesCreatedList = this.getChild('.adf-metadata-categories');
async checkCommentsHeaderCount(): Promise<number> {
const commentsCountTextContent = await this.commentsHeader.textContent();