increase default timeout due possible slow env (#1812)

* increase default timeout due possible slow env

* parallel test can affect this check

* unused call

* remove

* reduce size test lib

* fix search test

* remove log

* build

* reorganize file actionsAvailable tests

* fix

* fix

* Update single-file-actions.test.ts

* Update single-file-actions.test.ts

* fix viewer actions from search results tests

* fix snackbar actions tests

* forgot console.log

* exclude

Co-authored-by: Adina Parpalita <Adina.Parpalita@ness.com>
This commit is contained in:
Eugenio Romano
2020-11-23 10:35:28 +00:00
committed by GitHub
parent 092d430470
commit 8186ee16ac
31 changed files with 1979 additions and 1577 deletions

View File

@@ -154,3 +154,4 @@ notifications:
- 'Repo `%{repository_slug}` *%{result}* build (<%{build_url}|#%{build_number}>) for commit (<%{compare_url}|%{commit}>) on branch `%{branch}`.'
- 'Author: %{author} Execution time: *%{duration}*'
- 'Message: %{message}'

View File

@@ -34,11 +34,7 @@
"C280504" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280324" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280514" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280524" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280526" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280525" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C217181" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C217178" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C217179" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C280537" : "https://alfresco.atlassian.net/browse/ACA-4165"
"C286663" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C297570" : "https://alfresco.atlassian.net/browse/ACA-4165",
"C306999" : "https://alfresco.atlassian.net/browse/ACA-4165"
}

View File

@@ -1,144 +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 { Utils, BrowsingPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
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();
});
describe('on a file', () => {
it('File Office, favorite - [C297618]', 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 - [C280461]', 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 - [C297620]', 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 - [C280462]', 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 - [C280463]', 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 - [C280469]', 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 - [C291817]', 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
);
});
});
});
}

View File

@@ -1,170 +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 { RepoClient, Utils, AdminActions, UserActions, LoginPage, FILES } from '@alfresco/aca-testing-shared';
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 userActions = new UserActions();
const loginPage = new LoginPage();
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
const initialSearchTotalItems = await userApi.search.getTotalItems(username);
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.search.waitForApi(username, { expect: initialSearchTotalItems + 12 });
const initialFavoritesTotalItems = (await userApi.favorites.getFavoritesTotalItems()) || 0;
await userApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
await userApi.favorites.addFavoritesByIds('file', [
fileDocxFavId,
fileFavId,
fileDocxSharedFavId,
fileSharedFavId,
fileFavLockedId,
fileSharedFavLockedId
]);
await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 8 });
const initialSharedTotalItems = await userApi.shared.getSharedLinksTotalItems();
await userApi.shared.shareFilesByIds([
fileDocxSharedId,
fileDocxSharedFavId,
fileSharedId,
fileSharedFavId,
fileSharedLockedId,
fileSharedFavLockedId
]);
await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 6 });
await userApi.nodes.lockFile(fileLockedId);
await userApi.nodes.lockFile(fileFavLockedId);
await userApi.nodes.lockFile(fileSharedLockedId);
await userApi.nodes.lockFile(fileSharedFavLockedId);
await loginPage.loginWith(username);
}, 300000);
afterAll(async () => {
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
});
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 : ', () => {
beforeAll(async () => {
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;
const initialDeletedTotalItems = await userActions.getTrashcanSize();
await userActions.deleteNodes([fileInTrashId, file2InTrashId, folderInTrashId, folder2InTrashId], false);
await userActions.waitForTrashcanSize(initialDeletedTotalItems + 4);
});
trashTests();
});
});

View File

