[ACS-5519] viewer-general tests Playwright (#3327)

* [ACS-5519] view general tests Playwright

* [ACS-5519] remove same function call
This commit is contained in:
Akash Rathod
2023-07-11 19:54:58 +02:00
committed by GitHub
parent b192c5f6bb
commit 5abbda78a3
32 changed files with 901 additions and 101 deletions

View File

@@ -35,7 +35,9 @@ import {
SecurityGroupsApi,
SecurityMarksApi,
SitesApi,
UploadApi
UploadApi,
SharedlinksApi,
FavoritesApi
} from '@alfresco/js-api';
import { logger } from '@alfresco/adf-cli/scripts/logger';
import { ActionTypes, Rule } from './rules-api';
@@ -45,6 +47,8 @@ export interface AcaBackend {
sites: SitesApi;
upload: UploadApi;
nodes: NodesApi;
share: SharedlinksApi;
favorites: FavoritesApi;
tearDown(): Promise<any>;
}
@@ -73,6 +77,8 @@ export class ApiClientFactory {
public securityGroupsApi: SecurityGroupsApi;
public securityMarksApi: SecurityMarksApi;
public contentClient: ContentClient;
public share: SharedlinksApi;
public favorites: FavoritesApi;
constructor() {
this.alfrescoApi = new AlfrescoApi(config);
@@ -92,6 +98,8 @@ export class ApiClientFactory {
this.search = new SearchApi(this.alfrescoApi);
this.securityGroupsApi = new SecurityGroupsApi(this.alfrescoApi);
this.securityMarksApi = new SecurityMarksApi(this.alfrescoApi);
this.share = new SharedlinksApi(this.alfrescoApi);
this.favorites = new FavoritesApi(this.alfrescoApi);
return this;
}

View File

@@ -0,0 +1,52 @@
/*!
* 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
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
import { FavoriteEntry } from '@alfresco/js-api';
import { users } from '../base-config/global-variables';
export class FavoritesPageApi extends ApiClientFactory {
private apiService: ApiClientFactory;
constructor() {
super();
this.apiService = new ApiClientFactory();
}
static async initialize(userProfile: keyof typeof users): Promise<FavoritesPageApi> {
const classObj = new FavoritesPageApi();
await classObj.apiService.setUpAcaBackend(userProfile);
return classObj;
}
async addFavoriteById(nodeType: 'file' | 'folder' | 'site', id: string): Promise<FavoriteEntry | null> {
let guid = nodeType === 'site' ? (await this.sites.getSite(id)).entry.guid : id;
const data = {
target: {
[nodeType]: {
guid: guid
}
}
};
return await this.apiService.favorites.createFavorite('-me-', data);
}
}

View File

@@ -0,0 +1,59 @@
/*!
* 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
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import * as fs from 'fs';
import { ApiClientFactory } from './api-client-factory';
import { users } from '../base-config/global-variables';
export class FileActionsApi extends ApiClientFactory {
private apiService: ApiClientFactory;
constructor() {
super();
this.apiService = new ApiClientFactory();
}
static async initialize(
userProfile: keyof typeof users
): Promise<FileActionsApi> {
const classObj = new FileActionsApi();
await classObj.apiService.setUpAcaBackend(userProfile);
return classObj;
}
async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise<any> {
const file = fs.createReadStream(fileLocation);
return this.apiService.upload.uploadFile(
file,
'',
parentFolderId,
null,
{
name: fileName,
nodeType: 'cm:content',
renditions: 'doclib'
}
);
}
}

View File

@@ -24,3 +24,6 @@
export * from './rules-api';
export * from './api-client-factory';
export * from './file-actions';
export * from './shared-links-api';
export * from './favorites-api';

View File

@@ -0,0 +1,55 @@
/*!
* 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
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
import { SharedLinkEntry } from '@alfresco/js-api';
import { users } from '../base-config/global-variables';
export class SharedLinksApi extends ApiClientFactory {
private apiService: ApiClientFactory;
constructor() {
super();
this.apiService = new ApiClientFactory();
}
static async initialize(
userProfile: keyof typeof users
): Promise<SharedLinksApi> {
const classObj = new SharedLinksApi();
await classObj.apiService.setUpAcaBackend(userProfile);
return classObj;
}
async shareFileById(id: string, expireDate?: Date): Promise<SharedLinkEntry | null> {
try {
const data = {
nodeId: id,
expiresAt: expireDate
};
return await this.apiService.share.createSharedLink(data);
} catch (error) {
return null;
}
}
}

View File

@@ -22,20 +22,63 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { test as base } from '@playwright/test';
import { NodesPage, PersonalFilesPage } from '../';
import {
FileActionsApi,
NodesPage,
PersonalFilesPage,
RecentFilesPage,
SharedLinksApi,
SharedPage,
SearchPage,
FavoritesPage,
FavoritesPageApi
} from '../';
interface Pages {
personalFiles: PersonalFilesPage;
nodesPage: NodesPage;
recentFilesPage: RecentFilesPage;
sharedPage: SharedPage;
searchPage: SearchPage;
favoritePage: FavoritesPage;
}
export const test = base.extend<Pages>({
interface Api {
fileAction: FileActionsApi;
shareAction: SharedLinksApi;
favoritesPageAction: FavoritesPageApi;
}
export const test = base.extend<Pages & Api>({
personalFiles: async ({ page }, use) => {
await use(new PersonalFilesPage(page));
},
nodesPage: async ({ page }, use) => {
await use(new NodesPage(page));
},
recentFilesPage: async ({ page }, use) => {
await use(new RecentFilesPage(page));
},
sharedPage: async ({ page }, use) => {
await use(new SharedPage(page));
},
searchPage: async ({ page }, use) => {
await use(new SearchPage(page));
},
favoritePage: async ({ page }, use) => {
await use(new FavoritesPage(page));
},
// eslint-disable-next-line no-empty-pattern
fileAction: async ({}, use) => {
await use(await FileActionsApi.initialize('admin'));
},
// eslint-disable-next-line no-empty-pattern
shareAction: async ({}, use) => {
await use(await SharedLinksApi.initialize('admin'));
},
// eslint-disable-next-line no-empty-pattern
favoritesPageAction: async ({}, use) => {
await use(await FavoritesPageApi.initialize('admin'));
}
});

View File

@@ -28,3 +28,4 @@ export * from './models';
export * from './page-objects';
export * from './fixtures/page-initialization';
export * from './utils';
export * from './resources/test-files';

View File

@@ -22,14 +22,16 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { BaseComponent } from './base.component';
import { Page } from '@playwright/test';
import { BaseComponent } from './base.component';
import { Page } from '@playwright/test';
export class AcaHeader extends BaseComponent {
private static rootElement = 'adf-toolbar';
public createButton = this.getChild('[id="app.toolbar.create"]');
export class AcaHeader extends BaseComponent {
private static rootElement = 'adf-toolbar';
public createButton = this.getChild('[id="app.toolbar.create"]');
public viewButton = this.getChild('button[title="View"]');
public searchButton = this.getChild('button[title="Search"]');
constructor(page: Page) {
super(page, AcaHeader.rootElement);
}
}
constructor(page: Page) {
super(page, AcaHeader.rootElement);
}
}

View File

@@ -77,7 +77,7 @@ export class ActionsDropdownComponent extends BaseComponent {
await this.actionDropdownLocator.nth(index).click();
await this.spinnerWaitForReload();
const option = this.getOptionLocator(action);
await option.click();
await option.nth(0).click();
}
async dropdownSelection(selectValue: string, locator: string, index: number): Promise<void> {

View File

@@ -50,13 +50,13 @@ export abstract class BaseComponent extends PlaywrightBase {
async closeAdditionalOverlayElementIfVisible(): Promise<void> {
if (await this.overlayElement.isVisible()) {
await this.page.keyboard.press('Escape');
await this.overlayElement.waitFor({ state: 'detached', timeout: 5000 });
await this.overlayElement.waitFor({ state: 'detached', timeout: timeouts.medium });
}
}
async spinnerWaitForReload(): Promise<void> {
try {
await this.page.locator('mat-progress-spinner').waitFor({ state: 'attached', timeout: timeouts.short });
await this.page.locator('mat-progress-spinner').waitFor({ state: 'attached', timeout: timeouts.normal });
await this.page.locator('mat-progress-spinner').waitFor({ state: 'detached', timeout: timeouts.normal });
} catch (e) {
this.logger.info('Spinner was not present');

View File

@@ -155,6 +155,17 @@ export class DataTableComponent extends BaseComponent {
}
}
/**
* This method is used when we want to perform double click on the dataTable row to open a file or folder
*
* @param name of the data table element with which we want to double click
*/
async performClickFolderOrFileToOpen(name: string): Promise<void> {
await this.goThroughPagesLookingForRowWithName(name);
await this.getCellLinkByName(name).click();
await this.spinnerWaitForReload();
}
async getActionLocatorFromExpandableMenu(name: string | number, action: string): Promise<Locator> {
await this.getRowByName(name).click({ button: 'right' });
return this.contextMenuActions.getButtonByText(action);
@@ -180,4 +191,17 @@ export class DataTableComponent extends BaseComponent {
await this.spinnerWaitForReload();
}
}
async selectItem(name: string): Promise<void> {
const isSelected = await this.hasCheckMarkIcon(name);
if (!isSelected) {
const row = await this.getRowByName(name);
await row.locator('.mat-checkbox[id*="mat-checkbox"]').check();
}
}
async hasCheckMarkIcon(itemName: string): Promise<boolean> {
const row = this.getRowByName(itemName);
return await row.locator('.mat-checkbox[class*="checked"]').isVisible();
}
}

View File

@@ -31,4 +31,6 @@ export * from './spinner.component';
export * from './actions-dropdown.component';
export * from './conditions.component';
export * from './pagination.component';
export * from './viewer.component';
export * from './search/search-input.component';
export * from './search/search-overlay.components';

View File

@@ -0,0 +1,51 @@
/*!
* 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 { Locator, Page } from '@playwright/test';
import { BaseComponent } from '.././base.component';
import { timeouts } from '../../../utils';
export class SearchInputComponent extends BaseComponent {
private static rootElement = 'aca-page-layout';
public searchButton = this.getChild('aca-search-input .app-search-button');
/**
* Method used in cases where user have possibility to navigate "inside" the element (it's clickable and has link attribute).
* Perform action .click() to navigate inside it
*
* @returns reference to cell element which contains link.
*/
getCellLinkByName = (name: string): Locator => this.getChild('.adf-datatable-row[role="row"]', { hasText: name });
constructor(page: Page, rootElement = SearchInputComponent.rootElement) {
super(page, rootElement);
}
async performDoubleClickFolderOrFileToOpen(name: string): Promise<void> {
await this.getCellLinkByName(name).waitFor({ state:'visible', timeout: timeouts.normal });
await this.getCellLinkByName(name).dblclick();
await this.spinnerWaitForReload();
}
}

View File

@@ -0,0 +1,50 @@
/*!
* 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 { Page } from '@playwright/test';
import { BaseComponent } from '.././base.component';
export class SearchOverlayComponent extends BaseComponent {
private static rootElement = '.cdk-overlay-pane';
public searchFilesOption = this.getChild('label[for="content-input"]');
public searchFoldersOption = this.getChild('label[for="folder-input"]');
public searchLibrariesOption = this.getChild('label[for="libraries-input"]');
public searchInput = this.getChild('input[id="app-control-input"]');
public searchButton = this.getChild('.app-search-button');
constructor(page: Page, rootElement = SearchOverlayComponent.rootElement) {
super(page, rootElement);
}
async checkFilesAndFolders(): Promise<void> {
await this.searchFilesOption.click();
await this.searchFoldersOption.click();
}
async searchFor(input: string): Promise<void> {
await this.searchInput.fill(input);
await this.searchButton.click();
}
}

View File

@@ -0,0 +1,61 @@
/*!
* 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 { Page } from '@playwright/test';
import { BaseComponent } from './base.component';
import { AcaHeader } from './aca-header.component';
import { timeouts } from '../../utils';
export class ViewerComponent extends BaseComponent {
private static rootElement = 'adf-viewer';
private viewerLocator = this.getChild('.adf-viewer-render-layout-content');
public closeButtonLocator = this.getChild('.adf-viewer-close-button');
public fileTitleButtonLocator = this.getChild('.adf-viewer__file-title');
toolbar = new AcaHeader(this.page);
constructor(page: Page) {
super(page, ViewerComponent.rootElement);
}
async isViewerOpened(): Promise<boolean> {
return await this.viewerLocator.isVisible();
}
async isCloseButtonDisplayed(): Promise<boolean> {
await this.closeButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal });
return await this.closeButtonLocator.isEnabled({ timeout: timeouts.normal });
}
async isFileTitleDisplayed(): Promise<boolean> {
await this.fileTitleButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal });
return await this.fileTitleButtonLocator.isVisible();
}
async getCloseButtonTooltip(): Promise<string> {
await this.closeButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal });
return await this.closeButtonLocator.getAttribute('title');
}
}

View File

@@ -0,0 +1,43 @@
/*!
* 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 { Page } from '@playwright/test';
import { BasePage } from './base.page';
import { DataTableComponent, MatMenuComponent, ViewerComponent } from '../components';
import { AcaHeader } from '../components/aca-header.component';
import { AdfFolderDialogComponent } from '../components/dialogs';
export class FavoritesPage extends BasePage {
private static pageUrl = 'favorites';
constructor(page: Page) {
super(page, FavoritesPage.pageUrl);
}
public acaHeader = new AcaHeader(this.page);
public matMenu = new MatMenuComponent(this.page);
public folderDialog = new AdfFolderDialogComponent(this.page);
public dataTable = new DataTableComponent(this.page);
public viewer = new ViewerComponent(this.page);
}

View File

@@ -26,3 +26,7 @@ export * from './base.page';
export * from './login.page';
export * from './nodes.page';
export * from './personal-files.page';
export * from './recent-files.page';
export * from './shared.page';
export * from './search.page';
export * from './favorites.page';

View File

@@ -25,7 +25,7 @@
import { Page } from '@playwright/test';
import { BasePage } from './base.page';
import { DataTableComponent, MatMenuComponent } from '../components';
import { DataTableComponent, MatMenuComponent, ViewerComponent } from '../components';
import { AcaHeader } from '../components/aca-header.component';
import { AdfFolderDialogComponent } from '../components/dialogs';
@@ -40,4 +40,5 @@ export class PersonalFilesPage extends BasePage {
public matMenu = new MatMenuComponent(this.page);
public folderDialog = new AdfFolderDialogComponent(this.page);
public dataTable = new DataTableComponent(this.page);
public viewer = new ViewerComponent(this.page);
}

View File

@@ -0,0 +1,44 @@
/*!
* 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 { Page } from '@playwright/test';
import { BasePage } from './base.page';
import { DataTableComponent, MatMenuComponent, ViewerComponent } from '../components';
import { AcaHeader } from '../components/aca-header.component';
import { AdfFolderDialogComponent } from '../components/dialogs';
export class RecentFilesPage extends BasePage {
private static pageUrl = 'recent-files';
constructor(page: Page) {
super(page, RecentFilesPage.pageUrl);
}
public acaHeader = new AcaHeader(this.page);
public matMenu = new MatMenuComponent(this.page);
public folderDialog = new AdfFolderDialogComponent(this.page);
public dataTable = new DataTableComponent(this.page);
public viewer = new ViewerComponent(this.page);
}

View File

@@ -0,0 +1,45 @@
/*!
* 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 { Page } from '@playwright/test';
import { BasePage } from './base.page';
import { DataTableComponent, MatMenuComponent, ViewerComponent, SearchInputComponent, SearchOverlayComponent } from '../components';
import { AcaHeader } from '../components/aca-header.component';
import { AdfFolderDialogComponent } from '../components/dialogs';
export class SearchPage extends BasePage {
private static pageUrl = 'search';
constructor(page: Page) {
super(page, SearchPage.pageUrl);
}
public acaHeader = new AcaHeader(this.page);
public matMenu = new MatMenuComponent(this.page);
public folderDialog = new AdfFolderDialogComponent(this.page);
public dataTable = new DataTableComponent(this.page);
public viewer = new ViewerComponent(this.page);
public searchInput = new SearchInputComponent(this.page);
public searchOverlay = new SearchOverlayComponent(this.page);
}

View File

@@ -0,0 +1,43 @@
/*!
* 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 { Page } from '@playwright/test';
import { BasePage } from './base.page';
import { DataTableComponent, MatMenuComponent, ViewerComponent } from '../components';
import { AcaHeader } from '../components/aca-header.component';
import { AdfFolderDialogComponent } from '../components/dialogs';
export class SharedPage extends BasePage {
private static pageUrl = 'shared';
constructor(page: Page) {
super(page, SharedPage.pageUrl);
}
public acaHeader = new AcaHeader(this.page);
public matMenu = new MatMenuComponent(this.page);
public folderDialog = new AdfFolderDialogComponent(this.page);
public dataTable = new DataTableComponent(this.page);
public viewer = new ViewerComponent(this.page);
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved.
*
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
*/
import { resolve } from 'path';
export const TEST_FILES = {
DOCX: {
path: resolve(__dirname, 'file-docx.docx'),
name: 'file-docx',
data: 'Lorem ipsum dolor sit amet'
},
PDF: {
path: resolve(__dirname, 'file-pdf.pdf'),
name: 'file-pdf',
data: 'Lorem ipsum dolor sit amet'
},
};