[ACS-8688] export playwright shared lib (#4068)

* [ACS-8688] export playwright shared lib

* [ACS-8688] changes name

* [ACS-8688] changes name

* [ACS-8688] add lint file and fix lint issue

* [ACS-8688] test fix

* added ng package file
This commit is contained in:
Akash Rathod
2024-09-03 14:16:02 +02:00
committed by GitHub
parent 14bb6b3155
commit 56c2c55daf
66 changed files with 406 additions and 295 deletions

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@@ -1,26 +1,26 @@
/*!
* 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
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
* 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
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { BaseComponent } from '../base.component';
import { Page } from '@playwright/test';
@@ -49,10 +49,14 @@ export class AdfFolderDialogComponent extends BaseComponent {
* @param titleInput input for Title field
* @param descriptionInput input for Description field
*/
async createNewFolderDialog(nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
await this.folderNameInputLocator.fill(nameInput);
if (titleInput) { await this.folderTitleInput.fill(titleInput); }
if (descriptionInput) { await this.folderDescriptionInput.fill(descriptionInput); }
await this.createButton.click();
}
async createNewFolderDialog(nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
await this.folderNameInputLocator.fill(nameInput);
if (titleInput) {
await this.folderTitleInput.fill(titleInput);
}
if (descriptionInput) {
await this.folderDescriptionInput.fill(descriptionInput);
}
await this.createButton.click();
}
}

View File