@@ -0,0 +1,197 @@
/*!
* @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, Utils, AdminActions, UserActions, LoginPage, SearchResultsPage, BrowsingPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';
describe('Folders - available actions : ', () => {
const random = Utils.random();
const username = `user-${random}`;
const parentName = `parent-${random}`;
let parentId: string;
let folderFavId: string;
let folderFav2Id: string;
let fileFavId: string;
const userApi = new RepoClient(username, username);
const adminApiActions = new AdminActions();
const userActions = new UserActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable } = page;
const { searchInput } = page.header;
const searchResultsPage = new SearchResultsPage();
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
parentId = (await userApi.nodes.createFolder(parentName)).entry.id;
await userApi.nodes.createFile(testData.file.name, parentId);
fileFavId = (await userApi.nodes.createFile(testData.fileFav.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;
const initialFavoritesTotalItems = (await userApi.favorites.getFavoritesTotalItems()) || 0;
await userApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
await userApi.favorites.addFavoritesByIds('file', [fileFavId]);
await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 3 });
await loginPage.loginWith(username);
});
afterAll(async () => {
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
});
beforeEach(async () => {
await Utils.pressEscape();
});
describe('on Personal Files : ', () => {
beforeAll(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentName);
await dataTable.waitForHeader();
});
it('Folder not favorite - [C213123]', 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 - [C280451]', async () => {
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.toolbarMore);
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.contextMenu);
});
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
);
});
});
describe('on Favorites Files : ', () => {
beforeAll(async () => {
await page.clickFavoritesAndWait();
});
it('Folder favorite - [C291817]', async () => {
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.favoritesToolbarMore);
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.favoritesContextMenu);
});
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
);
});
});
describe('on Search Results : ', () => {
describe('on a folder', () => {
beforeAll(async () => {
await page.clickPersonalFiles();
await searchInput.clickSearchButton();
await searchInput.searchFor('folderActions-');
await searchResultsPage.waitForResults();
});
it('[C280609] 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('[C291828] 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', () => {
it('[C291821] multiple folders', async () => {
await searchInput.clickSearchButton();
await searchInput.searchFor('folderActions-');
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('[C291822] both files and folders', 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
);
});
});
});
});

View File

@@ -0,0 +1,470 @@
/*!
* @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, Utils, AdminActions, UserActions, LoginPage, BrowsingPage, SearchResultsPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';
describe('Locked Files - available actions : ', () => {
const random = Utils.random();
const username = `user-${random}`;
const parentName = `parent-${random}`;
let parentId: string;
let fileLockedId: string;
let fileFavLockedId: string;
let fileSharedLockedId: string;
let fileSharedFavLockedId: string;
const userApi = new RepoClient(username, username);
const adminApiActions = new AdminActions();
const userActions = new UserActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable } = page;
const { searchInput } = page.header;
const searchResultsPage = new SearchResultsPage();
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
parentId = (await userApi.nodes.createFolder(parentName)).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;
const initialFavoritesTotalItems = (await userApi.favorites.getFavoritesTotalItems()) || 0;
await userApi.favorites.addFavoritesByIds('file', [fileFavLockedId, fileSharedFavLockedId]);
await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 2 });
const initialSharedTotalItems = await userApi.shared.getSharedLinksTotalItems();
await userApi.shared.shareFilesByIds([fileSharedLockedId, fileSharedFavLockedId]);
await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 2 });
await userApi.nodes.lockFile(fileLockedId);
await userApi.nodes.lockFile(fileFavLockedId);
await userApi.nodes.lockFile(fileSharedLockedId);
await userApi.nodes.lockFile(fileSharedFavLockedId);
await loginPage.loginWith(username);
});
afterAll(async () => {
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
});
beforeEach(async () => {
await Utils.pressEscape();
});
describe('on Personal Files : ', () => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentName);
await dataTable.waitForHeader();
});
describe('single selection : ', () => {
it('File locked - [C297617]', 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 - [C291816]', 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 - [C280453]', 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 - [C280454]', async () => {
await testUtil.checkToolbarActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.toolbarPrimary,
testData.fileSharedFavLocked.toolbarMore
);
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
});
});
// describe('multiple selection : ', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// it('multiple locked files - [C326688]', 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
// );
// });
// });
describe('Viewer - file opened from Personal Files : ', () => {
it('File locked - [C291832]', async () => {
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
});
it('File favorite, locked - [C297593]', async () => {
await testUtil.checkViewerActions(
testData.fileFavLocked.name,
testData.fileFavLocked.viewerToolbarPrimary,
testData.fileFavLocked.viewerToolbarMore
);
});
it('File shared, locked - [C291833]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedLocked.name,
testData.fileSharedLocked.viewerToolbarPrimary,
testData.fileSharedLocked.viewerToolbarMore
);
});
it('File shared, favorite, locked - [C297592]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.viewerToolbarPrimary,
testData.fileSharedFavLocked.viewerToolbarMore
);
});
});
});
describe('on Favorites : ', () => {
beforeEach(async () => {
await page.clickFavoritesAndWait();
});
describe('single selection : ', () => {
it('File favorite, locked - [C280463]', 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 - [C280469]', async () => {
await testUtil.checkToolbarActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.favoritesToolbarPrimary,
testData.fileSharedFavLocked.favoritesToolbarMore
);
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu);
});
});
// describe('multiple selection : ', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// 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
// );
// });
// });
describe('Viewer - file opened from Favorites : ', () => {
it('File favorite, locked - [C326707]', async () => {
await testUtil.checkViewerActions(
testData.fileFavLocked.name,
testData.fileFavLocked.viewerToolbarPrimary,
testData.fileFavLocked.viewerToolbarMore
);
});
it('File shared, favorite, locked - [C326706]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.viewerToolbarPrimary,
testData.fileSharedFavLocked.viewerToolbarMore
);
});
});
});
describe('on Recent Files : ', () => {
beforeEach(async () => {
await page.clickRecentFilesAndWait();
});
describe('single selection : ', () => {
it('File locked - [C280622]', 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 - [C280608]', 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 - [C297636]', 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 - [C286324]', async () => {
await testUtil.checkToolbarActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.toolbarPrimary,
testData.fileSharedFavLocked.toolbarMore
);
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
});
});
// describe('multiple selection : ', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// 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
// );
// });
// });
describe('Viewer - file opened from Recent Files : ', () => {
it('File locked - [C326698]', async () => {
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
});
it('File favorite, locked - [C326701]', async () => {
await testUtil.checkViewerActions(
testData.fileFavLocked.name,
testData.fileFavLocked.viewerToolbarPrimary,
testData.fileFavLocked.viewerToolbarMore
);
});
it('File shared, locked - [C326699]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedLocked.name,
testData.fileSharedLocked.viewerToolbarPrimary,
testData.fileSharedLocked.viewerToolbarMore
);
});
it('File shared, favorite, locked - [C326700]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.viewerToolbarPrimary,
testData.fileSharedFavLocked.viewerToolbarMore
);
});
});
});
describe('on Search Results : ', () => {
beforeEach(async () => {
await page.clickPersonalFiles();
await searchInput.clickSearchButton();
await searchInput.searchFor('fileActions-');
await searchResultsPage.waitForResults();
});
describe('single selection : ', () => {
it('[C297628] 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('[C280648] 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('[C280574] 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('[C280642] 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('multiple selection : ', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// it('[C297626] multiple locked files', 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
// );
// });
// });
describe('Viewer - file opened from Search Results : ', () => {
it('File locked - [C326722]', async () => {
await testUtil.checkViewerActions(
testData.fileLocked.name,
testData.fileLocked.viewerToolbarPrimary,
testData.fileLocked.searchViewerToolbarMore
);
});
it('File favorite, locked - [C326725]', async () => {
await testUtil.checkViewerActions(
testData.fileFavLocked.name,
testData.fileFavLocked.viewerToolbarPrimary,
testData.fileFavLocked.searchViewerToolbarMore
);
});
it('File shared, locked - [C326723]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedLocked.name,
testData.fileSharedLocked.viewerToolbarPrimary,
testData.fileSharedLocked.searchViewerToolbarMore
);
});
it('File shared, favorite, locked - [C326724]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.viewerToolbarPrimary,
testData.fileSharedFavLocked.searchViewerToolbarMore
);
});
});
});
describe('on Shared Files : ', () => {
beforeEach(async () => {
await page.clickSharedFilesAndWait();
});
describe('single selection : ', () => {
it('File shared, locked - [C286274]', 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 - [C286275]', async () => {
await testUtil.checkToolbarActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.toolbarPrimary,
testData.fileSharedFavLocked.toolbarMore
);
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
});
});
// describe('multiple selection : ', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// 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
// );
// });
// });
describe('Viewer - file opened from Shared Files : ', () => {
it('File shared, locked - [C326712]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedLocked.name,
testData.fileSharedLocked.viewerToolbarPrimary,
testData.fileSharedLocked.viewerToolbarMore
);
});
it('File shared, favorite, locked - [C326713]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.viewerToolbarPrimary,
testData.fileSharedFavLocked.viewerToolbarMore
);
});
});
});
});

View File

@@ -0,0 +1,197 @@
/*!
* @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, Utils, AdminActions, UserActions, LoginPage, BrowsingPage, SearchResultsPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';
describe('Multiple Files - available actions : ', () => {
const random = Utils.random();
const username = `user-${random}`;
const parentName = `parent-${random}`;
let parentId: string;
const file1 = `fileActions-1-${random}.txt`;
let file1Id: string;
const file2 = `fileActions-2-${random}.txt`;
let file2Id: string;
const file1LockedFav = `fileActions-lockedFav1-${random}.txt`;
let file1LockedFavId: string;
const file2LockedFav = `fileActions-lockedFav2-${random}.txt`;
let file2LockedFavId: string;
const userApi = new RepoClient(username, username);
const adminApiActions = new AdminActions();
const userActions = new UserActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable } = page;
const { searchInput } = page.header;
const searchResultsPage = new SearchResultsPage();
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
parentId = (await userApi.nodes.createFolder(parentName)).entry.id;
file1Id = (await userApi.nodes.createFile(file1, parentId)).entry.id;
file2Id = (await userApi.nodes.createFile(file2, parentId)).entry.id;
file1LockedFavId = (await userApi.nodes.createFile(file1LockedFav, parentId)).entry.id;
file2LockedFavId = (await userApi.nodes.createFile(file2LockedFav, parentId)).entry.id;
await userApi.nodes.lockFile(file1LockedFavId);
await userApi.nodes.lockFile(file2LockedFavId);
const initialFavoritesTotalItems = (await userApi.favorites.getFavoritesTotalItems()) || 0;
await userApi.favorites.addFavoritesByIds('file', [file1LockedFavId, file2LockedFavId]);
await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 2 });
const initialSharedTotalItems = await userApi.shared.getSharedLinksTotalItems();
await userApi.shared.shareFilesByIds([file1Id, file2Id, file1LockedFavId, file2LockedFavId]);
await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 4 });
await loginPage.loginWith(username);
});
afterAll(async () => {
await userActions.unlockNodes([file1LockedFavId, file2LockedFavId]);
await userActions.deleteNodes([parentId]);
});
beforeEach(async () => {
await Utils.pressEscape();
});
describe('on Personal Files : ', () => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentName);
await dataTable.waitForHeader();
});
it('multiple files - [C217112]', async () => {
await testUtil.checkMultipleSelContextMenu([file1, file2], testData.multipleSel.contextMenu);
await testUtil.checkMultipleSelToolbarActions([file1, file2], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
});
it('multiple files - all favorite, locked - [C297619]', async () => {
await testUtil.checkMultipleSelContextMenu([file1LockedFav, file2LockedFav], testData.multipleSelAllFav.contextMenu);
await testUtil.checkMultipleSelToolbarActions(
[file1LockedFav, file2LockedFav],
testData.multipleSel.toolbarPrimary,
testData.multipleSelAllFav.toolbarMore
);
});
});
describe('on Favorites : ', () => {
beforeEach(async () => {
await page.clickPersonalFiles();
await page.clickFavoritesAndWait();
});
it('multiple files - all favorite - [C280656]', async () => {
await testUtil.checkMultipleSelContextMenu([file1LockedFav, file2LockedFav], testData.multipleSelAllFav.favoritesContextMenu);
await testUtil.checkMultipleSelToolbarActions(
[file1LockedFav, file2LockedFav],
testData.multipleSelAllFav.toolbarPrimary,
testData.multipleSelAllFav.favoritesToolbarMore
);
});
});
describe('on Recent Files : ', () => {
beforeEach(async () => {
await page.clickPersonalFiles();
await page.clickRecentFilesAndWait();
});
it('multiple files - [C280468]', async () => {
await testUtil.checkMultipleSelContextMenu([file1, file2], testData.multipleSel.contextMenu);
await testUtil.checkMultipleSelToolbarActions([file1, file2], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
});
it('multiple files - all favorite - [C326689]', async () => {
await testUtil.checkMultipleSelContextMenu([file1LockedFav, file2LockedFav], testData.multipleSelAllFav.contextMenu);
await testUtil.checkMultipleSelToolbarActions(
[file1LockedFav, file2LockedFav],
testData.multipleSel.toolbarPrimary,
testData.multipleSelAllFav.toolbarMore
);
});
});
describe('on Search Results : ', () => {
beforeEach(async () => {
await page.clickPersonalFiles();
await searchInput.clickSearchButton();
await searchInput.searchFor('fileActions-');
await searchResultsPage.waitForResults();
});
it('[C291820] multiple files', async () => {
await testUtil.checkMultipleSelContextMenu([file1, file2], testData.multipleSel.searchContextMenu);
await testUtil.checkMultipleSelToolbarActions(
[file1, file2],
testData.multipleSel.searchToolbarPrimary,
testData.multipleSel.searchToolbarMore
);
});
it('[C326690] multiple files - all favorite, locked', async () => {
await testUtil.checkMultipleSelContextMenu([file1LockedFav, file2LockedFav], testData.multipleSelAllFav.searchContextMenu);
await testUtil.checkMultipleSelToolbarActions(
[file1LockedFav, file2LockedFav],
testData.multipleSelAllFav.searchToolbarPrimary,
testData.multipleSelAllFav.searchToolbarMore
);
});
});
describe('on Shared Files : ', () => {
beforeEach(async () => {
await page.clickPersonalFiles();
await page.clickSharedFilesAndWait();
});
it('multiple files - [C280467]', async () => {
await testUtil.checkMultipleSelContextMenu([file1, file2], testData.multipleSel.contextMenu);
await testUtil.checkMultipleSelToolbarActions([file1, file2], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
});
it('multiple files - all favorite - [C326691]', async () => {
await testUtil.checkMultipleSelContextMenu([file1LockedFav, file2LockedFav], testData.multipleSelAllFav.contextMenu);
await testUtil.checkMultipleSelToolbarActions(
[file1LockedFav, file2LockedFav],
testData.multipleSelAllFav.toolbarPrimary,
testData.multipleSelAllFav.toolbarMore
);
});
});
});

View File

@@ -0,0 +1,486 @@
/*!
* @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, Utils, AdminActions, UserActions, LoginPage, FILES, BrowsingPage, SearchResultsPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';
describe('Office Files - available actions : ', () => {
const random = Utils.random();
const username = `user-${random}`;
const parentName = `parent-${random}`;
let parentId: string;
let fileDocxFavId: string;
let fileDocxSharedId: string;
let fileDocxSharedFavId: string;
const userApi = new RepoClient(username, username);
const adminApiActions = new AdminActions();
const userActions = new UserActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable } = page;
const { searchInput } = page.header;
const searchResultsPage = new SearchResultsPage();
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
parentId = (await userApi.nodes.createFolder(parentName)).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;
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;
const initialFavoritesTotalItems = (await userApi.favorites.getFavoritesTotalItems()) || 0;
await userApi.favorites.addFavoritesByIds('file', [fileDocxFavId, fileDocxSharedFavId]);
await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 2 });
const initialSharedTotalItems = await userApi.shared.getSharedLinksTotalItems();
await userApi.shared.shareFilesByIds([fileDocxSharedId, fileDocxSharedFavId]);
await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 2 });
await loginPage.loginWith(username);
});
afterAll(async () => {
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
});
beforeEach(async () => {
await Utils.pressEscape();
});
describe('on Personal Files : ', () => {
beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentName);
await dataTable.waitForHeader();
});
describe('on a file', () => {
it('File Office - [C213122]', 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 - [C297612]', async () => {
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.toolbarMore);
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
});
it('File Office, shared - [C280448]', 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 - [C297616]', async () => {
await testUtil.checkToolbarActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.toolbarPrimary,
testData.fileDocxSharedFav.toolbarMore
);
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
});
});
describe('Viewer - file opened from Personal Files : ', () => {
it('File Office - [C282025]', async () => {
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
});
it('File Office, favorite - [C297583]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxFav.name,
testData.fileDocxFav.viewerToolbarPrimary,
testData.fileDocxFav.viewerToolbarMore
);
});
it('File Office, shared - [C297597]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxShared.name,
testData.fileDocxShared.viewerToolbarPrimary,
testData.fileDocxShared.viewerToolbarMore
);
});
it('File Office, shared, favorite - [C297598]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.viewerToolbarMore
);
});
});
// describe('on multiple selection', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// 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 - [C297619]', 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
// );
// });
// });
});
describe('on Favorites : ', () => {
beforeEach(async () => {
await page.clickFavoritesAndWait();
});
describe('single selection : ', () => {
it('File Office, favorite - [C297618]', async () => {
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.favoritesToolbarMore);
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.favoritesContextMenu);
});
it('File Office, shared, favorite - [C297620]', async () => {
await testUtil.checkToolbarActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.favoritesToolbarPrimary,
testData.fileDocxSharedFav.favoritesToolbarMore
);
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesContextMenu);
});
});
// describe('multiple selection : ', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// 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
// );
// });
// });
describe('Viewer - file opened from Favorites : ', () => {
it('File Office, favorite - [C326702]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxFav.name,
testData.fileDocxFav.viewerToolbarPrimary,
testData.fileDocxFav.viewerToolbarMore
);
});
it('File Office, shared, favorite - [C326704]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.viewerToolbarMore
);
});
});
});
describe('on Recent Files : ', () => {
beforeEach(async () => {
await page.clickRecentFilesAndWait();
});
describe('on single selection', () => {
it('File Office - [C297625]', 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 - [C280470]', async () => {
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.toolbarMore);
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
});
it('File Office, shared - [C297633]', 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 - [C280616]', async () => {
await testUtil.checkToolbarActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.toolbarPrimary,
testData.fileDocxSharedFav.toolbarMore
);
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
});
});
// describe('on multiple selection', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// it('multiple files - [C280468]', async () => {
// await testUtil.checkMultipleSelContextMenu([testData.fileDocxFav.name, testData.fileDocxShared.name], testData.multipleSel.contextMenu);
// await testUtil.checkMultipleSelToolbarActions(
// [testData.fileDocxFav.name, testData.fileDocxShared.name],
// testData.multipleSel.toolbarPrimary,
// testData.multipleSel.toolbarMore
// );
// });
// it('multiple files - all favorite - [C326689]', 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
// );
// });
// });
describe('Viewer - file opened from Recent Files : ', () => {
it('File Office - [C297599]', async () => {
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
});
it('File Office, favorite - [C297600]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxFav.name,
testData.fileDocxFav.viewerToolbarPrimary,
testData.fileDocxFav.viewerToolbarMore
);
});
it('File Office, shared - [C326694]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxShared.name,
testData.fileDocxShared.viewerToolbarPrimary,
testData.fileDocxShared.viewerToolbarMore
);
});
it('File Office, shared, favorite - [C326695]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.viewerToolbarMore
);
});
});
});
describe('on Search Results : ', () => {
beforeEach(async () => {
await page.clickPersonalFiles();
await searchInput.clickSearchButton();
await searchInput.searchFor('fileActions-');
await searchResultsPage.waitForResults();
});
describe('on a file', () => {
it('[C297637] 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('[C291827] 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('[C297627] 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('[C280631] 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);
});
});
// describe('on multiple selection', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// it('[C291820] multiple files', async () => {
// await testUtil.checkMultipleSelContextMenu([testData.fileDocx.name, testData.fileDocxShared.name], testData.multipleSel.searchContextMenu);
// await testUtil.checkMultipleSelToolbarActions(
// [testData.fileDocx.name, testData.fileDocxShared.name],
// testData.multipleSel.searchToolbarPrimary,
// testData.multipleSel.searchToolbarMore
// );
// });
// it('[C326690] multiple files - all favorite', async () => {
// await testUtil.checkMultipleSelContextMenu(
// [testData.fileDocxFav.name, testData.fileDocxSharedFav.name],
// testData.multipleSelAllFav.searchContextMenu
// );
// await testUtil.checkMultipleSelToolbarActions(
// [testData.fileDocxFav.name, testData.fileDocxSharedFav.name],
// testData.multipleSelAllFav.searchToolbarPrimary,
// testData.multipleSelAllFav.searchToolbarMore
// );
// });
// });
describe('Viewer - file opened from Search Results : ', () => {
it('File Office - [C326714]', async () => {
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.searchViewerToolbarMore);
});
it('File Office, favorite - [C326715]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxFav.name,
testData.fileDocxFav.viewerToolbarPrimary,
testData.fileDocxFav.searchViewerToolbarMore
);
});
it('File Office, shared - [C326718]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxShared.name,
testData.fileDocxShared.viewerToolbarPrimary,
testData.fileDocxShared.searchViewerToolbarMore
);
});
it('File Office, shared, favorite - [C326719]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.searchViewerToolbarMore
);
});
});
});
describe('on Shared Files : ', () => {
beforeEach(async () => {
await page.clickSharedFilesAndWait();
});
describe('single selection', () => {
it('File Office, shared - [C297629]', 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 - [C280652]', async () => {
await testUtil.checkToolbarActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.toolbarPrimary,
testData.fileDocxSharedFav.toolbarMore
);
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
});
});
// describe('multiple selection', () => {
// afterAll(async () => {
// await dataTable.clearSelection();
// });
// it('multiple files - [C280467]', async () => {
// await testUtil.checkMultipleSelContextMenu([testData.fileDocxShared.name, testData.fileDocxSharedFav.name], testData.multipleSel.contextMenu);
// await testUtil.checkMultipleSelToolbarActions(
// [testData.fileDocxShared.name, testData.fileDocxSharedFav.name],
// testData.multipleSel.toolbarPrimary,
// testData.multipleSel.toolbarMore
// );
// });
// it('multiple files - all favorite - [C326691]', 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
// );
// });
// });
describe('Viewer - file opened from Shared Files', () => {
it('File Office, shared - [C326708]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxShared.name,
testData.fileDocxShared.viewerToolbarPrimary,
testData.fileDocxShared.viewerToolbarMore
);
});
it('File Office, shared, favorite - [C326709]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.viewerToolbarMore
);
});
});
});
});

View File

@@ -1,181 +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 { Utils, BrowsingPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';
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 - [C213122]', 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 - [C297612]', 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 - [C286265]', 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 - [C297615]', 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 - [C280448]', 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 - [C297616]', 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 - [C286323]', 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 - [C280450]', 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 - [C297617]', 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 - [C291816]', 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 - [C280453]', 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 - [C280454]', 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 - [C213123]', 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 - [C280451]', 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 - [C297619]', 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 - [C326688]', 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
);
});
});
});
}

View File

@@ -1,145 +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 { Utils, BrowsingPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';
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 - [C297625]', 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 - [C280470]', 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 - [C280471]', 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 - [C280615]', 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 - [C297633]', 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 - [C280616]', 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 - [C280601]', 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 - [C297635]', 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 - [C280622]', 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 - [C280608]', 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 - [C297636]', 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 - [C286324]', 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 - [C326689]', 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
);
});
});
});
}

View File

@@ -1,228 +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 { BrowsingPage, SearchResultsPage, Utils } from '@alfresco/aca-testing-shared';
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('[C297637] 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('[C291827] 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('[C297638] 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('[C280661] 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('[C297627] 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('[C280631] 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('[C280632] 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('[C280641] 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('[C297628] 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('[C280648] 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('[C280574] 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('[C280642] 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('[C280609] 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('[C291828] 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('[C291820] multiple files', 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('[C326690] 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('[C297626] multiple locked files', 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('[C291821] multiple folders', 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('[C291822] both files and folders', 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
);
});
});
});
}

View File

@@ -1,121 +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 { BrowsingPage, Utils } from '@alfresco/aca-testing-shared';
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 - [C297629]', 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 - [C280652]', 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 - [C297630]', 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 - [C286273]', async () => {
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
});
it('File shared, locked - [C286274]', 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 - [C286275]', async () => {
await testUtil.checkToolbarActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.toolbarPrimary,
testData.fileSharedFavLocked.toolbarMore
);
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
});
});
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 - [C326691]', 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
);
});
});
});
}

View File

@@ -0,0 +1,342 @@
/*!
* @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, Utils, AdminActions, UserActions, LoginPage, BrowsingPage, SearchResultsPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';
describe('Files - available actions : ', () => {
const random = Utils.random();
const username = `user-${random}`;
const parentName = `parent-${random}`;
let parentId: string;
let fileFavId: string;
let fileSharedId: string;
let fileSharedFavId: string;
const userApi = new RepoClient(username, username);
const adminApiActions = new AdminActions();
const userActions = new UserActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable } = page;
const { searchInput } = page.header;
const searchResultsPage = new SearchResultsPage();
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
parentId = (await userApi.nodes.createFolder(parentName)).entry.id;
await userApi.nodes.createFile(testData.file.name, parentId);
fileFavId = (await userApi.nodes.createFile(testData.fileFav.name, parentId)).entry.id;
fileSharedId = (await userApi.nodes.createFile(testData.fileShared.name, parentId)).entry.id;
fileSharedFavId = (await userApi.nodes.createFile(testData.fileSharedFav.name, parentId)).entry.id;
const initialFavoritesTotalItems = (await userApi.favorites.getFavoritesTotalItems()) || 0;
await userApi.favorites.addFavoritesByIds('file', [fileFavId, fileSharedFavId]);
await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 2 });
const initialSharedTotalItems = await userApi.shared.getSharedLinksTotalItems();
await userApi.shared.shareFilesByIds([fileSharedId, fileSharedFavId]);
await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 2 });
await loginPage.loginWith(username);
});
afterAll(async () => {
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
});
beforeEach(async () => {
await Utils.pressEscape();
});
describe('on Personal Files : ', () => {
beforeAll(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentName);
await dataTable.waitForHeader();
});
it('File simple - [C286265]', 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 - [C297615]', async () => {
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.toolbarMore);
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
});
it('File shared - [C286323]', 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 - [C280450]', async () => {
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
});
describe('Viewer - file opened from Personal Files : ', () => {
beforeAll(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentName);
await dataTable.waitForHeader();
});
it('File simple - [C297587]', async () => {
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
});
it('File favorite - [C297588]', async () => {
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
});
it('File shared - [C291831]', async () => {
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
});
it('File shared, favorite - [C297632]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.viewerToolbarMore
);
});
});
});
describe('on Favorites : ', () => {
beforeAll(async () => {
await page.clickFavoritesAndWait();
});
it('File favorite - [C280461]', async () => {
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.favoritesToolbarMore);
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.favoritesContextMenu);
});
it('File shared, favorite - [C280462]', async () => {
await testUtil.checkToolbarActions(
testData.fileSharedFav.name,
testData.fileSharedFav.favoritesToolbarPrimary,
testData.fileSharedFav.favoritesToolbarMore
);
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.favoritesContextMenu);
});
describe('Viewer - file opened from Favorites : ', () => {
beforeAll(async () => {
await page.clickFavoritesAndWait();
});
it('File favorite - [C326703]', async () => {
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
});
it('File shared, favorite - [C326705]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.viewerToolbarMore
);
});
});
});
describe('on Recent Files : ', () => {
beforeAll(async () => {
await page.clickRecentFilesAndWait();
});
it('File simple - [C280471]', 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 - [C280615]', async () => {
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.toolbarMore);
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
});
it('File shared - [C280601]', 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 - [C297635]', async () => {
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
});
describe('Viewer - file opened from Recent Files : ', () => {
beforeAll(async () => {
await page.clickRecentFilesAndWait();
});
it('File simple - [C326692]', async () => {
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
});
it('File favorite - [C326693]', async () => {
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
});
it('File shared - [C326696]', async () => {
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
});
it('File shared, favorite - [C326697]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.viewerToolbarMore
);
});
});
});
describe('on Search Results : ', () => {
beforeEach(async () => {
await page.clickPersonalFiles();
await searchInput.clickSearchButton();
});
it('[C297638] File simple', async () => {
await searchInput.searchFor(testData.file.name);
await searchResultsPage.waitForResults();
await testUtil.checkToolbarActions(testData.file.name, testData.file.searchToolbarPrimary, testData.file.searchToolbarMore);
await testUtil.checkContextMenu(testData.file.name, testData.file.searchContextMenu);
});
it('[C280661] File favorite', async () => {
await searchInput.searchFor(testData.fileFav.name);
await searchResultsPage.waitForResults();
await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.searchToolbarPrimary, testData.fileFav.searchToolbarMore);
await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.searchContextMenu);
});
it('[C280632] File shared', async () => {
await searchInput.searchFor(testData.fileShared.name);
await searchResultsPage.waitForResults();
await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.searchToolbarPrimary, testData.fileShared.searchToolbarMore);
await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.searchContextMenu);
});
it('[C280641] File shared, favorite', async () => {
await searchInput.searchFor(testData.fileSharedFav.name);
await searchResultsPage.waitForResults();
await testUtil.checkToolbarActions(
testData.fileSharedFav.name,
testData.fileSharedFav.searchToolbarPrimary,
testData.fileSharedFav.searchToolbarMore
);
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.searchContextMenu);
});
describe('Viewer - file opened from Search Results : ', () => {
it('File simple - [C326716]', async () => {
await searchInput.searchFor(testData.file.name);
await searchResultsPage.waitForResults();
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.searchViewerToolbarMore);
});
it('File favorite - [C326717]', async () => {
await searchInput.searchFor(testData.fileFav.name);
await searchResultsPage.waitForResults();
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.searchViewerToolbarMore);
});
it('File shared - [C326720]', async () => {
await searchInput.searchFor(testData.fileShared.name);
await searchResultsPage.waitForResults();
await testUtil.checkViewerActions(
testData.fileShared.name,
testData.fileShared.viewerToolbarPrimary,
testData.fileShared.searchViewerToolbarMore
);
});
it('File shared, favorite - [C326721]', async () => {
await searchInput.searchFor(testData.fileSharedFav.name);
await searchResultsPage.waitForResults();
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.searchViewerToolbarMore
);
});
});
});
describe('on Shared Files : ', () => {
beforeAll(async () => {
await page.clickSharedFilesAndWait();
});
describe('single selection', () => {
it('File shared - [C297630]', 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 - [C286273]', async () => {
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
});
});
describe('Viewer - file opened from Shared Files : ', () => {
beforeAll(async () => {
await page.clickSharedFilesAndWait();
});
it('File shared - [C326710]', async () => {
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
});
it('File shared, favorite - [C326711]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.viewerToolbarMore
);
});
});
});
});

View File

@@ -491,7 +491,7 @@ const searchViewerDocxFavToolbarMore = [
const searchViewerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
export const fileDocx = {
name: `file-docx-${Utils.random()}.docx`,
name: `fileActions-docx-${Utils.random()}.docx`,
description: 'file not shared, not fav, office, not locked',
contextMenu: fileDocxContextMenu,
@@ -507,7 +507,7 @@ export const fileDocx = {
};
export const fileDocxFav = {
name: `file-docx-fav-${Utils.random()}.docx`,
name: `fileActions-docx-fav-${Utils.random()}.docx`,
description: 'file not shared, fav, office, not locked',
contextMenu: fileDocxFavContextMenu,
@@ -526,7 +526,7 @@ export const fileDocxFav = {
};
export const file = {
name: `file-${Utils.random()}.txt`,
name: `fileActions-${Utils.random()}.txt`,
description: 'file not shared, not fav, not office, not locked',
contextMenu: fileContextMenu,
@@ -542,7 +542,7 @@ export const file = {
};
export const fileFav = {
name: `file-fav-${Utils.random()}.txt`,
name: `fileActions-fav-${Utils.random()}.txt`,
description: 'file not shared, fav, not office, not locked',
contextMenu: fileFavContextMenu,
@@ -561,7 +561,7 @@ export const fileFav = {
};
export const fileDocxShared = {
name: `file-docx-shared-${Utils.random()}.docx`,
name: `fileActions-docx-shared-${Utils.random()}.docx`,
description: 'file shared, not fav, office, not locked',
contextMenu: fileDocxSharedContextMenu,
@@ -577,7 +577,7 @@ export const fileDocxShared = {
};
export const fileDocxSharedFav = {
name: `file-docx-shared-fav-${Utils.random()}.docx`,
name: `fileActions-docx-shared-fav-${Utils.random()}.docx`,
description: 'file shared, fav, office, not locked',
contextMenu: fileDocxSharedFavContextMenu,
@@ -597,7 +597,7 @@ export const fileDocxSharedFav = {
};
export const fileShared = {
name: `file-shared-${Utils.random()}.txt`,
name: `fileActions-shared-${Utils.random()}.txt`,
description: 'file shared, not fav, not office, not locked',
contextMenu: fileSharedContextMenu,
@@ -613,7 +613,7 @@ export const fileShared = {
};
export const fileSharedFav = {
name: `file-shared-fav-${Utils.random()}.txt`,
name: `fileActions-shared-fav-${Utils.random()}.txt`,
description: 'file shared, fav, not office, not locked',
contextMenu: fileSharedFavContextMenu,
@@ -633,7 +633,7 @@ export const fileSharedFav = {
};
export const fileLocked = {
name: `file-locked-${Utils.random()}.txt`,
name: `fileActions-locked-${Utils.random()}.txt`,
description: 'file not shared, not fav, not office, locked',
contextMenu: fileLockedContextMenu,
@@ -649,7 +649,7 @@ export const fileLocked = {
};
export const fileFavLocked = {
name: `file-fav-locked-${Utils.random()}.txt`,
name: `fileActions-fav-locked-${Utils.random()}.txt`,
description: 'file not shared, fav, not office, locked',
contextMenu: fileFavLockedContextMenu,
@@ -668,7 +668,7 @@ export const fileFavLocked = {
};
export const fileSharedLocked = {
name: `file-shared-locked-${Utils.random()}.txt`,
name: `fileActions-shared-locked-${Utils.random()}.txt`,
description: 'file shared, not fav, not office, locked',
contextMenu: fileSharedLockedContextMenu,
@@ -684,7 +684,7 @@ export const fileSharedLocked = {
};
export const fileSharedFavLocked = {
name: `file-shared-fav-locked-${Utils.random()}.txt`,
name: `fileActions-shared-fav-locked-${Utils.random()}.txt`,
description: 'file shared, fav, not office, locked',
contextMenu: fileSharedFavLockedContextMenu,
@@ -741,7 +741,7 @@ const searchFolderFavContextMenu = ['Download', 'Edit', 'Remove Favorite', 'Copy
const searchFolderFavToolbarMore = ['Edit', 'Remove Favorite', 'Copy', 'Permissions'];
export const folder = {
name: `folder-${Utils.random()}`,
name: `folderActions-${Utils.random()}`,
description: 'folder not favorite',
contextMenu: folderContextMenu,
@@ -754,7 +754,7 @@ export const folder = {
};
export const folderFav = {
name: `folder-fav-${Utils.random()}`,
name: `folderActions-fav-${Utils.random()}`,
description: 'folder favorite',
contextMenu: folderFavContextMenu,
@@ -770,7 +770,7 @@ export const folderFav = {
};
export const folderFav2 = {
name: `folder-fav-2-${Utils.random()}`,
name: `folderActions-fav-2-${Utils.random()}`,
description: 'folder favorite',
contextMenu: folderFavContextMenu,

View File

@@ -0,0 +1,97 @@
/*!
* @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, Utils, AdminActions, UserActions, LoginPage, BrowsingPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';
const page = new BrowsingPage();
describe('Trash - available actions : ', () => {
const random = Utils.random();
const username = `user-${random}`;
let fileInTrashId: string;
let file2InTrashId: string;
let folderInTrashId: string;
let folder2InTrashId: string;
const userApi = new RepoClient(username, username);
const adminApiActions = new AdminActions();
const userActions = new UserActions();
const loginPage = new LoginPage();
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
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;
const initialDeletedTotalItems = await userActions.getTrashcanSize();
await userActions.deleteNodes([fileInTrashId, file2InTrashId, folderInTrashId, folder2InTrashId], false);
await userActions.waitForTrashcanSize(initialDeletedTotalItems + 4);
await loginPage.loginWith(username);
await page.clickTrashAndWait();
});
afterAll(async () => {
await userActions.emptyTrashcan();
});
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);
});
});

View File

@@ -1,67 +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 { BrowsingPage, Utils } from '@alfresco/aca-testing-shared';
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);
});
});
}

View File

@@ -1,399 +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 { BrowsingPage, SearchResultsPage } from '@alfresco/aca-testing-shared';
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();
});
describe('file opened from Personal Files', () => {
beforeAll(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentName);
await dataTable.waitForHeader();
});
it('File Office - [C282025]', async () => {
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
});
it('File Office, favorite - [C297583]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxFav.name,
testData.fileDocxFav.viewerToolbarPrimary,
testData.fileDocxFav.viewerToolbarMore
);
});
it('File simple - [C297587]', async () => {
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
});
it('File favorite - [C297588]', async () => {
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
});
it('File Office, shared - [C297597]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxShared.name,
testData.fileDocxShared.viewerToolbarPrimary,
testData.fileDocxShared.viewerToolbarMore
);
});
it('File Office, shared, favorite - [C297598]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.viewerToolbarMore
);
});
it('File shared - [C291831]', async () => {
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
});
it('File shared, favorite - [C297632]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.viewerToolbarMore
);
});
it('File locked - [C291832]', async () => {
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
});
it('File favorite, locked - [C297593]', async () => {
await testUtil.checkViewerActions(
testData.fileFavLocked.name,
testData.fileFavLocked.viewerToolbarPrimary,
testData.fileFavLocked.viewerToolbarMore
);
});
it('File shared, locked - [C291833]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedLocked.name,
testData.fileSharedLocked.viewerToolbarPrimary,
testData.fileSharedLocked.viewerToolbarMore
);
});
it('File shared, favorite, locked - [C297592]', 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 - [C297599]', async () => {
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
});
it('File Office, favorite - [C297600]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxFav.name,
testData.fileDocxFav.viewerToolbarPrimary,
testData.fileDocxFav.viewerToolbarMore
);
});
it('File simple - [C326692]', async () => {
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
});
it('File favorite - [C326693]', async () => {
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
});
it('File Office, shared - [C326694]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxShared.name,
testData.fileDocxShared.viewerToolbarPrimary,
testData.fileDocxShared.viewerToolbarMore
);
});
it('File Office, shared, favorite - [C326695]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.viewerToolbarMore
);
});
it('File shared - [C326696]', async () => {
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
});
it('File shared, favorite - [C326697]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.viewerToolbarMore
);
});
it('File locked - [C326698]', async () => {
await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
});
it('File favorite, locked - [C326701]', async () => {
await testUtil.checkViewerActions(
testData.fileFavLocked.name,
testData.fileFavLocked.viewerToolbarPrimary,
testData.fileFavLocked.viewerToolbarMore
);
});
it('File shared, locked - [C326699]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedLocked.name,
testData.fileSharedLocked.viewerToolbarPrimary,
testData.fileSharedLocked.viewerToolbarMore
);
});
it('File shared, favorite, locked - [C326700]', 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 - [C326702]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxFav.name,
testData.fileDocxFav.viewerToolbarPrimary,
testData.fileDocxFav.viewerToolbarMore
);
});
it('File favorite - [C326703]', async () => {
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
});
it('File Office, shared, favorite - [C326704]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.viewerToolbarMore
);
});
it('File shared, favorite - [C326705]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.viewerToolbarMore
);
});
it('File favorite, locked - [C326707]', async () => {
await testUtil.checkViewerActions(
testData.fileFavLocked.name,
testData.fileFavLocked.viewerToolbarPrimary,
testData.fileFavLocked.viewerToolbarMore
);
});
it('File shared, favorite, locked - [C326706]', 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 - [C326708]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxShared.name,
testData.fileDocxShared.viewerToolbarPrimary,
testData.fileDocxShared.viewerToolbarMore
);
});
it('File Office, shared, favorite - [C326709]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.viewerToolbarMore
);
});
it('File shared - [C326710]', async () => {
await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
});
it('File shared, favorite - [C326711]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.viewerToolbarMore
);
});
it('File shared, locked - [C326712]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedLocked.name,
testData.fileSharedLocked.viewerToolbarPrimary,
testData.fileSharedLocked.viewerToolbarMore
);
});
it('File shared, favorite, locked - [C326713]', 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 - [C326714]', async () => {
await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.searchViewerToolbarMore);
});
it('File Office, favorite - [C326715]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxFav.name,
testData.fileDocxFav.viewerToolbarPrimary,
testData.fileDocxFav.searchViewerToolbarMore
);
});
it('File simple - [C326716]', async () => {
await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.searchViewerToolbarMore);
});
it('File favorite - [C326717]', async () => {
await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.searchViewerToolbarMore);
});
it('File Office, shared - [C326718]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxShared.name,
testData.fileDocxShared.viewerToolbarPrimary,
testData.fileDocxShared.searchViewerToolbarMore
);
});
it('File Office, shared, favorite - [C326719]', async () => {
await testUtil.checkViewerActions(
testData.fileDocxSharedFav.name,
testData.fileDocxSharedFav.viewerToolbarPrimary,
testData.fileDocxSharedFav.searchViewerToolbarMore
);
});
it('File shared - [C326720]', async () => {
await testUtil.checkViewerActions(
testData.fileShared.name,
testData.fileShared.viewerToolbarPrimary,
testData.fileShared.searchViewerToolbarMore
);
});
it('File shared, favorite - [C326721]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFav.name,
testData.fileSharedFav.viewerToolbarPrimary,
testData.fileSharedFav.searchViewerToolbarMore
);
});
it('File locked - [C326722]', async () => {
await testUtil.checkViewerActions(
testData.fileLocked.name,
testData.fileLocked.viewerToolbarPrimary,
testData.fileLocked.searchViewerToolbarMore
);
});
it('File favorite, locked - [C326725]', async () => {
await testUtil.checkViewerActions(
testData.fileFavLocked.name,
testData.fileFavLocked.viewerToolbarPrimary,
testData.fileFavLocked.searchViewerToolbarMore
);
});
it('File shared, locked - [C326723]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedLocked.name,
testData.fileSharedLocked.viewerToolbarPrimary,
testData.fileSharedLocked.searchViewerToolbarMore
);
});
it('File shared, favorite, locked - [C326724]', async () => {
await testUtil.checkViewerActions(
testData.fileSharedFavLocked.name,
testData.fileSharedFavLocked.viewerToolbarPrimary,
testData.fileSharedFavLocked.searchViewerToolbarMore
);
});
});
});
}

View File

@@ -0,0 +1,77 @@
/*!
* @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, RepoClient, Utils, AdminActions, UserActions } from '@alfresco/aca-testing-shared';
import * as testData from './test-data-libraries';
import * as testUtil from '../test-util';
describe('Library actions : ', () => {
const username = `user-${Utils.random()}`;
const userApi = new RepoClient(username, username);
const adminApiActions = new AdminActions();
const userActions = new UserActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
beforeAll(async () => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
await userApi.sites.createSite(testData.siteInTrash.name);
await userApi.sites.createSite(testData.site2InTrash.name);
await userActions.deleteSites([testData.siteInTrash.name, testData.site2InTrash.name], false);
await loginPage.loginWith(username);
});
afterAll(async () => {
await userActions.emptyTrashcan();
});
describe('on Trash', () => {
beforeAll(async () => {
await Utils.pressEscape();
await page.clickTrashAndWait();
});
beforeEach(async () => {
await Utils.pressEscape();
});
it('[C326686] single library', async () => {
await testUtil.checkToolbarPrimary(testData.siteInTrash.name, testData.siteInTrash.trashActions);
await testUtil.checkContextMenu(testData.siteInTrash.name, testData.siteInTrash.trashActions);
});
it('[C326687] multiple libraries', async () => {
await testUtil.checkMultipleSelContextMenu([testData.siteInTrash.name, testData.site2InTrash.name], testData.trashActions);
await testUtil.checkMultipleSelToolbarPrimary([testData.siteInTrash.name, testData.site2InTrash.name], testData.trashActions);
});
});
});

View File

@@ -44,11 +44,6 @@ describe('Library actions : ', () => {
await adminApiActions.createUser({ username });
await userActions.login(username, username);
const initialAdminSitesTotalItems = await adminApiActions.sites.getSitesTotalItems();
const initialUserSitesTotalItems = await userApi.sites.getSitesTotalItems();
const initialDeletedTotalItems = await userActions.getTrashcanSize();
const initialQuerySitesTotalItems = await userApi.queries.findSitesTotalItems('actionsSite-');
await userApi.sites.createSite(testData.publicUserMemberFav.name);
await userApi.sites.createSitePrivate(testData.privateUserMemberFav.name);
await userApi.sites.createSiteModerated(testData.moderatedUserMemberFav.name);
@@ -73,18 +68,8 @@ describe('Library actions : ', () => {
testData.moderatedRequestedJoinFav.name
]);
await userApi.sites.waitForApi({ expect: initialUserSitesTotalItems + 6 });
await adminApiActions.sites.waitForApi({ expect: initialAdminSitesTotalItems + 6 });
await userApi.queries.waitForSites('actionsSite-', { expect: initialQuerySitesTotalItems + 12 });
await userApi.sites.createSite(testData.siteInTrash.name);
await userApi.sites.createSite(testData.site2InTrash.name);
await userActions.deleteSites([testData.siteInTrash.name, testData.site2InTrash.name], false);
await userActions.waitForTrashcanSize(initialDeletedTotalItems + 2);
await loginPage.loginWith(username);
}, 300000);
});
afterAll(async () => {
await userActions.deleteSites([
@@ -237,19 +222,16 @@ describe('Library actions : ', () => {
});
describe('on Search Results', () => {
beforeAll(async () => {
beforeEach(async () => {
await Utils.pressEscape();
await page.clickPersonalFiles();
await searchInput.clickSearchButton();
await searchInput.checkLibraries();
await searchInput.searchFor('actionsSite-');
});
beforeEach(async () => {
await Utils.pressEscape();
});
it('[C290084] Public library, user is a member, favorite', async () => {
await searchInput.searchFor(testData.publicUserMemberFav.name);
await testUtil.checkToolbarActions(
testData.publicUserMemberFav.name,
testData.publicUserMemberFav.searchToolbarPrimary,
@@ -259,6 +241,8 @@ describe('Library actions : ', () => {
});
it('[C290085] Private library, user is a member, favorite', async () => {
await searchInput.searchFor(testData.privateUserMemberFav.name);
await testUtil.checkToolbarActions(
testData.privateUserMemberFav.name,
testData.privateUserMemberFav.searchToolbarPrimary,
@@ -268,6 +252,8 @@ describe('Library actions : ', () => {
});
it('[C290086] Moderated library, user is a member, favorite', async () => {
await searchInput.searchFor(testData.moderatedUserMemberFav.name);
await testUtil.checkToolbarActions(
testData.moderatedUserMemberFav.name,
testData.moderatedUserMemberFav.searchToolbarPrimary,
@@ -277,6 +263,8 @@ describe('Library actions : ', () => {
});
it('[C291812] Public library, user is a member, not favorite', async () => {
await searchInput.searchFor(testData.publicUserMemberNotFav.name);
await testUtil.checkToolbarActions(
testData.publicUserMemberNotFav.name,
testData.publicUserMemberNotFav.searchToolbarPrimary,
@@ -286,6 +274,8 @@ describe('Library actions : ', () => {
});
it('[C291813] Private library, user is a member, not favorite', async () => {
await searchInput.searchFor(testData.privateUserMemberNotFav.name);
await testUtil.checkToolbarActions(
testData.privateUserMemberNotFav.name,
testData.privateUserMemberNotFav.searchToolbarPrimary,
@@ -295,6 +285,8 @@ describe('Library actions : ', () => {
});
it('[C291814] Moderated library, user is a member, not favorite', async () => {
await searchInput.searchFor(testData.moderatedUserMemberNotFav.name);
await testUtil.checkToolbarActions(
testData.moderatedUserMemberNotFav.name,
testData.moderatedUserMemberNotFav.searchToolbarPrimary,
@@ -304,6 +296,8 @@ describe('Library actions : ', () => {
});
it('[C326680] Public library, user not a member, favorite', async () => {
await searchInput.searchFor(testData.publicNotMemberFav.name);
await testUtil.checkToolbarActions(
testData.publicNotMemberFav.name,
testData.publicNotMemberFav.searchToolbarPrimary,
@@ -313,6 +307,8 @@ describe('Library actions : ', () => {
});
it('[C326681] Moderated library, user not a member, favorite', async () => {
await searchInput.searchFor(testData.moderatedNotMemberFav.name);
await testUtil.checkToolbarActions(
testData.moderatedNotMemberFav.name,
testData.moderatedNotMemberFav.searchToolbarPrimary,
@@ -322,6 +318,8 @@ describe('Library actions : ', () => {
});
it('[C326682] Public library, user not a member, not favorite', async () => {
await searchInput.searchFor(testData.publicNotMemberNotFav.name);
await testUtil.checkToolbarActions(
testData.publicNotMemberNotFav.name,
testData.publicNotMemberNotFav.searchToolbarPrimary,
@@ -331,6 +329,8 @@ describe('Library actions : ', () => {
});
it('[C326683] Moderated library, user not a member, not favorite', async () => {
await searchInput.searchFor(testData.moderatedNotMemberNotFav.name);
await testUtil.checkToolbarActions(
testData.moderatedNotMemberNotFav.name,
testData.moderatedNotMemberNotFav.searchToolbarPrimary,
@@ -340,6 +340,8 @@ describe('Library actions : ', () => {
});
it('[C326685] Moderated library, user requested to join, favorite', async () => {
await searchInput.searchFor(testData.moderatedRequestedJoinFav.name);
await testUtil.checkToolbarActions(
testData.moderatedRequestedJoinFav.name,
testData.moderatedRequestedJoinFav.searchToolbarPrimary,
@@ -349,6 +351,8 @@ describe('Library actions : ', () => {
});
it('[C326684] Moderated library, user requested to join, not favorite', async () => {
await searchInput.searchFor(testData.moderatedRequestedJoinNotFav.name);
await testUtil.checkToolbarActions(
testData.moderatedRequestedJoinNotFav.name,
testData.moderatedRequestedJoinNotFav.searchToolbarPrimary,
@@ -357,25 +361,4 @@ describe('Library actions : ', () => {
await testUtil.checkContextMenu(testData.moderatedRequestedJoinNotFav.name, testData.moderatedRequestedJoinNotFav.contextMenu);
});
});
describe('on Trash', () => {
beforeAll(async () => {
await Utils.pressEscape();
await page.clickTrashAndWait();
});
beforeEach(async () => {
await Utils.pressEscape();
});
it('[C326686] single library', async () => {
await testUtil.checkToolbarPrimary(testData.siteInTrash.name, testData.siteInTrash.trashActions);
await testUtil.checkContextMenu(testData.siteInTrash.name, testData.siteInTrash.trashActions);
});
it('[C326687] multiple libraries', async () => {
await testUtil.checkMultipleSelContextMenu([testData.siteInTrash.name, testData.site2InTrash.name], testData.trashActions);
await testUtil.checkMultipleSelToolbarPrimary([testData.siteInTrash.name, testData.site2InTrash.name], testData.trashActions);
});
});
});

View File

@@ -145,7 +145,7 @@ describe('Special permissions : ', () => {
userManagerApi.search.waitForApi(userManager, { expect: managerSearchTotalItems + 14 }),
userCollaboratorApi.favorites.waitForApi({ expect: collaboratorFavoritesTotalItems + 2 })
]);
}, 300000);
});
afterAll(async () => {
await userManagerApi.sites.deleteSite(sitePrivate);

View File

@@ -24,6 +24,7 @@
*/
import { AdminActions, UserActions, LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
import { Logger } from '@alfresco/adf-testing';
describe('Delete and undo delete', () => {
const username = `user-${Utils.random()}`;
@@ -83,8 +84,12 @@ describe('Delete and undo delete', () => {
});
afterAll(async () => {
try {
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
} catch (error) {
Logger.error(`----- afterAll failed : ${error}`);
}
});
it('[C280528] delete a file and check notification', async () => {
@@ -214,9 +219,13 @@ describe('Delete and undo delete', () => {
});
afterAll(async () => {
try {
await userActions.unlockNodes([fileLocked1Id, fileLocked2Id, fileLocked3Id, fileLocked4Id]);
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
} catch (error) {
Logger.error(`----- afterAll failed : ${error}`);
}
});
it('[C217125] delete a file and check notification', async () => {
@@ -363,10 +372,13 @@ describe('Delete and undo delete', () => {
done();
});
afterAll(async (done) => {
afterAll(async () => {
try {
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
done();
} catch (error) {
Logger.error(`----- afterAll failed : ${error}`);
}
});
it('[C280316] delete a file and check notification', async () => {
@@ -499,11 +511,14 @@ describe('Delete and undo delete', () => {
done();
});
afterAll(async (done) => {
afterAll(async () => {
try {
await userActions.unlockNodes([fileLocked1Id, fileLocked2Id, fileLocked3Id, fileLocked4Id]);
await userActions.deleteNodes([parentId]);
await userActions.emptyTrashcan();
done();
} catch (error) {
Logger.error(`----- afterAll failed : ${error}`);
}
});
it('[C280516] delete a file and check notification', async () => {

View File

@@ -92,7 +92,7 @@ describe('Library actions', () => {
await loginPage.loginWith(username);
done();
}, 300000);
});
beforeEach(async () => {
await Utils.pressEscape();

View File

@@ -269,7 +269,7 @@ describe('Share a file', () => {
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty');
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked');
expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty');
@@ -297,7 +297,7 @@ describe('Share a file', () => {
it('[C286345] Share a file from the context menu', async () => {
await dataTable.rightClickOnItem(file9);
await contextMenu.waitForMenuToOpen();
await contextMenu.shareAction.click();
await BrowserActions.click(contextMenu.shareAction);
await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl();
@@ -397,7 +397,7 @@ describe('Share a file', () => {
const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl);
await shareDialog.urlAction.click();
await BrowserActions.click(shareDialog.urlAction);
expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard');
await browser.get(url);
@@ -412,9 +412,9 @@ describe('Share a file', () => {
await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked');
await shareDialog.datetimePickerButton.click();
await BrowserActions.click(shareDialog.datetimePickerButton);
expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened');
const date = await shareDialog.dateTimePicker.setDefaultDay();
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
@@ -448,7 +448,7 @@ describe('Share a file', () => {
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty');
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked');
expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty');
@@ -476,7 +476,7 @@ describe('Share a file', () => {
it('[C286647] Share a file from the context menu', async () => {
await dataTable.rightClickOnItem(file9);
await contextMenu.waitForMenuToOpen();
await contextMenu.shareAction.click();
await BrowserActions.click(contextMenu.shareAction);
await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl();
@@ -573,7 +573,7 @@ describe('Share a file', () => {
const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl);
await shareDialog.urlAction.click();
await BrowserActions.click(shareDialog.urlAction);
expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard');
await browser.get(url);
@@ -588,9 +588,9 @@ describe('Share a file', () => {
await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked');
await shareDialog.datetimePickerButton.click();
await BrowserActions.click(shareDialog.datetimePickerButton);
expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened');
const date = await shareDialog.dateTimePicker.setDefaultDay();
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
@@ -624,7 +624,7 @@ describe('Share a file', () => {
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty');
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked');
expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty');
@@ -652,7 +652,7 @@ describe('Share a file', () => {
it('[C286665] Share a file from the context menu', async () => {
await dataTable.rightClickOnItem(file9);
await contextMenu.waitForMenuToOpen();
await contextMenu.shareAction.click();
await BrowserActions.click(contextMenu.shareAction);
await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl();
@@ -735,7 +735,7 @@ describe('Share a file', () => {
const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl);
await shareDialog.urlAction.click();
await BrowserActions.click(shareDialog.urlAction);
expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard');
await browser.get(url);
@@ -764,7 +764,7 @@ describe('Share a file', () => {
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty');
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked');
expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty');
@@ -792,7 +792,8 @@ describe('Share a file', () => {
it('[C286656] Open Share dialog from context menu', async () => {
await dataTable.rightClickOnItem(file7);
await contextMenu.waitForMenuToOpen();
await contextMenu.shareEditAction.click();
await BrowserActions.click(contextMenu.shareEditAction);
await shareDialog.waitForDialogToOpen();
expect(await shareDialog.getTitle()).toEqual(`Share ${file7}`);
@@ -904,7 +905,7 @@ describe('Share a file', () => {
const url = await shareDialog.getLinkUrl();
expect(url).toContain(shareLinkPreUrl);
await shareDialog.urlAction.click();
await BrowserActions.click(shareDialog.urlAction);
expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard');
await browser.get(url);
@@ -919,9 +920,9 @@ describe('Share a file', () => {
await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked');
await shareDialog.datetimePickerButton.click();
await BrowserActions.click(shareDialog.datetimePickerButton);
expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened');
const date = await shareDialog.dateTimePicker.setDefaultDay();
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
@@ -955,7 +956,7 @@ describe('Share a file', () => {
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty');
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked');
expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty');
@@ -983,7 +984,7 @@ describe('Share a file', () => {
it('[C286674] Share a file from the context menu', async () => {
await dataTable.rightClickOnItem(file9);
await contextMenu.waitForMenuToOpen();
await contextMenu.shareAction.click();
await BrowserActions.click(contextMenu.shareAction);
await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl();
@@ -1055,9 +1056,9 @@ describe('Share a file', () => {
await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen();
await shareDialog.expireToggle.click();
await BrowserActions.click(shareDialog.expireToggle);
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked');
await shareDialog.datetimePickerButton.click();
await BrowserActions.click(shareDialog.datetimePickerButton);
expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened');
const date = await shareDialog.dateTimePicker.setDefaultDay();
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();

View File

@@ -61,7 +61,7 @@ describe('Pagination on multiple pages : ', () => {
initialFavoritesTotalItems = await userApi.favorites.getFavoritesTotalItems();
await userApi.shared.shareFilesByIds(filesIds);
await userApi.favorites.addFavoritesByIds('file', filesIds);
}, 300000);
});
afterAll(async () => {
await userApi.nodes.deleteNodeById(parentId);
@@ -74,28 +74,28 @@ describe('Pagination on multiple pages : ', () => {
describe('on Recent Files', () => {
beforeAll(async () => {
await userApi.search.waitForApi(username, { expect: initialSearchTotalItems + 51 });
}, 300000);
});
recentFilesTests(username);
});
describe('on Search Results', () => {
beforeAll(async () => {
await userApi.search.waitForApi(username, { expect: initialSearchTotalItems + 51 });
}, 300000);
});
searchResultsTests(username);
});
describe('on Shared Files', () => {
beforeAll(async () => {
await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 51 });
}, 300000);
});
sharedFilesTests(username);
});
describe('on Favorites', () => {
beforeAll(async () => {
await userApi.favorites.waitForApi({ expect: initialFavoritesTotalItems + 51 });
}, 300000);
});
favoritesTests(username);
});
});

View File

@@ -56,7 +56,7 @@ describe('Pagination on multiple pages', () => {
} catch (error) {
Logger.error(`----- beforeAll failed : ${error}`);
}
}, 450000);
});
afterAll(async () => {
try {
@@ -65,7 +65,7 @@ describe('Pagination on multiple pages', () => {
} catch (error) {
Logger.error(`----- afterAll failed : ${error}`);
}
}, 420000);
});
describe('on My Libraries', () => {
beforeAll(async () => {

View File

@@ -54,7 +54,7 @@ describe('Pagination on multiple pages on Trash', () => {
await loginPage.loginWith(username);
await page.clickTrashAndWait();
}, 300000);
});
afterEach(async () => {
await Utils.pressEscape();

View File

@@ -17,8 +17,7 @@
"lint": "ng lint && npm run spellcheck && npm run e2e.typecheck",
"update-webdriver": "./scripts/update-webdriver.sh",
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
"e2e": "npm run update-webdriver && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:8080/content-app} $SUITE",
"e2e.local": "npm run update-webdriver && protractor --baseUrl=http://localhost:4200",
"e2e": "npm run update-webdriver && protractor $SUITE",
"spellcheck": "cspell '{src,e2e,projects}/**/*.ts'",
"inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json",
"validate-config": "ajv validate -s ./node_modules/@alfresco/adf-core/app.config.schema.json -d ./src/app.config.json --errors=text --verbose"

View File

@@ -276,7 +276,7 @@ export class DataTable extends Component {
async clearSelection(): Promise<void> {
try {
const count = await this.getSelectedRowsCount();
if (count !== 0) {
if (count > 0) {
await browser.refresh();
await this.wait();
}

View File

@@ -26,7 +26,7 @@
import { browser, by, protractor } from 'protractor';
import { Component } from '../component';
import { waitForPresence, waitElement } from '../../utilities/utils';
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
import { BrowserActions } from '@alfresco/adf-testing';
export class SearchInput extends Component {
searchButton = this.component.element(by.css('.app-search-button'));
@@ -47,10 +47,6 @@ export class SearchInput extends Component {
await waitForPresence(this.searchControl);
}
async waitForSearchInputToBeInteractive() {
await BrowserVisibility.waitUntilElementIsClickable(this.searchControl);
}
async isSearchContainerDisplayed() {
const isContainerDisplayed = await this.searchContainer.isDisplayed();
const isSearchButtonDisplayed = await this.searchButton.isDisplayed();
@@ -154,7 +150,6 @@ export class SearchInput extends Component {
}
async searchFor(text: string) {
await this.waitForSearchInputToBeInteractive();
await BrowserActions.clearWithBackSpace(this.searchInput);
await this.searchInput.sendKeys(text);
await this.searchInput.sendKeys(protractor.Key.ENTER);

View File

@@ -96,7 +96,8 @@ export abstract class Page {
async clickSnackBarAction(): Promise<void> {
try {
await BrowserActions.click(this.byCss('.mat-simple-snackbar-action button'));
const action = await waitElement('.mat-simple-snackbar-action button');
await action.click();
} catch (e) {
Logger.error(e, '.......failed on click snack bar action.........');
}

View File

@@ -144,7 +144,7 @@ exports.config = {
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 150000,
defaultTimeoutInterval: 600000,
includeStackTrace: true,
print: function () {},
...SmartRunner.withOptionalExclusions(resolve(__dirname, './e2e/protractor.excludes.json'))