From 81d55aaa398b05b0901f9f89b0800095ce60ac73 Mon Sep 17 00:00:00 2001 From: "akash.rathod@hyland.com" Date: Tue, 11 Jul 2023 10:07:57 +0200 Subject: [PATCH 1/2] [ACS-5519] view general tests Playwright --- .github/workflows/pull-request.yml | 2 + e2e/playwright/viewer/.eslintrc.json | 26 ++++ e2e/playwright/viewer/exclude.tests.json | 1 + e2e/playwright/viewer/playwright.config.ts | 44 ++++++ e2e/playwright/viewer/project.json | 34 +++++ .../viewer/src/tests/viewer.spec.ts | 137 ++++++++++++++++++ e2e/playwright/viewer/tsconfig.e2e.adf.json | 15 ++ e2e/playwright/viewer/tsconfig.e2e.json | 12 ++ .../suites/viewer/viewer-general.test.ts | 84 +---------- .../src/api/api-client-factory.ts | 10 +- .../src/api/favorites-api.ts | 52 +++++++ .../src/api/file-actions.ts | 59 ++++++++ .../aca-playwright-shared/src/api/index.ts | 3 + .../src/api/shared-links-api.ts | 55 +++++++ .../src/fixtures/page-initialization.ts | 49 ++++++- projects/aca-playwright-shared/src/index.ts | 1 + .../components/aca-header.component.ts | 20 +-- .../components/actions-dropdown.component.ts | 2 +- .../page-objects/components/base.component.ts | 4 +- .../dataTable/data-table.component.ts | 24 +++ .../src/page-objects/components/index.ts | 4 +- .../search/search-input.component.ts | 51 +++++++ .../search/search-overlay.components.ts | 50 +++++++ .../components/viewer.component.ts | 61 ++++++++ .../src/page-objects/pages/favorites.page.ts | 43 ++++++ .../src/page-objects/pages/index.ts | 4 + .../page-objects/pages/personal-files.page.ts | 3 +- .../page-objects/pages/recent-files.page.ts | 44 ++++++ .../src/page-objects/pages/search.page.ts | 45 ++++++ .../src/page-objects/pages/shared.page.ts | 43 ++++++ .../src/resources/test-files/file-docx.docx | Bin 0 -> 9926 bytes .../src/resources/test-files/index.ts | 22 +++ 32 files changed, 903 insertions(+), 101 deletions(-) create mode 100644 e2e/playwright/viewer/.eslintrc.json create mode 100644 e2e/playwright/viewer/exclude.tests.json create mode 100644 e2e/playwright/viewer/playwright.config.ts create mode 100644 e2e/playwright/viewer/project.json create mode 100644 e2e/playwright/viewer/src/tests/viewer.spec.ts create mode 100644 e2e/playwright/viewer/tsconfig.e2e.adf.json create mode 100755 e2e/playwright/viewer/tsconfig.e2e.json create mode 100755 projects/aca-playwright-shared/src/api/favorites-api.ts create mode 100644 projects/aca-playwright-shared/src/api/file-actions.ts create mode 100755 projects/aca-playwright-shared/src/api/shared-links-api.ts create mode 100644 projects/aca-playwright-shared/src/page-objects/components/search/search-input.component.ts create mode 100644 projects/aca-playwright-shared/src/page-objects/components/search/search-overlay.components.ts create mode 100644 projects/aca-playwright-shared/src/page-objects/components/viewer.component.ts create mode 100644 projects/aca-playwright-shared/src/page-objects/pages/favorites.page.ts create mode 100644 projects/aca-playwright-shared/src/page-objects/pages/recent-files.page.ts create mode 100644 projects/aca-playwright-shared/src/page-objects/pages/search.page.ts create mode 100644 projects/aca-playwright-shared/src/page-objects/pages/shared.page.ts create mode 100644 projects/aca-playwright-shared/src/resources/test-files/file-docx.docx create mode 100644 projects/aca-playwright-shared/src/resources/test-files/index.ts diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8e48464deb..cefa5c5b5f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -176,6 +176,8 @@ jobs: id: 1 - name: "folder-rules" id: 2 + - name: "viewer" + id: 3 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/e2e/playwright/viewer/.eslintrc.json b/e2e/playwright/viewer/.eslintrc.json new file mode 100644 index 0000000000..20cbee6e3e --- /dev/null +++ b/e2e/playwright/viewer/.eslintrc.json @@ -0,0 +1,26 @@ +{ + "extends": "../../../.eslintrc.json", + "ignorePatterns": [ + "!**/*" + ], + "overrides": [ + { + "files": [ + "*.ts" + ], + "parserOptions": { + "project": [ + "e2e/playwright/viewer/tsconfig.e2e.json" + ], + "createDefaultProgram": true + }, + "plugins": [ + "rxjs", + "unicorn" + ], + "rules": { + "@typescript-eslint/no-floating-promises": "off" + } + } + ] +} diff --git a/e2e/playwright/viewer/exclude.tests.json b/e2e/playwright/viewer/exclude.tests.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/e2e/playwright/viewer/exclude.tests.json @@ -0,0 +1 @@ +{} diff --git a/e2e/playwright/viewer/playwright.config.ts b/e2e/playwright/viewer/playwright.config.ts new file mode 100644 index 0000000000..a5748b1c46 --- /dev/null +++ b/e2e/playwright/viewer/playwright.config.ts @@ -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 . + */ + +import { PlaywrightTestConfig } from '@playwright/test'; +import { CustomConfig, getGlobalConfig, getExcludedTestsRegExpArray } from '@alfresco/playwright-shared'; +import EXCLUDED_JSON from './exclude.tests.json'; + +const config: PlaywrightTestConfig = { + ...getGlobalConfig, + + grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Viewer'), + projects: [ + { + name: 'Viewer', + testDir: './src/tests', + use: { + users: ['hruser', 'admin'] + } + } + ] +}; + +export default config; diff --git a/e2e/playwright/viewer/project.json b/e2e/playwright/viewer/project.json new file mode 100644 index 0000000000..bb31d77f5e --- /dev/null +++ b/e2e/playwright/viewer/project.json @@ -0,0 +1,34 @@ +{ + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "name": "viewer-e2e", + "sourceRoot": "e2e/playwright/viewer/src", + "projectType": "application", + "targets": { + "e2e": { + "executor": "nx:run-commands", + "options": { + "commands": [ + "npx playwright test --config=e2e/playwright/viewer/playwright.config.ts" + ] + }, + "configurations": { + "production": { + "devServerTarget": "content-ce:serve:production" + } + } + }, + "lint": { + "executor": "@angular-eslint/builder:lint", + "options": { + "lintFilePatterns": [ + "e2e/**/*.ts", + "e2e/**/*.html" + ], + "cache": true, + "cacheLocation": ".eslintcache", + "ignorePath": ".eslintignore" + }, + "outputs": ["{options.outputFile}"] + } + } +} diff --git a/e2e/playwright/viewer/src/tests/viewer.spec.ts b/e2e/playwright/viewer/src/tests/viewer.spec.ts new file mode 100644 index 0000000000..d95f7364c7 --- /dev/null +++ b/e2e/playwright/viewer/src/tests/viewer.spec.ts @@ -0,0 +1,137 @@ +/*! + * 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 . + */ + +import { expect } from '@playwright/test'; +import { ApiClientFactory, getUserState, test, TEST_FILES } from '@alfresco/playwright-shared'; + +test.use({ storageState: getUserState('admin') }); +test.describe('viewer file', () => { + const apiClientFactory = new ApiClientFactory(); + const randomFolderName = `playwright-folder-${(Math.random() + 1).toString(36).substring(6)}`; + const randomDocxName = TEST_FILES.DOCX.name + (Math.random() + 1).toString(36).substring(6); + let folderId: string; + let fileDocxId: string; + + test.beforeAll(async ({ fileAction, shareAction, favoritesPageAction: favoritesPageAction }) => { + await apiClientFactory.setUpAcaBackend('admin'); + const node = await apiClientFactory.nodes.createNode('-my-', { name: randomFolderName, nodeType: 'cm:folder', relativePath: '/' }); + folderId = await node.entry.id; + const fileDoc = await fileAction.uploadFile(TEST_FILES.DOCX.path, randomDocxName, folderId); + fileDocxId = await fileDoc.entry.id; + await shareAction.shareFileById(fileDocxId); + await favoritesPageAction.addFavoriteById('file', fileDocxId); + }); + + test.beforeEach(async ({ personalFiles }) => { + await personalFiles.navigate({ waitUntil: 'domcontentloaded' }); + await personalFiles.dataTable.goThroughPagesLookingForRowWithName(randomFolderName); + await personalFiles.dataTable.performClickFolderOrFileToOpen(randomFolderName); + }); + + test.afterAll(async () => { + await apiClientFactory.nodes.deleteNode(folderId); + }); + + test('[C279269] Viewer opens on double clicking on a file from Personal Files', async ({ personalFiles }) => { + await personalFiles.dataTable.performClickFolderOrFileToOpen(randomDocxName); + expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); + }); + + test('[C279270] Viewer opens when clicking the View action for a file', async ({ personalFiles }) => { + await personalFiles.dataTable.selectItem(randomDocxName); + await personalFiles.acaHeader.viewButton.click(); + await personalFiles.dataTable.spinnerWaitForReload(); + expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); + }); + + test('[C279283] The viewer general elements are displayed', async ({ personalFiles }) => { + await personalFiles.dataTable.performClickFolderOrFileToOpen(randomDocxName); + expect(await personalFiles.viewer.isViewerOpened()).toBe(true); + await personalFiles.dataTable.spinnerWaitForReload(); + expect(await personalFiles.viewer.isCloseButtonDisplayed(), 'Close button is not displayed').toBe(true); + expect(await personalFiles.viewer.isFileTitleDisplayed(), 'File title is not displayed').toBe(true); + }); + + test('[C279271] Close the viewer', async ({ personalFiles }) => { + await personalFiles.dataTable.performClickFolderOrFileToOpen(randomDocxName); + expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); + await personalFiles.viewer.closeButtonLocator.click(); + expect(await personalFiles.viewer.isViewerOpened(), 'Viewer did not close').toBe(false); + }); + + test('[C284632] Close button tooltip', async ({ personalFiles }) => { + await personalFiles.dataTable.performClickFolderOrFileToOpen(randomDocxName); + expect(await personalFiles.viewer.getCloseButtonTooltip()).toEqual('Close'); + }); + + test('[C279285] Viewer opens when accessing the preview URL for a file', async ({ personalFiles }) => { + const previewURL = `#/personal-files/${folderId}/(viewer:view/${fileDocxId})`; + await personalFiles.navigate({ remoteUrl: previewURL }); + await personalFiles.dataTable.spinnerWaitForReload(); + expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); + expect(await personalFiles.viewer.fileTitleButtonLocator.innerText()).toEqual(randomDocxName); + }); + + test('[C284636] Viewer opens for a file from Recent Files', async ({ personalFiles, recentFilesPage }) => { + await personalFiles.dataTable.performClickFolderOrFileToOpen(randomDocxName); + expect(await personalFiles.viewer.getCloseButtonTooltip()).toEqual('Close'); + await recentFilesPage.navigate(); + await recentFilesPage.reload(); + await recentFilesPage.dataTable.performClickFolderOrFileToOpen(randomDocxName); + expect(await recentFilesPage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); + expect(await recentFilesPage.viewer.isCloseButtonDisplayed(), 'Close button is not displayed').toBe(true); + expect(await recentFilesPage.viewer.isFileTitleDisplayed(), 'File title is not displayed').toBe(true); + }); + + test('[C284635] Viewer opens for a file from Shared Files', async ({ sharedPage }) => { + await sharedPage.navigate(); + await sharedPage.reload(); + await sharedPage.dataTable.performClickFolderOrFileToOpen(randomDocxName); + expect(await sharedPage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); + expect(await sharedPage.viewer.isCloseButtonDisplayed(), 'Close button is not displayed').toBe(true); + expect(await sharedPage.viewer.isFileTitleDisplayed(), 'File title is not displayed').toBe(true); + }); + + test('[C284634] Viewer opens for a file from Favorites', async ({ favoritePage }) => { + await favoritePage.navigate({ waitUntil: 'domcontentloaded' }); + await favoritePage.dataTable.goThroughPagesLookingForRowWithName(randomDocxName); + await favoritePage.dataTable.performClickFolderOrFileToOpen(randomDocxName); + expect(await favoritePage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); + expect(await favoritePage.viewer.isCloseButtonDisplayed(), 'Close button is not displayed').toBe(true); + expect(await favoritePage.viewer.isFileTitleDisplayed(), 'File title is not displayed').toBe(true); + }); + + test('[C279175] Viewer opens for a file from Search Results', async ({ personalFiles, searchPage }) => { + await personalFiles.acaHeader.searchButton.click(); + await searchPage.searchInput.searchButton.click(); + await searchPage.searchOverlay.checkFilesAndFolders(); + await searchPage.searchOverlay.searchFor(randomDocxName); + await searchPage.reload({ waitUntil: 'domcontentloaded' }); + + await searchPage.searchInput.performDoubleClickFolderOrFileToOpen(randomDocxName); + expect(await searchPage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); + expect(await searchPage.viewer.isCloseButtonDisplayed(), 'Close button is not displayed').toBe(true); + expect(await searchPage.viewer.isFileTitleDisplayed(), 'File title is not displayed').toBe(true); + }); +}); diff --git a/e2e/playwright/viewer/tsconfig.e2e.adf.json b/e2e/playwright/viewer/tsconfig.e2e.adf.json new file mode 100644 index 0000000000..87cbcf775a --- /dev/null +++ b/e2e/playwright/viewer/tsconfig.e2e.adf.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../tsconfig.adf.json", + "compilerOptions": { + "outDir": "../../out-tsc/e2e", + "baseUrl": "./", + "module": "commonjs", + "target": "es2017", + "types": ["jasmine", "jasminewd2", "node"], + "skipLibCheck": true, + "paths": { + "@alfresco/playwright-shared": ["../../../projects/aca-playwright-shared/src/index.ts"] + } + }, + "exclude": ["node_modules"] +} diff --git a/e2e/playwright/viewer/tsconfig.e2e.json b/e2e/playwright/viewer/tsconfig.e2e.json new file mode 100755 index 0000000000..d1d140fba4 --- /dev/null +++ b/e2e/playwright/viewer/tsconfig.e2e.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/e2e", + "baseUrl": "./", + "module": "commonjs", + "target": "es2017", + "types": ["jasmine", "jasminewd2", "node", "@playwright/test"], + "skipLibCheck": true, + }, + "exclude": ["node_modules"] +} diff --git a/e2e/protractor/suites/viewer/viewer-general.test.ts b/e2e/protractor/suites/viewer/viewer-general.test.ts index cf05f3597c..37f12450d1 100755 --- a/e2e/protractor/suites/viewer/viewer-general.test.ts +++ b/e2e/protractor/suites/viewer/viewer-general.test.ts @@ -23,7 +23,6 @@ */ import { AdminActions, UserActions, LoginPage, BrowsingPage, FILES, SITE_VISIBILITY, RepoClient, Utils, Viewer } from '@alfresco/aca-testing-shared'; -import { BrowserActions } from '@alfresco/adf-testing'; describe('Viewer general', () => { const username = `user-${Utils.random()}`; @@ -49,9 +48,8 @@ describe('Viewer general', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); - const { dataTable, toolbar } = page; + const { dataTable } = page; const viewer = new Viewer(); - const { searchInput } = page.pageLayoutHeader; const adminApiActions = new AdminActions(); const userActions = new UserActions(); @@ -98,45 +96,6 @@ describe('Viewer general', () => { await apis.user.sites.deleteSite(siteUser); }); - it('[C279269] Viewer opens on double clicking on a file from Personal Files', async () => { - await dataTable.doubleClickOnRowByName(xlsxFile); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - }); - - it('[C279270] Viewer opens when clicking the View action for a file', async () => { - await dataTable.selectItem(xlsxFile); - await BrowserActions.click(page.toolbar.viewButton); - - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - }); - - it('[C279283] The viewer general elements are displayed', async () => { - await dataTable.doubleClickOnRowByName(xlsxFile); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed'); - expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed'); - expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed'); - }); - - it('[C279271] Close the viewer', async () => { - await dataTable.doubleClickOnRowByName(xlsxFile); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - await BrowserActions.click(viewer.closeButton); - expect(await viewer.isViewerOpened()).toBe(false, 'Viewer did not close'); - }); - - it('[C284632] Close button tooltip', async () => { - await dataTable.doubleClickOnRowByName(xlsxFile); - expect(await viewer.getCloseButtonTooltip()).toEqual('Close'); - }); - - it('[C279285] Viewer opens when accessing the preview URL for a file', async () => { - const previewURL = `personal-files/${parentId}/(viewer:view/${xlsxFileId})`; - await page.load(previewURL); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - expect(await viewer.getFileTitle()).toEqual(xlsxFile); - }); - it('[C279287] Viewer does not open when accessing the preview URL for a file without permissions', async () => { const previewURL = `libraries/${docLibId}/(viewer:view/${fileAdminId})`; await page.load(previewURL); @@ -153,45 +112,4 @@ describe('Viewer general', () => { expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed'); expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed'); }); - - it('[C284636] Viewer opens for a file from Recent Files', async () => { - await page.clickRecentFilesAndWait(); - await dataTable.doubleClickOnRowByName(xlsxFile); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed'); - expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed'); - expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed'); - }); - - it('[C284635] Viewer opens for a file from Shared Files', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.doubleClickOnRowByName(xlsxFile); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed'); - expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed'); - expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed'); - }); - - it('[C284634] Viewer opens for a file from Favorites', async () => { - await page.clickFavoritesAndWait(); - await dataTable.doubleClickOnRowByName(xlsxFile); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed'); - expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed'); - expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed'); - }); - - it('[C279175] Viewer opens for a file from Search Results', async () => { - await toolbar.clickSearchIconButton(); - await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); - await searchInput.searchFor(xlsxFile); - await dataTable.waitForBody(); - - await dataTable.doubleClickOnRowByName(xlsxFile); - expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); - expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed'); - expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed'); - expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed'); - }); }); diff --git a/projects/aca-playwright-shared/src/api/api-client-factory.ts b/projects/aca-playwright-shared/src/api/api-client-factory.ts index a848a00eb0..2295073a3b 100644 --- a/projects/aca-playwright-shared/src/api/api-client-factory.ts +++ b/projects/aca-playwright-shared/src/api/api-client-factory.ts @@ -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; } @@ -71,6 +75,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); @@ -90,6 +96,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; } diff --git a/projects/aca-playwright-shared/src/api/favorites-api.ts b/projects/aca-playwright-shared/src/api/favorites-api.ts new file mode 100755 index 0000000000..83904cff83 --- /dev/null +++ b/projects/aca-playwright-shared/src/api/favorites-api.ts @@ -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 . + */ + +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 { + const classObj = new FavoritesPageApi(); + await classObj.apiService.setUpAcaBackend(userProfile); + return classObj; + } + async addFavoriteById(nodeType: 'file' | 'folder' | 'site', id: string): Promise { + 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); + } +} diff --git a/projects/aca-playwright-shared/src/api/file-actions.ts b/projects/aca-playwright-shared/src/api/file-actions.ts new file mode 100644 index 0000000000..9c7b4a528d --- /dev/null +++ b/projects/aca-playwright-shared/src/api/file-actions.ts @@ -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 . + */ + +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 { + const classObj = new FileActionsApi(); + await classObj.apiService.setUpAcaBackend(userProfile); + return classObj; + } + + async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise { + const file = fs.createReadStream(fileLocation); + return this.apiService.upload.uploadFile( + file, + '', + parentFolderId, + null, + { + name: fileName, + nodeType: 'cm:content', + renditions: 'doclib' + } + ); + } +} diff --git a/projects/aca-playwright-shared/src/api/index.ts b/projects/aca-playwright-shared/src/api/index.ts index 03f510735c..b7a8762b4a 100644 --- a/projects/aca-playwright-shared/src/api/index.ts +++ b/projects/aca-playwright-shared/src/api/index.ts @@ -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'; diff --git a/projects/aca-playwright-shared/src/api/shared-links-api.ts b/projects/aca-playwright-shared/src/api/shared-links-api.ts new file mode 100755 index 0000000000..0c24e75598 --- /dev/null +++ b/projects/aca-playwright-shared/src/api/shared-links-api.ts @@ -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 . + */ + +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 { + const classObj = new SharedLinksApi(); + await classObj.apiService.setUpAcaBackend(userProfile); + return classObj; + } + + async shareFileById(id: string, expireDate?: Date): Promise { + try { + const data = { + nodeId: id, + expiresAt: expireDate + }; + return await this.apiService.share.createSharedLink(data); + } catch (error) { + return null; + } + } +} diff --git a/projects/aca-playwright-shared/src/fixtures/page-initialization.ts b/projects/aca-playwright-shared/src/fixtures/page-initialization.ts index 3a35b75ca8..a30b775a1c 100644 --- a/projects/aca-playwright-shared/src/fixtures/page-initialization.ts +++ b/projects/aca-playwright-shared/src/fixtures/page-initialization.ts @@ -22,20 +22,63 @@ * from Hyland Software. If not, see . */ - 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; +} + +interface Api { + fileAction: FileActionsApi; + shareAction: SharedLinksApi; + favoritesPageAction: FavoritesPageApi; } -export const test = base.extend({ +export const test = base.extend({ 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')); } }); diff --git a/projects/aca-playwright-shared/src/index.ts b/projects/aca-playwright-shared/src/index.ts index 24b44026ef..356316797e 100644 --- a/projects/aca-playwright-shared/src/index.ts +++ b/projects/aca-playwright-shared/src/index.ts @@ -28,3 +28,4 @@ export * from './models'; export * from './page-objects'; export * from './fixtures/page-initialization'; export * from './utils'; +export * from './resources/test-files'; diff --git a/projects/aca-playwright-shared/src/page-objects/components/aca-header.component.ts b/projects/aca-playwright-shared/src/page-objects/components/aca-header.component.ts index dc8c10ee4e..063aed6e8f 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/aca-header.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/aca-header.component.ts @@ -22,14 +22,16 @@ * from Hyland Software. If not, see . */ - 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); + } +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/actions-dropdown.component.ts b/projects/aca-playwright-shared/src/page-objects/components/actions-dropdown.component.ts index 4671f5355e..2bc2b12093 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/actions-dropdown.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/actions-dropdown.component.ts @@ -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 { diff --git a/projects/aca-playwright-shared/src/page-objects/components/base.component.ts b/projects/aca-playwright-shared/src/page-objects/components/base.component.ts index 62919a0fdb..11910754b1 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/base.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/base.component.ts @@ -50,13 +50,13 @@ export abstract class BaseComponent extends PlaywrightBase { async closeAdditionalOverlayElementIfVisible(): Promise { 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 { 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'); diff --git a/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts b/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts index 0c9a9eb9dd..8ae4a2b822 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts @@ -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 { + await this.goThroughPagesLookingForRowWithName(name); + await this.getCellLinkByName(name).click(); + await this.spinnerWaitForReload(); + } + async getActionLocatorFromExpandableMenu(name: string | number, action: string): Promise { 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 { + 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 { + const row = this.getRowByName(itemName); + return await row.locator('.mat-checkbox[class*="checked"]').isVisible(); + } } diff --git a/projects/aca-playwright-shared/src/page-objects/components/index.ts b/projects/aca-playwright-shared/src/page-objects/components/index.ts index 2286fc7061..a3f04f1fb6 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/index.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/index.ts @@ -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'; diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-input.component.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-input.component.ts new file mode 100644 index 0000000000..1f0d182ca5 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-input.component.ts @@ -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 . + */ + +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 { + await this.getCellLinkByName(name).waitFor({ state:'visible', timeout: timeouts.normal }); + await this.getCellLinkByName(name).dblclick(); + await this.spinnerWaitForReload(); + } + +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-overlay.components.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-overlay.components.ts new file mode 100644 index 0000000000..ed32e68c25 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-overlay.components.ts @@ -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 . + */ + +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 { + await this.searchFilesOption.click(); + await this.searchFoldersOption.click(); + } + + async searchFor(input: string): Promise { + await this.searchInput.fill(input); + await this.searchButton.click(); + } +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/viewer.component.ts b/projects/aca-playwright-shared/src/page-objects/components/viewer.component.ts new file mode 100644 index 0000000000..0aaa290014 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/viewer.component.ts @@ -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 . + */ + +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 { + return await this.viewerLocator.isVisible(); + } + + async isCloseButtonDisplayed(): Promise { + await this.closeButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal }); + return await this.closeButtonLocator.isEnabled({ timeout: timeouts.normal }); + } + + async isFileTitleDisplayed(): Promise { + await this.fileTitleButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal }); + return await this.fileTitleButtonLocator.isVisible(); + } + + async getCloseButtonTooltip(): Promise { + await this.closeButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal }); + return await this.closeButtonLocator.getAttribute('title'); + } +} diff --git a/projects/aca-playwright-shared/src/page-objects/pages/favorites.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/favorites.page.ts new file mode 100644 index 0000000000..2d0a13cde7 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/pages/favorites.page.ts @@ -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 . + */ + +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); +} diff --git a/projects/aca-playwright-shared/src/page-objects/pages/index.ts b/projects/aca-playwright-shared/src/page-objects/pages/index.ts index c1d1ae1c15..72def0ece5 100644 --- a/projects/aca-playwright-shared/src/page-objects/pages/index.ts +++ b/projects/aca-playwright-shared/src/page-objects/pages/index.ts @@ -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'; diff --git a/projects/aca-playwright-shared/src/page-objects/pages/personal-files.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/personal-files.page.ts index 7845ee51bc..94251cc440 100644 --- a/projects/aca-playwright-shared/src/page-objects/pages/personal-files.page.ts +++ b/projects/aca-playwright-shared/src/page-objects/pages/personal-files.page.ts @@ -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); } diff --git a/projects/aca-playwright-shared/src/page-objects/pages/recent-files.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/recent-files.page.ts new file mode 100644 index 0000000000..e971c89213 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/pages/recent-files.page.ts @@ -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 . + */ + + +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); +} diff --git a/projects/aca-playwright-shared/src/page-objects/pages/search.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/search.page.ts new file mode 100644 index 0000000000..b195a5b77c --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/pages/search.page.ts @@ -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 . + */ + +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); +} diff --git a/projects/aca-playwright-shared/src/page-objects/pages/shared.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/shared.page.ts new file mode 100644 index 0000000000..c70bbe57d8 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/pages/shared.page.ts @@ -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 . + */ + +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); +} diff --git a/projects/aca-playwright-shared/src/resources/test-files/file-docx.docx b/projects/aca-playwright-shared/src/resources/test-files/file-docx.docx new file mode 100644 index 0000000000000000000000000000000000000000..7d4e30425ebc49470fb19ce92e89c4afb7202a3a GIT binary patch literal 9926 zcmeHNWmH_rwrUH|tr_Qc#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i7XmI>r(0^nQzr%kI<^B{!_{@#}v82Zcvl literal 0 HcmV?d00001 diff --git a/projects/aca-playwright-shared/src/resources/test-files/index.ts b/projects/aca-playwright-shared/src/resources/test-files/index.ts new file mode 100644 index 0000000000..a516a5d5c3 --- /dev/null +++ b/projects/aca-playwright-shared/src/resources/test-files/index.ts @@ -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' + }, +}; From 83c73bb1fdc40c96874489132c6306ea3c85bd5a Mon Sep 17 00:00:00 2001 From: "akash.rathod@hyland.com" Date: Tue, 11 Jul 2023 11:01:44 +0200 Subject: [PATCH 2/2] [ACS-5519] remove same function call --- e2e/playwright/viewer/src/tests/viewer.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/e2e/playwright/viewer/src/tests/viewer.spec.ts b/e2e/playwright/viewer/src/tests/viewer.spec.ts index d95f7364c7..709b554a4e 100644 --- a/e2e/playwright/viewer/src/tests/viewer.spec.ts +++ b/e2e/playwright/viewer/src/tests/viewer.spec.ts @@ -45,7 +45,6 @@ test.describe('viewer file', () => { test.beforeEach(async ({ personalFiles }) => { await personalFiles.navigate({ waitUntil: 'domcontentloaded' }); - await personalFiles.dataTable.goThroughPagesLookingForRowWithName(randomFolderName); await personalFiles.dataTable.performClickFolderOrFileToOpen(randomFolderName); }); @@ -115,7 +114,6 @@ test.describe('viewer file', () => { test('[C284634] Viewer opens for a file from Favorites', async ({ favoritePage }) => { await favoritePage.navigate({ waitUntil: 'domcontentloaded' }); - await favoritePage.dataTable.goThroughPagesLookingForRowWithName(randomDocxName); await favoritePage.dataTable.performClickFolderOrFileToOpen(randomDocxName); expect(await favoritePage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); expect(await favoritePage.viewer.isCloseButtonDisplayed(), 'Close button is not displayed').toBe(true);