mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
* Layout changes for workspace sidemenu * added header and search layout changes * implemented review comments and removed process related code * Added expand and collapse functionality * Modified the paths * linting fixes * use standard material settings icon * use only specific modules needed for page layout * use standard "menu" icon for now * use standard avatar icon for now * cleanup user profile menu item * cleanup About component layout * remove hardcoded settings route * deprecate "headerImagePath" * deprecate "headerTextColor" customisation * deprecate "headerColor" customisation * proper toggle of the side menu * proper sidebar header implementation * user profile basic cleanup * minor fixes * cleanup buttons * remove old app layout and use ADF one * remove old header component * cleanup old layout module * fix unit tests * cleanup unit tests * cleanup header actions module * deprecate unused main-action component * cleanup styles * restore removed method * cleanup search results toolbar * restore expand menu functionality * cleanup code, back buttons for about and profile * restore original code * proper collapse button * remove unused i18n key * styles cleanup * cleanup sidebar * cleanup user profile * add safety checks for focus after close * layout fixes * update view profile unit tests * code cleanup after reviews * cleanup header actions * fix menu population, user info * improved upload and create actions * remove useless tests * fix folder rules tests * search button workaround * e2e: remove wait * add create/upload tooltips * e2e fix * e2e fix * e2e fix * e2e fix * e2e fix * e2e fix * e2e fix * e2e fix * e2e fix * e2e fix * e2e fix * e2e fix * try fix e2e * update e2e extension configs * try fix e2e * try fix e2e * fix eslint config * try fix e2e * move search button to extensions * move upload and create to extensions * remove header actions as no longer needed * cleanup * e2e fixes and cleanup for unwanted files * linting fixes * linting fixes * added button type to support text buttons * linting fixes * added more unit tests to achieve code coverage requirement * fixing code covergae for aca-content * fixed code coverage for aca-shared * linting fixes * linting fixes * cleanup * version fix --------- Co-authored-by: SheenaMalhotra182 <sheena.malhotra@globallogic.com> Co-authored-by: Denys Vuika <denys.vuika@gmail.com> Co-authored-by: SheenaMalhotra182 <sheena.malhotra@contractors.onbase.com>
372 lines
17 KiB
TypeScript
Executable File
372 lines
17 KiB
TypeScript
Executable File
/*!
|
|
* 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 { BrowsingPage, SearchResultsPage, Utils } from '@alfresco/aca-testing-shared';
|
|
import * as testData from './test-data-permissions';
|
|
import * as testUtil from '../test-util';
|
|
|
|
const page = new BrowsingPage();
|
|
const { dataTable, toolbar } = page;
|
|
const searchResultsPage = new SearchResultsPage();
|
|
const { searchInput } = searchResultsPage.pageLayoutHeader;
|
|
|
|
export function collaboratorTests(siteName?: string) {
|
|
describe('available actions : ', () => {
|
|
beforeEach(async () => {
|
|
await Utils.pressEscape();
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await page.closeOpenDialogs();
|
|
});
|
|
|
|
it('on File Libraries - [C297647]', async () => {
|
|
await page.goToMyLibrariesAndWait();
|
|
await dataTable.doubleClickOnRowByName(siteName);
|
|
await dataTable.waitForHeader();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Edit Aspects', 'Permissions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Shared Files - [C297651]', async () => {
|
|
await page.clickSharedFilesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Edit Aspects', 'Permissions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Favorites - [C297652]', async () => {
|
|
await page.clickFavoritesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
// TODO: investigate why 'Edit Offline' is not displayed and raise issue
|
|
// TODO: remove 'Move' and 'Delete' when ACA-1737 is done
|
|
const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Search Results - [C297653]', async () => {
|
|
await toolbar.clickSearchIconButton();
|
|
await searchInput.clickSearchButton();
|
|
await searchInput.searchFor(testData.fileSharedFav.name);
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Edit Aspects', 'Permissions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
describe('available actions in the viewer : ', () => {
|
|
it('file opened from File Libraries - [C297654]', async () => {
|
|
await page.goToMyLibrariesAndWait();
|
|
await dataTable.doubleClickOnRowByName(siteName);
|
|
await dataTable.waitForHeader();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = [
|
|
'Edit in Microsoft Office™',
|
|
'Edit Offline',
|
|
'Upload New Version',
|
|
'Remove Favorite',
|
|
'Copy',
|
|
'Manage Versions',
|
|
'Edit Aspects',
|
|
'Permissions'
|
|
];
|
|
|
|
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Shared Files - [C297655]', async () => {
|
|
await page.clickSharedFilesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = [
|
|
'Edit in Microsoft Office™',
|
|
'Edit Offline',
|
|
'Upload New Version',
|
|
'Remove Favorite',
|
|
'Copy',
|
|
'Manage Versions',
|
|
'Edit Aspects',
|
|
'Permissions'
|
|
];
|
|
|
|
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Favorites - [C297656]', async () => {
|
|
await page.clickFavoritesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = [
|
|
'Edit in Microsoft Office™',
|
|
'Edit Offline',
|
|
'Upload New Version',
|
|
'Remove Favorite',
|
|
'Copy',
|
|
'Manage Versions',
|
|
'Edit Aspects',
|
|
'Permissions'
|
|
];
|
|
|
|
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Search Results - [C306992]', async () => {
|
|
await toolbar.clickSearchIconButton();
|
|
await searchInput.clickSearchButton();
|
|
await searchInput.searchFor(testData.fileDocxSharedFav.name);
|
|
await searchResultsPage.waitForResults();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = [
|
|
'Edit in Microsoft Office™',
|
|
'Edit Offline',
|
|
'Upload New Version',
|
|
'Remove Favorite',
|
|
'Copy',
|
|
'Manage Versions',
|
|
'Edit Aspects',
|
|
'Permissions'
|
|
];
|
|
|
|
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
export function filesLockedByCurrentUser(siteName?: string) {
|
|
describe('available actions : ', () => {
|
|
beforeEach(async () => {
|
|
await Utils.pressEscape();
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await page.closeOpenDialogs();
|
|
});
|
|
|
|
it('on File Libraries - [C297657]', async () => {
|
|
await page.goToMyLibrariesAndWait();
|
|
await dataTable.doubleClickOnRowByName(siteName);
|
|
await dataTable.waitForHeader();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Shared Files - [C297658]', async () => {
|
|
await page.clickSharedFilesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Favorites - [C297659]', async () => {
|
|
await page.clickFavoritesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
// TODO: remove 'Move' and 'Delete' when ACA-1737 is fixed
|
|
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Search Results - [C297660]', async () => {
|
|
await toolbar.clickSearchIconButton();
|
|
await searchInput.clickSearchButton();
|
|
await searchInput.searchFor(testData.fileLockedByUser);
|
|
await searchResultsPage.waitForResults();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
describe('available actions in the viewer : ', () => {
|
|
it('file opened from File Libraries - [C297661]', async () => {
|
|
await page.goToMyLibrariesAndWait();
|
|
await dataTable.doubleClickOnRowByName(siteName);
|
|
await dataTable.waitForHeader();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
|
|
|
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Shared Files - [C297662]', async () => {
|
|
await page.clickSharedFilesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
|
|
|
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Favorites - [C297663]', async () => {
|
|
await page.clickFavoritesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
|
|
|
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Search Results - [C306993]', async () => {
|
|
await toolbar.clickSearchIconButton();
|
|
await searchInput.clickSearchButton();
|
|
await searchInput.searchFor(testData.fileLockedByUser);
|
|
await searchResultsPage.waitForResults();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
|
|
|
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
export function filesLockedByOtherUser(siteName?: string) {
|
|
describe('available actions : ', () => {
|
|
beforeEach(async () => {
|
|
await Utils.pressEscape();
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await page.closeOpenDialogs();
|
|
});
|
|
|
|
it('on File Libraries - [C297664]', async () => {
|
|
await page.goToMyLibrariesAndWait();
|
|
await dataTable.doubleClickOnRowByName(siteName);
|
|
await dataTable.waitForHeader();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Shared Files - [C297665]', async () => {
|
|
await page.clickSharedFilesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
// TODO: investigate why 'Upload New Version' appears and raise issue
|
|
const expectedToolbarMore = [
|
|
'Cancel Editing',
|
|
'Upload New Version',
|
|
'Remove Favorite',
|
|
'Move',
|
|
'Copy',
|
|
'Delete',
|
|
'Manage Versions',
|
|
'Permissions'
|
|
];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Favorites - [C297666]', async () => {
|
|
await page.clickFavoritesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
// TODO: investigate why 'Cancel Editing' doesn't appear and raise issue
|
|
// TODO: remove 'Upload New Version' when ACA-1737 is done
|
|
const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('on Search Results - [C297667]', async () => {
|
|
await toolbar.clickSearchIconButton();
|
|
await searchInput.clickSearchButton();
|
|
await searchInput.searchFor(testData.fileLockedByUser);
|
|
await searchResultsPage.waitForResults();
|
|
|
|
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
|
|
|
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
describe('available actions in the viewer : ', () => {
|
|
it('file opened from File Libraries - [C297671]', async () => {
|
|
await page.goToMyLibrariesAndWait();
|
|
await dataTable.doubleClickOnRowByName(siteName);
|
|
await dataTable.waitForHeader();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
|
|
|
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Shared Files - [C297672]', async () => {
|
|
await page.clickSharedFilesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
|
|
|
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Favorites - [C297673]', async () => {
|
|
await page.clickFavoritesAndWait();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
|
|
|
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
|
|
it('file opened from Search Results - [C306994]', async () => {
|
|
await toolbar.clickSearchIconButton();
|
|
await searchInput.clickSearchButton();
|
|
await searchInput.searchFor(testData.fileLockedByUser);
|
|
await searchResultsPage.waitForResults();
|
|
|
|
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
|
// TODO: add 'Move' and 'Delete' when ACA-2319 is fixed
|
|
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
|
|
|
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
|
});
|
|
});
|
|
});
|
|
}
|