@@ -1,26 +1,26 @@
/*!
* 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
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
* 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
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { timeouts } from '../../../utils';
import { BaseComponent } from '../base.component';
@@ -39,9 +39,9 @@ export class AdfLibraryDialogComponent extends BaseComponent {
public getLabelText = (text: string) => this.getChild('label', { hasText: text });
public getRequiredMarker = (text: string) => this.getLabelText(text).locator('.mat-mdc-form-field-required-marker');
public getDialogTitle = (text: string) => this.getChild('.mat-mdc-dialog-title', { hasText: text });
public getErrorByText = (text: string): Locator => this.page.locator('mat-error', {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
@@ -49,18 +49,22 @@ export class AdfLibraryDialogComponent extends BaseComponent {
* @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();
await this.spinnerWaitForReload();
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();
await this.spinnerWaitForReload();
}
async isErrorMessageDisplayed(errorText: string): Promise<boolean> {
await this.getErrorByText(errorText).waitFor({ state: 'visible', timeout: timeouts.large });
return await this.getErrorByText(errorText).isVisible();
}
async isErrorMessageDisplayed(errorText: string): Promise<boolean> {
await this.getErrorByText(errorText).waitFor({ state: 'visible', timeout: timeouts.large });
return this.getErrorByText(errorText).isVisible();
}
}

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Locator, Page, expect } from '@playwright/test';
@@ -36,7 +36,8 @@ export class ContentNodeSelectorDialog extends BaseComponent {
public actionButton = this.getChild('[data-automation-id="content-node-selector-actions-choose"]');
public locationDropDown = this.getChild('[id="site-dropdown-container"] mat-form-field');
private selectedRow = this.getChild('.adf-is-selected');
getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName });
getOptionLocator = (optionName: string): Locator =>
this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName });
private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
getDialogTitle = (text: string) => this.getChild('[data-automation-id="content-node-selector-title"]', { hasText: text });
getBreadcrumb = (text: string) => this.getChild('[data-automation-id="current-folder"]', { hasText: text });

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Locator, Page } from '@playwright/test';
@@ -37,21 +37,24 @@ export class CreateFromTemplateDialogComponent extends BaseComponent {
createButton = this.getChild('[data-automation-id="create-from-template-dialog-create-button"]');
getDialogTitle = (text: string) => this.getChild('.mat-dialog-title', { hasText: text });
getDialogLabel = (text: string) => this.getChild('label', { hasText: text });
getErrorByText = (text: string): Locator => this.page.locator('mat-error', {hasText: text});
getErrorByText = (text: string): Locator => this.page.locator('mat-error', { hasText: text });
async isErrorMessageDisplayed(errorText: string): Promise<boolean> {
await this.getErrorByText(errorText).waitFor({ state: 'visible', timeout: timeouts.large });
return await this.getErrorByText(errorText).isVisible();
return this.getErrorByText(errorText).isVisible();
}
/**
/**
* This method is used when we want to fill in Create new folder/document/file from template dialog and choose Create button
*/
async createFromTemplateAction( nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
await this.getDialogLabel('Name *').fill(nameInput);
if (titleInput) { await this.getDialogLabel('Title').fill(titleInput); }
if (descriptionInput) { await this.getDialogLabel('Description').fill(descriptionInput); }
await this.createButton.click();
async createFromTemplateAction(nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
await this.getDialogLabel('Name *').fill(nameInput);
if (titleInput) {
await this.getDialogLabel('Title').fill(titleInput);
}
if (descriptionInput) {
await this.getDialogLabel('Description').fill(descriptionInput);
}
await this.createButton.click();
}
}

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';
@@ -39,4 +39,4 @@ export class EditDialog extends BaseComponent {
constructor(page: Page) {
super(page, EditDialog.rootElement);
}
}
}

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Locator, Page, expect } from '@playwright/test';
@@ -35,7 +35,8 @@ export class LinkRulesDialog extends BaseComponent {
cancelButton = this.getChild('[data-automation-id="content-node-selector-actions-cancel"]');
selectFolderButton = this.getChild('button', { hasText: ' Select folder ' });
emptyLinkRules = this.getChild('.adf-empty-content__title');
getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName });
getOptionLocator = (optionName: string): Locator =>
this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName });
private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
getDialogTitle = (text: string) => this.getChild('[data-automation-id="content-node-selector-title"]', { hasText: text });
getBreadcrumb = (text: string) => this.getChild('[data-automation-id="current-folder"]', { hasText: text });

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@@ -50,24 +50,24 @@ export class PasswordOverlayDialogComponent extends BaseComponent {
async isDialogOpen(): Promise<boolean> {
await this.waitForDialogToOpen();
return await this.passwordInput.isVisible();
return this.passwordInput.isVisible();
}
async isCloseVisible(): Promise<boolean> {
return await this.closeButton.isVisible();
return this.closeButton.isVisible();
}
async isSubmitHidden(): Promise<boolean> {
return await this.submitButton.isHidden();
return this.submitButton.isHidden();
}
async isPasswordInputDisplayed(): Promise<boolean> {
return await this.passwordInput.isVisible();
return this.passwordInput.isVisible();
}
async isErrorDisplayed(): Promise<boolean> {
await this.errorMessage.waitFor({ state: 'visible', timeout: timeouts.short });
return await this.errorMessage.isVisible();
return this.errorMessage.isVisible();
}
async getErrorMessage(): Promise<string> {

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ElementHandle, Locator, Page } from '@playwright/test';
@@ -51,19 +51,19 @@ export class ShareDialogComponent extends BaseComponent {
getErrorByText = (text: string): Locator => this.page.locator('mat-error', { hasText: text });
async getLabels(): Promise<Array<string>> {
return await this.page.$$eval('.adf-share-link__label', (elements) => elements.map((element) => element.textContent));
return this.page.$$eval('.adf-share-link__label', (elements) => elements.map((element) => element.textContent));
}
async getDialogTitle(): Promise<string> {
return await this.dialogTitle.innerText();
return this.dialogTitle.innerText();
}
async getInfoText(): Promise<string> {
return await this.infoText.innerText();
return this.infoText.innerText();
}
async getLinkUrl(): Promise<string> {
return await this.url.first().inputValue();
return this.url.first().inputValue();
}
async isUrlReadOnly(): Promise<boolean> {
@@ -72,7 +72,7 @@ export class ShareDialogComponent extends BaseComponent {
}
async isCloseEnabled(): Promise<boolean> {
return await this.closeButton.isEnabled();
return this.closeButton.isEnabled();
}
async clickClose(): Promise<void> {
@@ -96,6 +96,6 @@ export class ShareDialogComponent extends BaseComponent {
}
async getExpireDate(): Promise<string> {
return await this.expireInput.inputValue();
return this.expireInput.inputValue();
}
}

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@@ -19,7 +19,7 @@
* 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/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';