[ACS-6668] [ACS-6669] e2e migration - Info Drawer general and library properties tests (#3628)

*[ACS-6668] [ACS-6669] e2e migration - Info Drawer general and library properties tests 
---------
Co-authored-by: datguycheb <adam.swiderski@hyland.com>
This commit is contained in:
Katarzyna Kita
2024-02-13 09:58:45 +01:00
committed by GitHub
parent 630f698300
commit 1400545c2d
9 changed files with 501 additions and 29 deletions

View File

@@ -1,26 +1,26 @@
/*!
* Copyright © 2005-2023 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/>.
*/
* Copyright © 2005-2023 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 { BaseComponent } from './base.component';
import { Page, expect } from '@playwright/test';
@@ -34,11 +34,12 @@ export class AdfInfoDrawerComponent extends BaseComponent {
public getNameField = (labelText: string) => this.getChild('[data-automation-id="library-name-properties-wrapper"]', { hasText: labelText });
public getIdField = (labelText: string) => this.getChild('[data-automation-id="library-id-properties-wrapper"]', { hasText: labelText });
public getVisibilityField = (labelText: string) => this.getChild('[data-automation-id="library-visibility-properties-wrapper"]', { hasText: labelText });
public getVisibilityField = (labelText: string) =>
this.getChild('[data-automation-id="library-visibility-properties-wrapper"]', { hasText: labelText });
public getDescriptionField = this.getChild('[data-automation-id="library-description-properties-wrapper"] textarea');
public propertiesTab = this.page.getByRole('tab', { name: 'Properties' });
public commentsTab = this.page.getByRole('tab', { name: 'Comments' });
public infoDrawerTabs = this.getChild('.adf-info-drawer-tab');
public propertiesTab = this.infoDrawerTabs.nth(0);
public commentsTab = this.infoDrawerTabs.nth(1);
public commentInputField = this.getChild('mat-form-field');
public commentsHeader = this.getChild('#comment-header');
public addCommentButton = this.getChild('[data-automation-id="comments-input-add"]');
@@ -46,11 +47,21 @@ export class AdfInfoDrawerComponent extends BaseComponent {
public commentUsername = this.getChild('.adf-comment-user-name');
public commentTextContent = this.getChild('.adf-comment-message');
public commentTimestamp = this.getChild('.adf-comment-message-time');
public headerTitle = this.getChild('.adf-info-drawer-layout-header-title div');
public infoDrawerPanel = this.page.locator('.adf-info-drawer');
public headerTitle = this.page.locator('.adf-info-drawer-layout-header-title').getByRole('heading');
public editButton = this.page.getByRole('button', { name: 'Edit' });
public cancelButton = this.page.getByRole('button', { name: 'Cancel' });
public updateButton = this.page.getByRole('button', { name: 'Update' });
public hintMessage = this.page.locator('.mat-hint');
public errorMessage = this.page.locator('.mat-error');
public expandDetailsButton = this.getChild(`button[title='Expand panel']`);
public expandedDetailsTabs = this.page.locator('.aca-details-container .mat-tab-label-content');
public expandedDetailsPermissionsTab = this.expandedDetailsTabs.getByText("Permissions");
public expandedDetailsPermissionsTab = this.expandedDetailsTabs.getByText('Permissions');
public nameField = this.page.locator('label', { hasText: 'Name' });
public idField = this.page.locator('label', { hasText: 'Library ID' });
public descriptionField = this.page.locator('label', { hasText: 'Description' });
public visibilityField = this.infoDrawerPanel.getByRole('combobox');
public selectVisibility = (visibilityOption: string) => this.page.getByRole('listbox').getByRole('option', { name: visibilityOption }).click();
async checkCommentsHeaderCount(): Promise<number> {
const commentsCountTextContent = await this.commentsHeader.textContent();