mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
refactor available actions e2e (#1311)
* remove unused methods * wrap suites in functions * higher suite calling each wrapped function * better naming * wrap test suites in functions * higher suite calling the wrapped functions * add searchApi to adminActions
This commit is contained in:
parent
8b7c7b5ed4
commit
4e7595f7b2
@ -1,174 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage } from '../../../pages/pages';
|
||||
import { FILES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-files-folders';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('File/folder actions : on Favorites : ', () => {
|
||||
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`;
|
||||
|
||||
const parent = `parent-${random}`;
|
||||
let parentId: string;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
let folderFavId: string;
|
||||
let folderFav2Id: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
fileDocxFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
|
||||
fileFavId = (await userApi.nodes.createFile(data.fileFav.name, parentId)).entry.id;
|
||||
fileDocxSharedFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedFavId = (await userApi.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
|
||||
fileFavLockedId = (await userApi.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
|
||||
fileSharedFavLockedId = (await userApi.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
|
||||
|
||||
folderFavId = (await userApi.nodes.createFolder(data.folderFav.name, parentId)).entry.id;
|
||||
folderFav2Id = (await userApi.nodes.createFolder(data.folderFav2.name, parentId)).entry.id;
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
await userApi.nodes.lockFile(fileFavLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 8 }),
|
||||
userApi.shared.waitForApi({ expect: 3 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.nodes.deleteNodeById(parentId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary, data.fileDocxFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFav.name, data.fileFav.toolbarPrimary, data.fileFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarPrimary, data.fileDocxSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarPrimary, data.fileSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary, data.fileFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarPrimary, data.fileSharedFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folderFav.name, data.folderFav.toolbarPrimary, data.folderFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
it('multiple files - [C280656]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297631]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - [C280664]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - [C280657]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
106
e2e/suites/actions-available/files-folders/favorites.ts
Executable file
106
e2e/suites/actions-available/files-folders/favorites.ts
Executable file
@ -0,0 +1,106 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data';
|
||||
import * as testUtil from '../test-util';
|
||||
import { BrowsingPage } from '../../../pages/pages';
|
||||
|
||||
export function favoritesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesToolbarPrimary, testData.fileDocxSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.favoritesToolbarPrimary, testData.fileSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesToolbarPrimary, testData.fileSharedFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
it('multiple files - [C280656]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297631]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileFavLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileFavLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - [C280664]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.folderFav.name, testData.folderFav2.name ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.folderFav.name, testData.folderFav2.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - [C280657]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileFav.name, testData.folderFav.name ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileFav.name, testData.folderFav.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import { LoginPage } from '../../../pages/pages';
|
||||
import { FILES } from '../../../configs';
|
||||
import * as testData from './test-data';
|
||||
import { personalFilesTests } from './personal-files';
|
||||
import { recentFilesTests } from './recent-files';
|
||||
import { favoritesTests } from './favorites';
|
||||
import { searchResultsTests } from './search-results';
|
||||
import { sharedFilesTests } from './shared-files';
|
||||
import { viewerTests } from './viewer';
|
||||
import { trashTests } from './trash';
|
||||
|
||||
describe('Files / folders actions : ', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`
|
||||
|
||||
const parent = `parent-${random}`;
|
||||
|
||||
let parentId: string;
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
let folderFavId: string;
|
||||
let folderFav2Id: string;
|
||||
let fileInTrashId: string;
|
||||
let file2InTrashId: string;
|
||||
let folderInTrashId: string;
|
||||
let folder2InTrashId: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocx.name );
|
||||
fileDocxFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocxFav.name)).entry.id;
|
||||
await userApi.nodes.createFile(testData.file.name, parentId);
|
||||
fileFavId = (await userApi.nodes.createFile(testData.fileFav.name, parentId)).entry.id;
|
||||
fileDocxSharedId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await userApi.nodes.createFile(testData.fileShared.name, parentId)).entry.id;
|
||||
fileSharedFavId = (await userApi.nodes.createFile(testData.fileSharedFav.name, parentId)).entry.id;
|
||||
fileLockedId = (await userApi.nodes.createFile(testData.fileLocked.name, parentId)).entry.id;
|
||||
fileFavLockedId = (await userApi.nodes.createFile(testData.fileFavLocked.name, parentId)).entry.id;
|
||||
fileSharedLockedId = (await userApi.nodes.createFile(testData.fileSharedLocked.name, parentId)).entry.id;
|
||||
fileSharedFavLockedId = (await userApi.nodes.createFile(testData.fileSharedFavLocked.name, parentId)).entry.id;
|
||||
|
||||
await userApi.nodes.createFolder(testData.folder.name, parentId);
|
||||
folderFavId = (await userApi.nodes.createFolder(testData.folderFav.name, parentId)).entry.id;
|
||||
folderFav2Id = (await userApi.nodes.createFolder(testData.folderFav2.name, parentId)).entry.id;
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.nodes.lockFile(fileLockedId);
|
||||
await userApi.nodes.lockFile(fileFavLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
fileInTrashId = (await userApi.nodes.createFile(testData.fileInTrash.name)).entry.id;
|
||||
file2InTrashId = (await userApi.nodes.createFile(testData.file2InTrash.name)).entry.id;
|
||||
folderInTrashId = (await userApi.nodes.createFolder(testData.folderInTrash.name)).entry.id;
|
||||
folder2InTrashId = (await userApi.nodes.createFolder(testData.folder2InTrash.name)).entry.id;
|
||||
|
||||
await userApi.nodes.deleteNodeById(fileInTrashId, false);
|
||||
await userApi.nodes.deleteNodeById(file2InTrashId, false);
|
||||
await userApi.nodes.deleteNodeById(folderInTrashId, false);
|
||||
await userApi.nodes.deleteNodeById(folder2InTrashId, false);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 8 }),
|
||||
userApi.shared.waitForApi({ expect: 6 }),
|
||||
userApi.search.waitForApi(username, { expect: 12 }),
|
||||
userApi.trashcan.waitForApi({ expect: 4 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.nodes.deleteNodeById(parentId);
|
||||
await userApi.trashcan.emptyTrash();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('on Personal Files : ', () => {
|
||||
personalFilesTests(parent);
|
||||
});
|
||||
|
||||
describe('on Recent Files : ', () => {
|
||||
recentFilesTests();
|
||||
});
|
||||
|
||||
describe('on Favorites : ', () => {
|
||||
favoritesTests();
|
||||
});
|
||||
|
||||
describe('on Search Results : ', () => {
|
||||
searchResultsTests();
|
||||
});
|
||||
|
||||
describe('on Shared Files : ', () => {
|
||||
sharedFilesTests();
|
||||
});
|
||||
|
||||
describe('on Viewer : ', () => {
|
||||
viewerTests(parent);
|
||||
});
|
||||
|
||||
describe('on Trash : ', () => {
|
||||
trashTests();
|
||||
});
|
||||
|
||||
});
|
150
e2e/suites/actions-available/files-folders/personal-files.ts
Executable file
150
e2e/suites/actions-available/files-folders/personal-files.ts
Executable file
@ -0,0 +1,150 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data';
|
||||
import * as testUtil from '../test-util';
|
||||
import { BrowsingPage } from '../../../pages/pages';
|
||||
|
||||
export function personalFilesTests(parentName?: string) {
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parentName);
|
||||
await dataTable.waitForHeader();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.toolbarPrimary, testData.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.file.name, testData.file.toolbarPrimary, testData.file.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.file.name, testData.file.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.toolbarPrimary, testData.fileLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
it('Folder not favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folder.name, testData.folder.toolbarPrimary, testData.folder.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folder.name, testData.folder.contextMenu);
|
||||
});
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
it('multiple files - [C217112]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocx.name, testData.fileDocxSharedFav.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocx.name, testData.fileDocxSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297619]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - [C280459]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.folderFav.name, testData.folder.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.folderFav.name, testData.folder.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - [C280460]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folder.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folder.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
@ -1,230 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage } from '../../../pages/pages';
|
||||
import { FILES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-files-folders';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('File/folder actions : on Personal Files: ', () => {
|
||||
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`;
|
||||
|
||||
const parent = `parent-${random}`;
|
||||
let parentId: string;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
let folderFavId: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name );
|
||||
fileDocxFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
|
||||
await userApi.nodes.createFile(data.file.name, parentId);
|
||||
fileFavId = (await userApi.nodes.createFile(data.fileFav.name, parentId)).entry.id;
|
||||
fileDocxSharedId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await userApi.nodes.createFile(data.fileShared.name, parentId)).entry.id;
|
||||
fileSharedFavId = (await userApi.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
|
||||
fileLockedId = (await userApi.nodes.createFile(data.fileLocked.name, parentId)).entry.id;
|
||||
fileFavLockedId = (await userApi.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
|
||||
fileSharedLockedId = (await userApi.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
|
||||
fileSharedFavLockedId = (await userApi.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
|
||||
|
||||
await userApi.nodes.createFolder(data.folder.name, parentId);
|
||||
folderFavId = (await userApi.nodes.createFolder(data.folderFav.name, parentId)).entry.id;
|
||||
await userApi.favorites.addFavoriteById('folder', folderFavId);
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.nodes.lockFile(fileLockedId);
|
||||
await userApi.nodes.lockFile(fileFavLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 7 }),
|
||||
userApi.shared.waitForApi({ expect: 6 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.waitForHeader();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.nodes.deleteNodeById(parentId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocx.name, data.fileDocx.toolbarPrimary, data.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary, data.fileDocxFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.file.name, data.file.toolbarPrimary, data.file.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.file.name, data.file.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFav.name, data.fileFav.toolbarPrimary, data.fileFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary, data.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary, data.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileShared.name, data.fileShared.toolbarPrimary, data.fileShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary, data.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileLocked.name, data.fileLocked.toolbarPrimary, data.fileLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary, data.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary, data.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary, data.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
it('Folder not favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folder.name, data.folder.toolbarPrimary, data.folder.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu);
|
||||
});
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folderFav.name, data.folderFav.toolbarPrimary, data.folderFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
it('multiple files - [C217112]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297619]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - [C280459]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folder.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - [C280460]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folder.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.file.name, data.folder.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
124
e2e/suites/actions-available/files-folders/recent-files.ts
Executable file
124
e2e/suites/actions-available/files-folders/recent-files.ts
Executable file
@ -0,0 +1,124 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data';
|
||||
import * as testUtil from '../test-util';
|
||||
import { BrowsingPage } from '../../../pages/pages';
|
||||
|
||||
export function recentFilesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('on single selection', () => {
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.toolbarPrimary, testData.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.file.name, testData.file.toolbarPrimary, testData.file.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.file.name, testData.file.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.toolbarPrimary, testData.fileLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
it('multiple files - [C280468]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileLocked.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileFav.name ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297624]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
@ -1,200 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage } from '../../../pages/pages';
|
||||
import { FILES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-files-folders';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('File actions : on Recent Files: ', () => {
|
||||
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`;
|
||||
|
||||
const parent = `parent-${random}`;
|
||||
let parentId: string;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name);
|
||||
fileDocxFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
|
||||
await userApi.nodes.createFile(data.file.name, parentId);
|
||||
fileFavId = (await userApi.nodes.createFile(data.fileFav.name, parentId)).entry.id;
|
||||
fileDocxSharedId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await userApi.nodes.createFile(data.fileShared.name, parentId)).entry.id;
|
||||
fileSharedFavId = (await userApi.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
|
||||
fileLockedId = (await userApi.nodes.createFile(data.fileLocked.name, parentId)).entry.id;
|
||||
fileFavLockedId = (await userApi.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
|
||||
fileSharedLockedId = (await userApi.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
|
||||
fileSharedFavLockedId = (await userApi.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.nodes.lockFile(fileLockedId);
|
||||
await userApi.nodes.lockFile(fileFavLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 6 }),
|
||||
userApi.shared.waitForApi({ expect: 6 }),
|
||||
userApi.search.waitForApi(username, { expect: 12 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.nodes.deleteNodeById(parentId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('on single selection', () => {
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocx.name, data.fileDocx.toolbarPrimary, data.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary, data.fileDocxFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.file.name, data.file.toolbarPrimary, data.file.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.file.name, data.file.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFav.name, data.fileFav.toolbarPrimary, data.fileFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary, data.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary, data.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileShared.name, data.fileShared.toolbarPrimary, data.fileShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary, data.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileLocked.name, data.fileLocked.toolbarPrimary, data.fileLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary, data.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary, data.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary, data.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
it('multiple files - [C280468]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileLocked.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, data.fileLocked.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileFav.name ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, data.fileFav.name ], data.multipleSel.toolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297624]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
179
e2e/suites/actions-available/files-folders/search-results.ts
Executable file
179
e2e/suites/actions-available/files-folders/search-results.ts
Executable file
@ -0,0 +1,179 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function searchResultsTests() {
|
||||
const page = new BrowsingPage();
|
||||
const { searchInput } = page.header;
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.searchToolbarPrimary, testData.fileDocx.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.searchToolbarPrimary, testData.fileDocxFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.file.name, testData.file.searchToolbarPrimary, testData.file.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.file.name, testData.file.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.searchToolbarPrimary, testData.fileFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.searchToolbarPrimary, testData.fileDocxShared.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchToolbarPrimary, testData.fileDocxSharedFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.searchToolbarPrimary, testData.fileShared.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.searchToolbarPrimary, testData.fileSharedFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.searchToolbarPrimary, testData.fileLocked.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.searchToolbarPrimary, testData.fileFavLocked.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.searchToolbarPrimary, testData.fileSharedLocked.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.searchToolbarPrimary, testData.fileSharedFavLocked.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.searchContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('Folder not favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folder.name, testData.folder.searchToolbarPrimary, testData.folder.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folder.name, testData.folder.searchContextMenu);
|
||||
});
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.searchToolbarPrimary, testData.folderFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.searchContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('multiple files - [C291820]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSelAllFav.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSelAllFav.searchToolbarPrimary, testData.multipleSelAllFav.searchToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297626]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - [C291821]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
await searchResultsPage.waitForResults();
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - [C291822]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(`=${testData.file.name} or =${testData.folderFav.name}`);
|
||||
await searchResultsPage.waitForResults();
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folderFav.name ], testData.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
@ -1,258 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { FILES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-files-folders';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('File/folder actions : on Search Results : ', () => {
|
||||
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`;
|
||||
|
||||
const parent = `parent-${random}`;
|
||||
let parentId: string;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
let folderFavId: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { searchInput } = page.header;
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name );
|
||||
fileDocxFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
|
||||
await userApi.nodes.createFile(data.file.name, parentId);
|
||||
fileFavId = (await userApi.nodes.createFile(data.fileFav.name, parentId)).entry.id;
|
||||
fileDocxSharedId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await userApi.nodes.createFile(data.fileShared.name, parentId)).entry.id;
|
||||
fileSharedFavId = (await userApi.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
|
||||
fileLockedId = (await userApi.nodes.createFile(data.fileLocked.name, parentId)).entry.id;
|
||||
fileFavLockedId = (await userApi.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
|
||||
fileSharedLockedId = (await userApi.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
|
||||
fileSharedFavLockedId = (await userApi.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
|
||||
|
||||
await userApi.nodes.createFolder(data.folder.name, parentId);
|
||||
folderFavId = (await userApi.nodes.createFolder(data.folderFav.name, parentId)).entry.id;
|
||||
await userApi.favorites.addFavoriteById('folder', folderFavId);
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.nodes.lockFile(fileLockedId);
|
||||
await userApi.nodes.lockFile(fileFavLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 7 }),
|
||||
userApi.shared.waitForApi({ expect: 6 }),
|
||||
userApi.search.waitForApi(username, { expect: 12 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.nodes.deleteNodeById(parentId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocx.name, data.fileDocx.searchToolbarPrimary, data.fileDocx.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxFav.name, data.fileDocxFav.searchToolbarPrimary, data.fileDocxFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.file.name, data.file.searchToolbarPrimary, data.file.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.file.name, data.file.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFav.name, data.fileFav.searchToolbarPrimary, data.fileFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxShared.name, data.fileDocxShared.searchToolbarPrimary, data.fileDocxShared.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchToolbarPrimary, data.fileDocxSharedFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileShared.name, data.fileShared.searchToolbarPrimary, data.fileShared.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.searchToolbarPrimary, data.fileSharedFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileLocked.name, data.fileLocked.searchToolbarPrimary, data.fileLocked.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFavLocked.name, data.fileFavLocked.searchToolbarPrimary, data.fileFavLocked.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedLocked.name, data.fileSharedLocked.searchToolbarPrimary, data.fileSharedLocked.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchToolbarPrimary, data.fileSharedFavLocked.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('Folder not favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folder.name, data.folder.searchToolbarPrimary, data.folder.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.folder.name, data.folder.searchContextMenu);
|
||||
});
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folderFav.name, data.folderFav.searchToolbarPrimary, data.folderFav.searchToolbarMore);
|
||||
await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.searchContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('multiple files - [C291820]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchToolbarPrimary, data.multipleSel.searchToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.searchToolbarPrimary, data.multipleSelAllFav.searchToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297626]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchToolbarPrimary, data.multipleSel.searchToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - [C291821]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
await searchResultsPage.waitForResults();
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ data.folder.name, data.folderFav.name ], data.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.folder.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary, data.multipleSel.searchToolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - [C291822]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(`=${data.file.name} or =${data.folderFav.name}`);
|
||||
await searchResultsPage.waitForResults();
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folderFav.name ], data.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.file.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary, data.multipleSel.searchToolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
94
e2e/suites/actions-available/files-folders/shared-files.ts
Executable file
94
e2e/suites/actions-available/files-folders/shared-files.ts
Executable file
@ -0,0 +1,94 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function sharedFilesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('single selection', () => {
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.sharedContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('multiple selection', () => {
|
||||
it('multiple files - [C280467]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileShared.name, testData.fileSharedFav.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileShared.name, testData.fileSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297623]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileSharedLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
@ -1,154 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage } from '../../../pages/pages';
|
||||
import { FILES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-files-folders';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('File actions : on Shared Files : ', () => {
|
||||
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`;
|
||||
|
||||
const parent = `parent-${random}`;
|
||||
let parentId: string;
|
||||
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
fileDocxSharedId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await userApi.nodes.createFile(data.fileShared.name, parentId)).entry.id;
|
||||
fileSharedFavId = (await userApi.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
|
||||
fileSharedLockedId = (await userApi.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
|
||||
fileSharedFavLockedId = (await userApi.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.nodes.lockFile(fileSharedLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 3 }),
|
||||
userApi.shared.waitForApi({ expect: 6 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.nodes.deleteNodeById(parentId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('single selection', () => {
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary, data.fileDocxShared.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary, data.fileDocxSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileShared.name, data.fileShared.toolbarPrimary, data.fileShared.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary, data.fileSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary, data.fileSharedLocked.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary, data.fileSharedFavLocked.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('multiple selection', () => {
|
||||
it('multiple files - [C280467]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297623]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
@ -1,102 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage } from '../../../pages/pages';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-files-folders';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('File/folder actions : on Trash : ', () => {
|
||||
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
let fileInTrashId: string;
|
||||
let file2InTrashId: string;
|
||||
let folderInTrashId: string;
|
||||
let folder2InTrashId: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
fileInTrashId = (await userApi.nodes.createFile(data.fileInTrash.name)).entry.id;
|
||||
file2InTrashId = (await userApi.nodes.createFile(data.file2InTrash.name)).entry.id;
|
||||
folderInTrashId = (await userApi.nodes.createFolder(data.folderInTrash.name)).entry.id;
|
||||
folder2InTrashId = (await userApi.nodes.createFolder(data.folder2InTrash.name)).entry.id;
|
||||
|
||||
await userApi.nodes.deleteNodeById(fileInTrashId, false);
|
||||
await userApi.nodes.deleteNodeById(file2InTrashId, false);
|
||||
await userApi.nodes.deleteNodeById(folderInTrashId, false);
|
||||
await userApi.nodes.deleteNodeById(folder2InTrashId, false);
|
||||
|
||||
await userApi.trashcan.waitForApi({ expect: 4 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
await page.clickTrashAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.trashcan.emptyTrash();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
it('on a file - [C286258]', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.fileInTrash.name, data.fileInTrash.trashActions);
|
||||
await testUtil.checkContextMenu(data.fileInTrash.name, data.fileInTrash.trashActions);
|
||||
});
|
||||
|
||||
it('on a folder - [C286259]', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.folderInTrash.name, data.folderInTrash.trashActions);
|
||||
await testUtil.checkContextMenu(data.folderInTrash.name, data.folderInTrash.trashActions);
|
||||
});
|
||||
|
||||
it('multiple files - [C280472]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileInTrash.name, data.file2InTrash.name ], data.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([ data.fileInTrash.name, data.file2InTrash.name ], data.trashActions);
|
||||
});
|
||||
|
||||
it('multiple folders - [C280473]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.folderInTrash.name, data.folder2InTrash.name ], data.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([ data.folderInTrash.name, data.folder2InTrash.name ], data.trashActions);
|
||||
});
|
||||
|
||||
it('both files and folders - [C280474]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileInTrash.name, data.folderInTrash.name ], data.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([ data.fileInTrash.name, data.folderInTrash.name ], data.trashActions);
|
||||
});
|
||||
|
||||
});
|
70
e2e/suites/actions-available/files-folders/trash.ts
Executable file
70
e2e/suites/actions-available/files-folders/trash.ts
Executable file
@ -0,0 +1,70 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function trashTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickTrashAndWait();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
it('on a file - [C286258]', async () => {
|
||||
await testUtil.checkToolbarPrimary(testData.fileInTrash.name, testData.fileInTrash.trashActions);
|
||||
await testUtil.checkContextMenu(testData.fileInTrash.name, testData.fileInTrash.trashActions);
|
||||
});
|
||||
|
||||
it('on a folder - [C286259]', async () => {
|
||||
await testUtil.checkToolbarPrimary(testData.folderInTrash.name, testData.folderInTrash.trashActions);
|
||||
await testUtil.checkContextMenu(testData.folderInTrash.name, testData.folderInTrash.trashActions);
|
||||
});
|
||||
|
||||
it('multiple files - [C280472]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileInTrash.name, testData.file2InTrash.name ], testData.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([ testData.fileInTrash.name, testData.file2InTrash.name ], testData.trashActions);
|
||||
});
|
||||
|
||||
it('multiple folders - [C280473]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.folderInTrash.name, testData.folder2InTrash.name ], testData.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([ testData.folderInTrash.name, testData.folder2InTrash.name ], testData.trashActions);
|
||||
});
|
||||
|
||||
it('both files and folders - [C280474]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileInTrash.name, testData.folderInTrash.name ], testData.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([ testData.fileInTrash.name, testData.folderInTrash.name ], testData.trashActions);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
@ -1,356 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { FILES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-files-folders';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('File/folder actions : in the viewer : ', () => {
|
||||
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`;
|
||||
|
||||
const parent = `parent-${random}`;
|
||||
let parentId: string;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { dataTable } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name );
|
||||
fileDocxFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
|
||||
await userApi.nodes.createFile(data.file.name, parentId);
|
||||
fileFavId = (await userApi.nodes.createFile(data.fileFav.name, parentId)).entry.id;
|
||||
fileDocxSharedId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await userApi.nodes.createFile(data.fileShared.name, parentId)).entry.id;
|
||||
fileSharedFavId = (await userApi.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
|
||||
fileLockedId = (await userApi.nodes.createFile(data.fileLocked.name, parentId)).entry.id;
|
||||
fileFavLockedId = (await userApi.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
|
||||
fileSharedLockedId = (await userApi.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
|
||||
fileSharedFavLockedId = (await userApi.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.nodes.lockFile(fileLockedId);
|
||||
await userApi.nodes.lockFile(fileFavLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedLockedId);
|
||||
await userApi.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 6 }),
|
||||
userApi.shared.waitForApi({ expect: 6 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.nodes.deleteNodeById(parentId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('file opened from Personal Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.waitForHeader();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary, data.fileDocx.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary, data.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(data.file.name, data.file.viewerToolbarPrimary, data.file.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary, data.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary, data.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary, data.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary, data.fileLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary, data.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary, data.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Recent Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary, data.fileDocx.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary, data.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(data.file.name, data.file.viewerToolbarPrimary, data.file.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary, data.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary, data.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary, data.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary, data.fileLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary, data.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary, data.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Favorites', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary, data.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary, data.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary, data.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Shared Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary, data.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary, data.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary, data.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Search Results', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary, data.fileDocx.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary, data.fileDocxFav.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(data.file.name, data.file.viewerToolbarPrimary, data.file.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary, data.fileFav.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary, data.fileDocxShared.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary, data.fileShared.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary, data.fileLocked.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary, data.fileFavLocked.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary, data.fileSharedLocked.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.searchViewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
283
e2e/suites/actions-available/files-folders/viewer.ts
Executable file
283
e2e/suites/actions-available/files-folders/viewer.ts
Executable file
@ -0,0 +1,283 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function viewerTests(parentName?: string) {
|
||||
const page = new BrowsingPage();
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { dataTable } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('file opened from Personal Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parentName);
|
||||
await dataTable.waitForHeader();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Recent Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Favorites', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Shared Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Search Results', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.searchViewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.searchViewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
@ -27,7 +27,7 @@ import { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-libraries';
|
||||
import * as testData from './test-data-libraries';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('Library actions : ', () => {
|
||||
@ -45,25 +45,25 @@ describe('Library actions : ', () => {
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await userApi.sites.createSite(data.publicUserMemberFav.name);
|
||||
await userApi.sites.createSitePrivate(data.privateUserMemberFav.name);
|
||||
await userApi.sites.createSiteModerated(data.moderatedUserMemberFav.name);
|
||||
await userApi.sites.createSite(testData.publicUserMemberFav.name);
|
||||
await userApi.sites.createSitePrivate(testData.privateUserMemberFav.name);
|
||||
await userApi.sites.createSiteModerated(testData.moderatedUserMemberFav.name);
|
||||
|
||||
const publicUserMemberNotFavId = (await userApi.sites.createSite(data.publicUserMemberNotFav.name)).entry.guid;
|
||||
const privateUserMemberNotFavId = (await userApi.sites.createSitePrivate(data.privateUserMemberNotFav.name)).entry.guid;
|
||||
const moderatedUserMemberNotFavId = (await userApi.sites.createSiteModerated(data.moderatedUserMemberNotFav.name)).entry.guid;
|
||||
const publicUserMemberNotFavId = (await userApi.sites.createSite(testData.publicUserMemberNotFav.name)).entry.guid;
|
||||
const privateUserMemberNotFavId = (await userApi.sites.createSitePrivate(testData.privateUserMemberNotFav.name)).entry.guid;
|
||||
const moderatedUserMemberNotFavId = (await userApi.sites.createSiteModerated(testData.moderatedUserMemberNotFav.name)).entry.guid;
|
||||
|
||||
await adminApiActions.sites.createSite(data.publicNotMemberFav.name);
|
||||
await adminApiActions.sites.createSiteModerated(data.moderatedNotMemberFav.name);
|
||||
await adminApiActions.sites.createSite(testData.publicNotMemberFav.name);
|
||||
await adminApiActions.sites.createSiteModerated(testData.moderatedNotMemberFav.name);
|
||||
|
||||
await adminApiActions.sites.createSite(data.publicNotMemberNotFav.name);
|
||||
await adminApiActions.sites.createSiteModerated(data.moderatedNotMemberNotFav.name);
|
||||
await adminApiActions.sites.createSite(testData.publicNotMemberNotFav.name);
|
||||
await adminApiActions.sites.createSiteModerated(testData.moderatedNotMemberNotFav.name);
|
||||
|
||||
await adminApiActions.sites.createSiteModerated(data.moderatedRequestedJoinFav.name);
|
||||
await adminApiActions.sites.createSiteModerated(data.moderatedRequestedJoinNotFav.name);
|
||||
await adminApiActions.sites.createSiteModerated(testData.moderatedRequestedJoinFav.name);
|
||||
await adminApiActions.sites.createSiteModerated(testData.moderatedRequestedJoinNotFav.name);
|
||||
|
||||
await userApi.sites.createSite(data.siteInTrash.name);
|
||||
await userApi.sites.createSite(data.site2InTrash.name);
|
||||
await userApi.sites.createSite(testData.siteInTrash.name);
|
||||
await userApi.sites.createSite(testData.site2InTrash.name);
|
||||
|
||||
await Promise.all([
|
||||
userApi.sites.waitForApi({ expect: 8 }),
|
||||
@ -72,15 +72,15 @@ describe('Library actions : ', () => {
|
||||
|
||||
await userApi.favorites.removeFavoritesByIds([publicUserMemberNotFavId, privateUserMemberNotFavId, moderatedUserMemberNotFavId]);
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('site', [data.publicNotMemberFav.name, data.moderatedNotMemberFav.name, data.moderatedRequestedJoinFav.name]);
|
||||
await userApi.favorites.addFavoritesByIds('site', [testData.publicNotMemberFav.name, testData.moderatedNotMemberFav.name, testData.moderatedRequestedJoinFav.name]);
|
||||
|
||||
await userApi.sites.requestToJoin(data.moderatedRequestedJoinFav.name);
|
||||
await userApi.sites.requestToJoin(data.moderatedRequestedJoinNotFav.name);
|
||||
await userApi.sites.requestToJoin(testData.moderatedRequestedJoinFav.name);
|
||||
await userApi.sites.requestToJoin(testData.moderatedRequestedJoinNotFav.name);
|
||||
|
||||
await userApi.queries.waitForSites('site-', { expect: 14 + 1 });
|
||||
|
||||
await userApi.sites.deleteSite(data.siteInTrash.name, false);
|
||||
await userApi.sites.deleteSite(data.site2InTrash.name, false);
|
||||
await userApi.sites.deleteSite(testData.siteInTrash.name, false);
|
||||
await userApi.sites.deleteSite(testData.site2InTrash.name, false);
|
||||
|
||||
await userApi.trashcan.waitForApi({ expect: 2 });
|
||||
|
||||
@ -90,20 +90,20 @@ describe('Library actions : ', () => {
|
||||
afterAll(async () => {
|
||||
await Promise.all([
|
||||
userApi.sites.deleteSites([
|
||||
data.publicUserMemberFav.name,
|
||||
data.privateUserMemberFav.name,
|
||||
data.moderatedUserMemberFav.name,
|
||||
data.publicUserMemberNotFav.name,
|
||||
data.privateUserMemberNotFav.name,
|
||||
data.moderatedUserMemberNotFav.name
|
||||
testData.publicUserMemberFav.name,
|
||||
testData.privateUserMemberFav.name,
|
||||
testData.moderatedUserMemberFav.name,
|
||||
testData.publicUserMemberNotFav.name,
|
||||
testData.privateUserMemberNotFav.name,
|
||||
testData.moderatedUserMemberNotFav.name
|
||||
]),
|
||||
adminApiActions.sites.deleteSites([
|
||||
data.publicNotMemberFav.name,
|
||||
data.moderatedNotMemberFav.name,
|
||||
data.publicNotMemberNotFav.name,
|
||||
data.moderatedNotMemberNotFav.name,
|
||||
data.moderatedRequestedJoinFav.name,
|
||||
data.moderatedRequestedJoinNotFav.name
|
||||
testData.publicNotMemberFav.name,
|
||||
testData.moderatedNotMemberFav.name,
|
||||
testData.publicNotMemberNotFav.name,
|
||||
testData.moderatedNotMemberNotFav.name,
|
||||
testData.moderatedRequestedJoinFav.name,
|
||||
testData.moderatedRequestedJoinNotFav.name
|
||||
]),
|
||||
userApi.trashcan.emptyTrash()
|
||||
]);
|
||||
@ -121,39 +121,39 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
it('Public library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Private library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Public library, user is a member, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Private library, user is a member, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user is a member, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
@ -170,39 +170,39 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
it('Public library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Private library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Public library, user not a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.publicNotMemberFav.name, data.publicNotMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.publicNotMemberFav.name, testData.publicNotMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.publicNotMemberFav.name, testData.publicNotMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.publicNotMemberFav.name, testData.publicNotMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user not a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user requested to join, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.toolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
@ -221,75 +221,75 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
it('Public library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.publicUserMemberFav.name, testData.publicUserMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Private library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.privateUserMemberFav.name, testData.privateUserMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user is a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Public library, user is a member, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Private library, user is a member, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user is a member, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Public library, user not a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.publicNotMemberFav.name, data.publicNotMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.publicNotMemberFav.name, data.publicNotMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.publicNotMemberFav.name, testData.publicNotMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.publicNotMemberFav.name, testData.publicNotMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.publicNotMemberFav.name, testData.publicNotMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user not a member, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Public library, user not a member, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.publicNotMemberNotFav.name, testData.publicNotMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.publicNotMemberNotFav.name, testData.publicNotMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.publicNotMemberNotFav.name, testData.publicNotMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user not a member, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedNotMemberNotFav.name, testData.moderatedNotMemberNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedNotMemberNotFav.name, testData.moderatedNotMemberNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedNotMemberNotFav.name, testData.moderatedNotMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user requested to join, favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.contextMenu);
|
||||
});
|
||||
|
||||
it('Moderated library, user requested to join, not favorite - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.contextMenu);
|
||||
await testUtil.checkToolbarPrimary(testData.moderatedRequestedJoinNotFav.name, testData.moderatedRequestedJoinNotFav.searchToolbarPrimary);
|
||||
await testUtil.checkToolbarMoreActions(testData.moderatedRequestedJoinNotFav.name, testData.moderatedRequestedJoinNotFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.moderatedRequestedJoinNotFav.name, testData.moderatedRequestedJoinNotFav.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
@ -304,13 +304,13 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
it('single library - []', async () => {
|
||||
await testUtil.checkToolbarPrimary(data.siteInTrash.name, data.siteInTrash.trashActions);
|
||||
await testUtil.checkContextMenu(data.siteInTrash.name, data.siteInTrash.trashActions);
|
||||
await testUtil.checkToolbarPrimary(testData.siteInTrash.name, testData.siteInTrash.trashActions);
|
||||
await testUtil.checkContextMenu(testData.siteInTrash.name, testData.siteInTrash.trashActions);
|
||||
});
|
||||
|
||||
it('multiple libraries - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.siteInTrash.name, data.site2InTrash.name ], data.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([ data.siteInTrash.name, data.site2InTrash.name ], data.trashActions);
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.siteInTrash.name, testData.site2InTrash.name ], testData.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([ testData.siteInTrash.name, testData.site2InTrash.name ], testData.trashActions);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
121
e2e/suites/actions-available/special-permissions/favorites.ts
Executable file
121
e2e/suites/actions-available/special-permissions/favorites.ts
Executable file
@ -0,0 +1,121 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function favoritesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesToolbarPrimary, testData.fileDocxSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.favoritesToolbarPrimary, testData.fileSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesToolbarPrimary, testData.fileSharedFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
it('multiple files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileFavLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileFavLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.folderFav.name, testData.folderFav2.name ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.folderFav.name, testData.folderFav2.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileFav.name, testData.folderFav.name ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileFav.name, testData.folderFav.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
162
e2e/suites/actions-available/special-permissions/my-libraries.ts
Executable file
162
e2e/suites/actions-available/special-permissions/my-libraries.ts
Executable file
@ -0,0 +1,162 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function librariesTests(siteName?: string) {
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.toolbarPrimary, testData.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.file.name, testData.file.toolbarPrimary, testData.file.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.file.name, testData.file.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.toolbarPrimary, testData.fileLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
it('Folder not favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folder.name, testData.folder.toolbarPrimary, testData.folder.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folder.name, testData.folder.contextMenu);
|
||||
});
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
it('multiple files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocx.name, testData.fileDocxSharedFav.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocx.name, testData.fileDocxSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.folderFav.name, testData.folder.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.folderFav.name, testData.folder.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folder.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folder.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
@ -23,111 +23,25 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { SITE_ROLES, FILES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as testData from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('', () => {
|
||||
const random = Utils.random();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { searchInput } = searchResultsPage.header;
|
||||
|
||||
const userConsumer = `consumer-${random}`;
|
||||
const userCollaborator = `collaborator-${random}`;
|
||||
const userDemoted = `demoted-${random}`;
|
||||
export function collaboratorTests(siteName?: string) {
|
||||
describe('available actions : ', () => {
|
||||
|
||||
const siteName = `site-private-${random}`;
|
||||
const file1 = `my-file1-${random}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `my-file2-${random}.txt`;
|
||||
let file2Id: string;
|
||||
const file3 = `my-file3-${random}.txt`;
|
||||
let file3Id: string;
|
||||
const fileLocked = `my-file-locked-${random}.txt`;
|
||||
let fileLockedId: string;
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
const folder1 = `my-folder1-${random}`;
|
||||
let folder1Id: string;
|
||||
const folder2 = `my-folder2-${random}`;
|
||||
let folder2Id: string;
|
||||
|
||||
const docxFile = FILES.docxFile;
|
||||
let docxFileId: string;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const apis = {
|
||||
userConsumer: new RepoClient(userConsumer, userConsumer),
|
||||
userCollaborator: new RepoClient(userCollaborator, userCollaborator),
|
||||
userDemoted: new RepoClient(userDemoted, userDemoted)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { searchInput } = searchResultsPage.header;
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username: userConsumer });
|
||||
await adminApiActions.createUser({ username: userCollaborator });
|
||||
await adminApiActions.createUser({ username: userDemoted });
|
||||
|
||||
await adminApiActions.sites.createSitePrivate(siteName);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(siteName);
|
||||
|
||||
file1Id = (await adminApiActions.nodes.createFile(file1, docLibId)).entry.id;
|
||||
file2Id = (await adminApiActions.nodes.createFile(file2, docLibId)).entry.id;
|
||||
file3Id = (await adminApiActions.nodes.createFile(file3, docLibId)).entry.id;
|
||||
folder1Id = (await adminApiActions.nodes.createFolder(folder1, docLibId)).entry.id;
|
||||
folder2Id = (await adminApiActions.nodes.createFolder(folder2, docLibId)).entry.id;
|
||||
|
||||
docxFileId = (await adminApiActions.upload.uploadFile(docxFile, docLibId)).entry.id;
|
||||
|
||||
await adminApiActions.sites.addSiteConsumer(siteName, userConsumer);
|
||||
await adminApiActions.sites.addSiteCollaborator(siteName, userCollaborator);
|
||||
await adminApiActions.sites.addSiteManager(siteName, userDemoted);
|
||||
|
||||
fileLockedId = (await adminApiActions.nodes.createFile(fileLocked, docLibId)).entry.id;
|
||||
await apis.userDemoted.nodes.lockFile(fileLockedId);
|
||||
await apis.userDemoted.favorites.addFavoriteById('file', fileLockedId);
|
||||
await apis.userDemoted.shared.shareFileById(fileLockedId);
|
||||
await adminApiActions.sites.updateSiteMember(siteName, userDemoted, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
await adminApiActions.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
await apis.userConsumer.shared.shareFilesByIds([file1Id, file2Id, docxFileId, file3Id]);
|
||||
|
||||
await apis.userConsumer.favorites.addFavoritesByIds('file', [file1Id, file2Id, file3Id, docxFileId]);
|
||||
await apis.userConsumer.favorites.addFavoritesByIds('folder', [folder1Id, folder2Id]);
|
||||
|
||||
await apis.userCollaborator.favorites.addFavoritesByIds('file', [file1Id, docxFileId]);
|
||||
|
||||
await adminApiActions.favorites.addFavoriteById('file', fileLockedId);
|
||||
|
||||
await Promise.all([
|
||||
apis.userConsumer.shared.waitForApi({ expect: 5 }),
|
||||
apis.userConsumer.favorites.waitForApi({ expect: 6 }),
|
||||
apis.userCollaborator.favorites.waitForApi({ expect: 2 })
|
||||
]);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adminApiActions.sites.deleteSite(siteName);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('Collaborator', () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(userCollaborator);
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C297647]', async () => {
|
||||
@ -138,7 +52,7 @@ describe('', () => {
|
||||
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
|
||||
await testUtil.checkToolbarActions(file1, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Shared Files - [C297651]', async () => {
|
||||
@ -148,7 +62,7 @@ describe('', () => {
|
||||
// TODO: add 'Edit Offline' when ACA-2173 is done
|
||||
const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
|
||||
await testUtil.checkToolbarActions(file1, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Favorites - [C297652]', async () => {
|
||||
@ -160,20 +74,20 @@ describe('', () => {
|
||||
// TODO: remove 'Move' when ACA-1737 is done
|
||||
const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
|
||||
await testUtil.checkToolbarActions(file1, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Search Results - [C297653]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(file1);
|
||||
await searchInput.searchFor(testData.fileSharedFav.name);
|
||||
|
||||
const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
|
||||
await testUtil.checkToolbarActions(file1, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
describe('in the viewer', () => {
|
||||
describe('available actions in the viewer : ', () => {
|
||||
it('file opened from File Libraries - [C297654]', async () => {
|
||||
await page.clickFileLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
@ -182,7 +96,7 @@ describe('', () => {
|
||||
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', 'Permissions'];
|
||||
|
||||
await testUtil.checkViewerActions(docxFile, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Shared Files - [C297655]', async () => {
|
||||
@ -191,7 +105,7 @@ describe('', () => {
|
||||
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', 'Permissions'];
|
||||
|
||||
await testUtil.checkViewerActions(docxFile, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Favorites - [C297656]', async () => {
|
||||
@ -200,25 +114,31 @@ describe('', () => {
|
||||
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', 'Permissions'];
|
||||
|
||||
await testUtil.checkViewerActions(docxFile, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Search Results - [C306992]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(docxFile);
|
||||
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', 'Permissions'];
|
||||
|
||||
await testUtil.checkViewerActions(docxFile, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
describe('File locked - lock owner : ', () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(userDemoted);
|
||||
export function filesLockedByCurrentUser(siteName?: string) {
|
||||
describe('available actions : ', () => {
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C297657]', async () => {
|
||||
@ -229,7 +149,7 @@ describe('', () => {
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Shared Files - [C297658]', async () => {
|
||||
@ -239,7 +159,7 @@ describe('', () => {
|
||||
// TODO: add 'Cancel Editing' when ACA-2173 is done
|
||||
const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
||||
|
||||
await testUtil.checkToolbarActions(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Favorites - [C297659]', async () => {
|
||||
@ -251,21 +171,21 @@ describe('', () => {
|
||||
// TODO: remove 'Delete' when ACA-1737 is fixed
|
||||
const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
|
||||
await testUtil.checkToolbarActions(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Search Results - [C297660]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(fileLocked);
|
||||
await searchInput.searchFor(testData.fileLockedByUser);
|
||||
await searchResultsPage.waitForResults();
|
||||
|
||||
const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
||||
|
||||
await testUtil.checkToolbarActions(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
describe('in the viewer', () => {
|
||||
describe('available actions in the viewer : ', () => {
|
||||
it('file opened from File Libraries - [C297661]', async () => {
|
||||
await page.clickFileLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
@ -274,7 +194,7 @@ describe('', () => {
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Shared Files - [C297662]', async () => {
|
||||
@ -283,7 +203,7 @@ describe('', () => {
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Favorites - [C297663]', async () => {
|
||||
@ -292,25 +212,32 @@ describe('', () => {
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Search Results - [C306993]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(fileLocked);
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
describe('File locked by other user - manager : ', () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWithAdmin();
|
||||
export function filesLockedByOtherUser(siteName?: string) {
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C297664]', async () => {
|
||||
@ -321,7 +248,7 @@ describe('', () => {
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Shared Files - [C297665]', async () => {
|
||||
@ -332,7 +259,7 @@ describe('', () => {
|
||||
// TODO: remove 'Upload New Version' when ACA-2173 is done
|
||||
const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
|
||||
await testUtil.checkToolbarActions(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Favorites - [C297666]', async () => {
|
||||
@ -343,21 +270,21 @@ describe('', () => {
|
||||
// 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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('on Search Results - [C297667]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(fileLocked);
|
||||
await searchInput.searchFor(testData.fileLockedByUser);
|
||||
await searchResultsPage.waitForResults();
|
||||
|
||||
const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
|
||||
await testUtil.checkToolbarActions(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
describe('in the viewer', () => {
|
||||
describe('available actions in the viewer : ', () => {
|
||||
it('file opened from File Libraries - [C297671]', async () => {
|
||||
await page.clickFileLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
@ -366,7 +293,7 @@ describe('', () => {
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Shared Files - [C297672]', async () => {
|
||||
@ -375,7 +302,7 @@ describe('', () => {
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Favorites - [C297673]', async () => {
|
||||
@ -384,12 +311,12 @@ describe('', () => {
|
||||
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(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
||||
it('file opened from Search Results - [C306994]', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(fileLocked);
|
||||
await searchInput.searchFor(testData.fileLockedByUser);
|
||||
await searchResultsPage.waitForResults();
|
||||
|
||||
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
||||
@ -397,8 +324,8 @@ describe('', () => {
|
||||
// TODO: add 'Delete' when ACA-2319 is fixed
|
||||
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
|
||||
await testUtil.checkViewerActions(fileLocked, expectedToolbarPrimary, expectedToolbarMore);
|
||||
await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
@ -1,191 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage } from '../../../pages/pages';
|
||||
import { FILES, SITE_ROLES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('Special permissions actions : on Favorites : ', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
const site = `site-private-${random}`;
|
||||
|
||||
const userConsumer = `consumer-${random}`;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
let folderFavId: string;
|
||||
let folderFav2Id: string;
|
||||
|
||||
const file3 = `file-3-${random}.txt`;
|
||||
let file3Id: string;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const userApi = new RepoClient(userConsumer, userConsumer);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username: userConsumer });
|
||||
|
||||
await adminApiActions.sites.createSitePrivate(site);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(site);
|
||||
await adminApiActions.sites.addSiteConsumer(site, userConsumer);
|
||||
|
||||
fileDocxFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id;
|
||||
fileFavId = (await adminApiActions.nodes.createFile(data.fileFav.name, docLibId)).entry.id;
|
||||
fileDocxSharedFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedFavId = (await adminApiActions.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
|
||||
fileFavLockedId = (await adminApiActions.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id;
|
||||
fileSharedFavLockedId = (await adminApiActions.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
|
||||
|
||||
file3Id = (await adminApiActions.nodes.createFile(file3, docLibId)).entry.id;
|
||||
|
||||
folderFavId = (await adminApiActions.nodes.createFolder(data.folderFav.name, docLibId)).entry.id;
|
||||
folderFav2Id = (await adminApiActions.nodes.createFolder(data.folderFav2.name, docLibId)).entry.id;
|
||||
await userApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId,
|
||||
file3Id
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileSharedFavLockedId,
|
||||
file3Id
|
||||
]);
|
||||
|
||||
await adminApiActions.nodes.lockFile(fileFavLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await adminApiActions.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 9 }),
|
||||
userApi.shared.waitForApi({ expect: 4 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(userConsumer);
|
||||
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adminApiActions.sites.deleteSite(site);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary, data.fileDocxFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFav.name, data.fileFav.toolbarPrimary, data.fileFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarPrimary, data.fileDocxSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarPrimary, data.fileSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary, data.fileFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarPrimary, data.fileSharedFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folderFav.name, data.folderFav.toolbarPrimary, data.folderFav.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
it('multiple files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, file3 ], data.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileFav.name, file3 ], data.multipleSelAllFav.toolbarPrimary, data.multipleSelAllFav.favoritesToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
@ -1,249 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage } from '../../../pages/pages';
|
||||
import { FILES, SITE_ROLES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('Special permissions actions : on File Libraries : ', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
const site = `site-private-${random}`;
|
||||
|
||||
const userConsumer = `consumer-${random}`;
|
||||
|
||||
const file3 = `file-3-${random}.txt`;
|
||||
let file3Id: string;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
let folderFavId: string;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const userApi = new RepoClient(userConsumer, userConsumer);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username: userConsumer });
|
||||
|
||||
await adminApiActions.sites.createSitePrivate(site);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(site);
|
||||
await adminApiActions.sites.addSiteConsumer(site, userConsumer);
|
||||
|
||||
await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name );
|
||||
fileDocxFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id;
|
||||
await adminApiActions.nodes.createFile(data.file.name, docLibId);
|
||||
fileFavId = (await adminApiActions.nodes.createFile(data.fileFav.name, docLibId)).entry.id;
|
||||
fileDocxSharedId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await adminApiActions.nodes.createFile(data.fileShared.name, docLibId)).entry.id;
|
||||
fileSharedFavId = (await adminApiActions.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
|
||||
fileLockedId = (await adminApiActions.nodes.createFile(data.fileLocked.name, docLibId)).entry.id;
|
||||
fileFavLockedId = (await adminApiActions.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id;
|
||||
fileSharedLockedId = (await adminApiActions.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id;
|
||||
fileSharedFavLockedId = (await adminApiActions.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
|
||||
|
||||
file3Id = (await adminApiActions.nodes.createFile(file3, docLibId)).entry.id;
|
||||
|
||||
await adminApiActions.nodes.createFolder(data.folder.name, docLibId);
|
||||
folderFavId = (await adminApiActions.nodes.createFolder(data.folderFav.name, docLibId)).entry.id;
|
||||
|
||||
await userApi.favorites.addFavoriteById('folder', folderFavId);
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId,
|
||||
file3Id
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId,
|
||||
file3Id
|
||||
]);
|
||||
|
||||
await adminApiActions.nodes.lockFile(fileLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileFavLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileSharedLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await adminApiActions.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 8 }),
|
||||
userApi.shared.waitForApi({ expect: 7 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(userConsumer);
|
||||
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(site);
|
||||
await dataTable.waitForHeader();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adminApiActions.sites.deleteSite(site);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocx.name, data.fileDocx.toolbarPrimary, data.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary, data.fileDocxFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.file.name, data.file.toolbarPrimary, data.file.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.file.name, data.file.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFav.name, data.fileFav.toolbarPrimary, data.fileFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary, data.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary, data.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileShared.name, data.fileShared.toolbarPrimary, data.fileShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary, data.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileLocked.name, data.fileLocked.toolbarPrimary, data.fileLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary, data.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary, data.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary, data.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
it('Folder not favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folder.name, data.folder.toolbarPrimary, data.folder.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu);
|
||||
});
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folderFav.name, data.folderFav.toolbarPrimary, data.folderFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
it('multiple files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple folders - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folder.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folder.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.file.name, data.folder.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, file3 ], data.multipleSel.toolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
@ -1,279 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { FILES, SITE_ROLES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('Special permissions actions : on Search Results : ', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
const site = `site-private-${random}`;
|
||||
|
||||
const userConsumer = `consumer-${random}`;
|
||||
|
||||
const file3 = `file-3-${random}.txt`;
|
||||
let file3Id: string;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
let folderFavId: string;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const userApi = new RepoClient(userConsumer, userConsumer);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { searchInput } = page.header;
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username: userConsumer });
|
||||
|
||||
await adminApiActions.sites.createSitePrivate(site);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(site);
|
||||
await adminApiActions.sites.addSiteConsumer(site, userConsumer);
|
||||
|
||||
await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name );
|
||||
fileDocxFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id;
|
||||
await adminApiActions.nodes.createFile(data.file.name, docLibId);
|
||||
fileFavId = (await adminApiActions.nodes.createFile(data.fileFav.name, docLibId)).entry.id;
|
||||
fileDocxSharedId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await adminApiActions.nodes.createFile(data.fileShared.name, docLibId)).entry.id;
|
||||
fileSharedFavId = (await adminApiActions.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
|
||||
fileLockedId = (await adminApiActions.nodes.createFile(data.fileLocked.name, docLibId)).entry.id;
|
||||
fileFavLockedId = (await adminApiActions.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id;
|
||||
fileSharedLockedId = (await adminApiActions.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id;
|
||||
fileSharedFavLockedId = (await adminApiActions.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
|
||||
|
||||
file3Id = (await adminApiActions.nodes.createFile(file3, docLibId)).entry.id;
|
||||
|
||||
await adminApiActions.nodes.createFolder(data.folder.name, docLibId);
|
||||
folderFavId = (await adminApiActions.nodes.createFolder(data.folderFav.name, docLibId)).entry.id;
|
||||
await userApi.favorites.addFavoriteById('folder', folderFavId);
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId,
|
||||
file3Id
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId,
|
||||
file3Id
|
||||
]);
|
||||
|
||||
await adminApiActions.nodes.lockFile(fileLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileFavLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileSharedLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await adminApiActions.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 8 }),
|
||||
userApi.shared.waitForApi({ expect: 7 }),
|
||||
userApi.search.waitForApi(userConsumer, { expect: 13 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(userConsumer);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adminApiActions.sites.deleteSite(site);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocx.name, data.fileDocx.searchToolbarPrimary, data.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxFav.name, data.fileDocxFav.searchToolbarPrimary, data.fileDocxFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.file.name, data.file.searchToolbarPrimary, data.file.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.file.name, data.file.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFav.name, data.fileFav.searchToolbarPrimary, data.fileFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxShared.name, data.fileDocxShared.searchToolbarPrimary, data.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchToolbarPrimary, data.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileShared.name, data.fileShared.searchToolbarPrimary, data.fileShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.searchToolbarPrimary, data.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileLocked.name, data.fileLocked.searchToolbarPrimary, data.fileLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileFavLocked.name, data.fileFavLocked.searchToolbarPrimary, data.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedLocked.name, data.fileSharedLocked.searchToolbarPrimary, data.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchToolbarPrimary, data.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('Folder not favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folder.name, data.folder.searchToolbarPrimary, data.folder.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu);
|
||||
});
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.folderFav.name, data.folderFav.searchToolbarPrimary, data.folderFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
describe('of files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('multiple files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.file.name, data.fileDocxShared.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchToolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSel.searchToolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchToolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileDocxFav.name, file3 ], data.multipleSel.searchToolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
it('multiple folders - []', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ data.folder.name, data.folderFav.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.folder.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - []', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(`=${data.file.name} or =${data.folderFav.name}`);
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folderFav.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.file.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
@ -1,173 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage } from '../../../pages/pages';
|
||||
import { FILES, SITE_ROLES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as data from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('Special permissions actions : on Shared Files : ', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
const site = `site-private-${random}`;
|
||||
|
||||
const userConsumer = `consumer-${random}`;
|
||||
|
||||
const file3 = `file-3-${random}.txt`;
|
||||
let file3Id: string;
|
||||
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const userApi = new RepoClient(userConsumer, userConsumer);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username: userConsumer });
|
||||
|
||||
await adminApiActions.sites.createSitePrivate(site);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(site);
|
||||
await adminApiActions.sites.addSiteConsumer(site, userConsumer);
|
||||
|
||||
fileDocxSharedId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await adminApiActions.nodes.createFile(data.fileShared.name, docLibId)).entry.id;
|
||||
fileSharedFavId = (await adminApiActions.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
|
||||
fileSharedLockedId = (await adminApiActions.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id;
|
||||
fileSharedFavLockedId = (await adminApiActions.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
|
||||
|
||||
file3Id = (await adminApiActions.nodes.createFile(file3, docLibId)).entry.id;
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileSharedFavLockedId,
|
||||
file3Id
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId,
|
||||
file3Id
|
||||
]);
|
||||
|
||||
await adminApiActions.nodes.lockFile(fileSharedLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await adminApiActions.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 4 }),
|
||||
userApi.shared.waitForApi({ expect: 7 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(userConsumer);
|
||||
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adminApiActions.sites.deleteSite(site);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('single selection', () => {
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary, data.fileDocxShared.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary, data.fileDocxSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileShared.name, data.fileShared.toolbarPrimary, data.fileShared.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary, data.fileSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary, data.fileSharedLocked.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary, data.fileSharedFavLocked.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('multiple selection', () => {
|
||||
it('multiple files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary, data.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, file3 ], data.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ data.fileSharedFav.name, file3 ], data.multipleSel.toolbarPrimary, data.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
@ -1,301 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { FILES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as data from './test-data-permissions';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
describe('Special permissions actions : in the Viewer : ', () => {
|
||||
|
||||
const random = Utils.random();
|
||||
|
||||
const site = `site-private-${random}`;
|
||||
|
||||
const userConsumer = `consumer-${random}`;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const userApi = new RepoClient(userConsumer, userConsumer);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { dataTable } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username: userConsumer });
|
||||
|
||||
await adminApiActions.sites.createSitePrivate(site);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(site);
|
||||
await adminApiActions.sites.addSiteConsumer(site, userConsumer);
|
||||
|
||||
await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name );
|
||||
fileDocxFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id;
|
||||
await adminApiActions.nodes.createFile(data.file.name, docLibId);
|
||||
fileFavId = (await adminApiActions.nodes.createFile(data.fileFav.name, docLibId)).entry.id;
|
||||
fileDocxSharedId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await adminApiActions.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await adminApiActions.nodes.createFile(data.fileShared.name, docLibId)).entry.id;
|
||||
fileSharedFavId = (await adminApiActions.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
|
||||
fileLockedId = (await adminApiActions.nodes.createFile(data.fileLocked.name, docLibId)).entry.id;
|
||||
fileFavLockedId = (await adminApiActions.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id;
|
||||
fileSharedLockedId = (await adminApiActions.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id;
|
||||
fileSharedFavLockedId = (await adminApiActions.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await userApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId
|
||||
]);
|
||||
|
||||
await adminApiActions.nodes.lockFile(fileLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileFavLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileSharedLockedId);
|
||||
await adminApiActions.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 6 }),
|
||||
userApi.shared.waitForApi({ expect: 6 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(userConsumer);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adminApiActions.sites.deleteSite(site);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('file opened from File Libraries', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(site);
|
||||
await dataTable.waitForHeader();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary, data.fileDocx.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary, data.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(data.file.name, data.file.viewerToolbarPrimary, data.file.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary, data.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary, data.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary, data.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary, data.fileLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary, data.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary, data.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Favorites', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary, data.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary, data.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary, data.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Shared Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary, data.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary, data.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary, data.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Search Results', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary, data.fileDocx.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary, data.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(data.file.name, data.file.viewerToolbarPrimary, data.file.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary, data.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary, data.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary, data.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary, data.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary, data.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary, data.fileLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary, data.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary, data.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary, data.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
});
|
||||
});
|
190
e2e/suites/actions-available/special-permissions/search-results.ts
Executable file
190
e2e/suites/actions-available/special-permissions/search-results.ts
Executable file
@ -0,0 +1,190 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function searchResultsTests() {
|
||||
const page = new BrowsingPage();
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { searchInput } = page.header;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.searchToolbarPrimary, testData.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.searchToolbarPrimary, testData.fileDocxFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.file.name, testData.file.searchToolbarPrimary, testData.file.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.file.name, testData.file.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.searchToolbarPrimary, testData.fileFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.searchToolbarPrimary, testData.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchToolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.searchToolbarPrimary, testData.fileShared.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.searchToolbarPrimary, testData.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.searchToolbarPrimary, testData.fileLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.searchToolbarPrimary, testData.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.searchToolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.searchToolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('Folder not favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folder.name, testData.folder.searchToolbarPrimary, testData.folder.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folder.name, testData.folder.contextMenu);
|
||||
});
|
||||
|
||||
it('Folder favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.searchToolbarPrimary, testData.folderFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.contextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
describe('of files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('multiple files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSel.searchToolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
});
|
||||
|
||||
it('multiple folders - []', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('both files and folders - []', async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(`=${testData.file.name} or =${testData.folderFav.name}`);
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folderFav.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
107
e2e/suites/actions-available/special-permissions/shared-files.ts
Executable file
107
e2e/suites/actions-available/special-permissions/shared-files.ts
Executable file
@ -0,0 +1,107 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function sharedFilesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('single selection', () => {
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.sharedToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.sharedContextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('multiple selection', () => {
|
||||
|
||||
it('multiple files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileShared.name, testData.fileSharedFav.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileShared.name, testData.fileSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple locked files - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileSharedLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - []', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileSharedFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedFav.name, testData.fileGranularPermission ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { LoginPage } from '../../../pages/pages';
|
||||
import { FILES, SITE_ROLES } from '../../../configs';
|
||||
import { RepoClient } from '../../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import { AdminActions } from '../../../utilities/admin-actions';
|
||||
import * as testData from './test-data-permissions';
|
||||
import { librariesTests } from './my-libraries';
|
||||
import { favoritesTests } from './favorites';
|
||||
import { searchResultsTests } from './search-results';
|
||||
import { viewerTests } from './viewer';
|
||||
import { sharedFilesTests } from './shared-files';
|
||||
import { collaboratorTests, filesLockedByCurrentUser, filesLockedByOtherUser } from './other-permissions';
|
||||
|
||||
describe('Special permissions : ', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
const sitePrivate = `site-private-${random}`;
|
||||
|
||||
const userManager = `manager-${random}`;
|
||||
const userConsumer = `consumer-${random}`;
|
||||
const userCollaborator = `collaborator-${random}`;
|
||||
const userDemoted = `demoted-${random}`;
|
||||
|
||||
let fileDocxFavId: string;
|
||||
let fileFavId: string;
|
||||
let fileDocxSharedId: string;
|
||||
let fileDocxSharedFavId: string;
|
||||
let fileSharedId: string;
|
||||
let fileSharedFavId: string;
|
||||
let fileLockedId: string;
|
||||
let fileFavLockedId: string;
|
||||
let fileSharedLockedId: string;
|
||||
let fileSharedFavLockedId: string;
|
||||
let fileGranularPermissionId: string;
|
||||
let fileLockedByUserId: string;
|
||||
let folderFavId: string;
|
||||
let folderFav2Id: string;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
const userManagerApi = new RepoClient(userManager, userManager);
|
||||
const userConsumerApi = new RepoClient(userConsumer, userConsumer);
|
||||
const userCollaboratorApi = new RepoClient(userCollaborator, userCollaborator);
|
||||
const userDemotedApi = new RepoClient(userDemoted, userDemoted);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username: userManager });
|
||||
await adminApiActions.createUser({ username: userConsumer });
|
||||
await adminApiActions.createUser({ username: userCollaborator });
|
||||
await adminApiActions.createUser({ username: userDemoted });
|
||||
|
||||
await userManagerApi.sites.createSitePrivate(sitePrivate);
|
||||
const docLibId = await userManagerApi.sites.getDocLibId(sitePrivate);
|
||||
await userManagerApi.sites.addSiteConsumer(sitePrivate, userConsumer);
|
||||
await userManagerApi.sites.addSiteCollaborator(sitePrivate, userCollaborator);
|
||||
await userManagerApi.sites.addSiteManager(sitePrivate, userDemoted);
|
||||
|
||||
await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocx.name );
|
||||
fileDocxFavId = (await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocxFav.name)).entry.id;
|
||||
await userManagerApi.nodes.createFile(testData.file.name, docLibId);
|
||||
fileFavId = (await userManagerApi.nodes.createFile(testData.fileFav.name, docLibId)).entry.id;
|
||||
fileDocxSharedId = (await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocxShared.name)).entry.id;
|
||||
fileDocxSharedFavId = (await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocxSharedFav.name)).entry.id;
|
||||
fileSharedId = (await userManagerApi.nodes.createFile(testData.fileShared.name, docLibId)).entry.id;
|
||||
fileSharedFavId = (await userManagerApi.nodes.createFile(testData.fileSharedFav.name, docLibId)).entry.id;
|
||||
fileLockedId = (await userManagerApi.nodes.createFile(testData.fileLocked.name, docLibId)).entry.id;
|
||||
fileFavLockedId = (await userManagerApi.nodes.createFile(testData.fileFavLocked.name, docLibId)).entry.id;
|
||||
fileSharedLockedId = (await userManagerApi.nodes.createFile(testData.fileSharedLocked.name, docLibId)).entry.id;
|
||||
fileSharedFavLockedId = (await userManagerApi.nodes.createFile(testData.fileSharedFavLocked.name, docLibId)).entry.id;
|
||||
fileGranularPermissionId = (await userManagerApi.nodes.createFile(testData.fileGranularPermission, docLibId)).entry.id;
|
||||
|
||||
fileLockedByUserId = (await userManagerApi.nodes.createFile(testData.fileLockedByUser, docLibId)).entry.id;
|
||||
await userDemotedApi.nodes.lockFile(fileLockedByUserId);
|
||||
await userDemotedApi.favorites.addFavoriteById('file', fileLockedByUserId);
|
||||
await userDemotedApi.shared.shareFileById(fileLockedByUserId);
|
||||
await userManagerApi.sites.updateSiteMember(sitePrivate, userDemoted, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
await userManagerApi.nodes.createFolder(testData.folder.name, docLibId);
|
||||
folderFavId = (await userManagerApi.nodes.createFolder(testData.folderFav.name, docLibId)).entry.id;
|
||||
folderFav2Id = (await userManagerApi.nodes.createFolder(testData.folderFav2.name, docLibId)).entry.id;
|
||||
await userConsumerApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
|
||||
|
||||
await userConsumerApi.favorites.addFavoritesByIds('file', [
|
||||
fileDocxFavId,
|
||||
fileFavId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedFavId,
|
||||
fileFavLockedId,
|
||||
fileSharedFavLockedId,
|
||||
fileGranularPermissionId
|
||||
]);
|
||||
|
||||
await userConsumerApi.shared.shareFilesByIds([
|
||||
fileDocxSharedId,
|
||||
fileDocxSharedFavId,
|
||||
fileSharedId,
|
||||
fileSharedFavId,
|
||||
fileSharedLockedId,
|
||||
fileSharedFavLockedId,
|
||||
fileGranularPermissionId
|
||||
]);
|
||||
|
||||
await userCollaboratorApi.favorites.addFavoritesByIds('file', [fileDocxSharedFavId, fileSharedFavId]);
|
||||
|
||||
await userManagerApi.nodes.lockFile(fileLockedId);
|
||||
await userManagerApi.nodes.lockFile(fileFavLockedId);
|
||||
await userManagerApi.nodes.lockFile(fileSharedLockedId);
|
||||
await userManagerApi.nodes.lockFile(fileSharedFavLockedId);
|
||||
|
||||
await userManagerApi.nodes.setGranularPermission(fileGranularPermissionId, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
await userManagerApi.favorites.addFavoriteById('file', fileLockedByUserId);
|
||||
|
||||
await Promise.all([
|
||||
userConsumerApi.favorites.waitForApi({ expect: 9 }),
|
||||
userConsumerApi.shared.waitForApi({ expect: 8 }),
|
||||
userManagerApi.search.waitForApi(userManager, { expect: 14 }),
|
||||
userCollaboratorApi.favorites.waitForApi({ expect: 2 })
|
||||
]);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userManagerApi.sites.deleteSite(sitePrivate);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
describe('Consumer', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(userConsumer);
|
||||
});
|
||||
|
||||
describe('on File Libraries', () => {
|
||||
librariesTests(sitePrivate);
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
favoritesTests();
|
||||
});
|
||||
|
||||
describe('on Search Results', () => {
|
||||
searchResultsTests();
|
||||
});
|
||||
|
||||
describe('on Viewer', () => {
|
||||
viewerTests(sitePrivate);
|
||||
});
|
||||
|
||||
describe('on Shared Files', () => {
|
||||
sharedFilesTests();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Collaborator', () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(userCollaborator);
|
||||
});
|
||||
|
||||
collaboratorTests(sitePrivate);
|
||||
});
|
||||
|
||||
describe('File locked - user is lock owner', () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(userDemoted);
|
||||
});
|
||||
|
||||
filesLockedByCurrentUser(sitePrivate);
|
||||
});
|
||||
|
||||
describe('File locked by other user - user is manager', () => {
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(userManager);
|
||||
});
|
||||
|
||||
filesLockedByOtherUser(sitePrivate);
|
||||
});
|
||||
});
|
@ -270,6 +270,9 @@ export const fileSharedFavLocked = {
|
||||
searchToolbarPrimary: searchConsumerSharedToolbarPrimary
|
||||
};
|
||||
|
||||
export const fileGranularPermission = `file-granular-${Utils.random()}.txt`;
|
||||
export const fileLockedByUser = `my-file-locked-${Utils.random()}.txt`;
|
||||
|
||||
// ---- folders ---
|
||||
|
||||
const consumerFolderContextMenu = ['Download', 'Favorite', 'Copy'];
|
||||
|
227
e2e/suites/actions-available/special-permissions/viewer.ts
Executable file
227
e2e/suites/actions-available/special-permissions/viewer.ts
Executable file
@ -0,0 +1,227 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* 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 { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
|
||||
import { Utils } from '../../../utilities/utils';
|
||||
import * as testData from './test-data-permissions';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
export function viewerTests(siteName?: string) {
|
||||
const page = new BrowsingPage();
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { dataTable } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.closeOpenDialogs();
|
||||
});
|
||||
|
||||
describe('file opened from File Libraries', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('file opened from Favorites', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('file opened from Shared Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('file opened from Search Results', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('file-');
|
||||
await searchResultsPage.waitForResults();
|
||||
});
|
||||
|
||||
it('File Office - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File simple - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - []', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
@ -90,16 +90,6 @@ export async function checkMultipleSelToolbarPrimary(items: string[], expectedTo
|
||||
expect(actualPrimaryActions).toEqual(expectedToolbarPrimary);
|
||||
}
|
||||
|
||||
export async function checkMultipleSelToolbarMoreActions(items: string[], expectedToolbarMore: string[]): Promise<void> {
|
||||
await dataTable.selectMultipleItems(items);
|
||||
await toolbar.openMoreMenu();
|
||||
|
||||
const actualMoreActions = await toolbar.menu.getMenuItems();
|
||||
expect(actualMoreActions).toEqual(expectedToolbarMore);
|
||||
|
||||
await toolbar.closeMoreMenu();
|
||||
}
|
||||
|
||||
export async function checkMultipleSelToolbarActions(items: string[], expectedToolbarPrimary: string[], expectedToolbarMore: string[]): Promise<void> {
|
||||
await dataTable.selectMultipleItems(items);
|
||||
|
||||
@ -114,31 +104,6 @@ export async function checkMultipleSelToolbarActions(items: string[], expectedTo
|
||||
await toolbar.closeMoreMenu();
|
||||
}
|
||||
|
||||
export async function checkViewerToolbarPrimaryActions(item: string, expectedToolbarPrimary: string[]): Promise<void> {
|
||||
await dataTable.selectItem(item);
|
||||
await toolbar.clickView();
|
||||
await viewer.waitForViewerToOpen();
|
||||
|
||||
let actualPrimaryActions = await viewerToolbar.getButtons();
|
||||
actualPrimaryActions = removeClosePreviousNextOldInfo(actualPrimaryActions);
|
||||
expect(actualPrimaryActions).toEqual(expectedToolbarPrimary);
|
||||
|
||||
await Utils.pressEscape();
|
||||
}
|
||||
|
||||
export async function checkViewerToolbarMoreActions(item: string, expectedToolbarMore: string[]): Promise<void> {
|
||||
await dataTable.selectItem(item);
|
||||
await toolbar.clickView();
|
||||
await viewer.waitForViewerToOpen();
|
||||
await viewerToolbar.openMoreMenu();
|
||||
|
||||
const actualMoreActions = await viewerToolbar.menu.getMenuItems();
|
||||
expect(actualMoreActions).toEqual(expectedToolbarMore);
|
||||
|
||||
await toolbar.closeMoreMenu();
|
||||
await Utils.pressEscape();
|
||||
}
|
||||
|
||||
export async function checkViewerActions(item: string, expectedToolbarPrimary: string[], expectedToolbarMore: string[]): Promise<void> {
|
||||
await dataTable.selectItem(item);
|
||||
await toolbar.clickView();
|
||||
|
@ -31,6 +31,7 @@ import { SitesApi } from './repo-client/apis/sites/sites-api';
|
||||
import { UploadApi } from './repo-client/apis/upload/upload-api';
|
||||
import { NodesApi } from './repo-client/apis/nodes/nodes-api';
|
||||
import { FavoritesApi } from './repo-client/apis/favorites/favorites-api';
|
||||
import { SearchApi } from './repo-client/apis/search/search-api';
|
||||
|
||||
export class AdminActions {
|
||||
private adminApi: RepoClient;
|
||||
@ -43,6 +44,7 @@ export class AdminActions {
|
||||
upload: UploadApi = new UploadApi();
|
||||
nodes: NodesApi = new NodesApi();
|
||||
favorites: FavoritesApi = new FavoritesApi();
|
||||
search: SearchApi = new SearchApi();
|
||||
|
||||
async getDataDictionaryId(): Promise<string> {
|
||||
return await this.adminApi.nodes.getNodeIdFromParent('Data Dictionary', '-root-');
|
||||
|
Loading…
x
Reference in New Issue
Block a user