[ACS-5511] create library playwright tests (#3318)

* [ACS-511]-adding-library-tests

* updating tests and adding before and after all

* spinner timeouts update

* updating import statement

* update error locator

* adding random method in general utils

* [ACA-4715] break dependency on envsubst (#3325)

* remove BPM host

* break dependency on envsubst

* remove prebuild script

* cleanup package.json

* [ACS-511]-adding-library-tests

* adding lost MyLibrariesPage import

* rebase page initialization merge

* [ACS-511]-adding-library-tests

* comma deleted

* fix readability and indentation

* adding id to info drawer

* adding index and updating import

* updating after wrong rebase

* after rebase

* updating tests and adding before and after all

* updating import statement

* update error locator

* adding random method in general utils

* [ACS-511]-adding-library-tests

* comma deleted

* fix readability and indentation

* adding id to info drawer

* adding index and updating import

* next after rebase

* update delete in folder tests

* providing string as parameter

* after rebase

* updating tests and adding before and after all

* adding random method in general utils

* [ACS-511]-adding-library-tests

* comma deleted

* [ACS-511]-adding-library-tests

* adding index and updating import

* providing string as parameter

* delete protractor create-library tests

* update for calls in expect method

* bump to 4.2.0 (#3334)

* adding random method in general utils

* adding index and updating import

* providing string as parameter

* after rebase

* providing string as parameter

* update for tests C280026 and C280027

* raising time for visibility check

* quotes change in error strings

* adding waitFor method

* raising timeout in isErrorMessageDisplayed method

* updating mat-error locator

* adding press tab after fill

* update general-utils to utils for random

* updating label typo

---------

Co-authored-by: Denys Vuika <denys.vuika@gmail.com>
This commit is contained in:
Adam Zakrzewski
2023-07-18 09:28:54 +02:00
committed by GitHub
parent a89c30f3c0
commit 4ded3b200d
20 changed files with 572 additions and 256 deletions

View File

@@ -0,0 +1,64 @@
/*!
* 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 { timeouts } from '../../../utils';
import { BaseComponent } from '../base.component';
import { Locator, Page } from '@playwright/test';
export class AdfLibraryDialogComponent extends BaseComponent {
private static rootElement = 'adf-library-dialog';
public createButton = this.getChild('[data-automation-id="create-library-id"]');
public cancelButton = this.getChild('[data-automation-id="cancel-library-id"]');
constructor(page: Page) {
super(page, AdfLibraryDialogComponent.rootElement);
}
public getLabelText = (text: string) => this.getChild('label', { hasText: text });
public getDialogTitle = (text: string) => this.getChild('.mat-dialog-title', { hasText: text });
public getErrorByText = (text: string): Locator => this.page.locator('mat-error', {hasText: text});
/**
* This method is used when we want to fill in Create Library Dialog and choose Create button
*
* @param nameInput input for the Name field
* @param libraryIdInput input for Library ID field
* @param descriptionInput input for Description field
* @param visibility visibility of the library
*/
async createLibraryWithNameAndId(nameInput: string, libraryIdInput: string, descriptionInput?: string, visibility?: string): Promise<void> {
await this.getLabelText('Name *').fill(nameInput);
await this.getLabelText('Library ID *').clear();
await this.getLabelText('Library ID *').fill(libraryIdInput);
if (descriptionInput) { await this.getLabelText('Description').fill(descriptionInput); }
if (visibility) { await this.getLabelText(visibility).click(); }
await this.createButton.click();
}
async isErrorMessageDisplayed(errorText: string): Promise<boolean> {
await this.getErrorByText(errorText).waitFor({ state: 'visible', timeout: timeouts.large });
return await this.getErrorByText(errorText).isVisible();
}
}

View File

@@ -23,3 +23,5 @@
*/
export * from './adf-folder-dialog.component';
export * from './adf-library-dialog.component';