mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
Prettier upgrade and e2e type checks (#1522)
* upgrade prettier * noImplicitAny rule * fix type * update tsconfig * upgrade to 150 print width
This commit is contained in:
parent
32793ea7b0
commit
ddc6f36ab4
@ -1,5 +1,4 @@
|
||||
node_modules
|
||||
src/assets/i18n
|
||||
e2e
|
||||
/angular.json
|
||||
docs/**/*.md
|
||||
|
@ -1,3 +1,5 @@
|
||||
{
|
||||
"singleQuote": true
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 150
|
||||
}
|
||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -3,7 +3,7 @@
|
||||
"javascript.preferences.importModuleSpecifier": "relative",
|
||||
"typescript.preferences.quoteStyle": "single",
|
||||
"typescript.preferences.importModuleSpecifier": "relative",
|
||||
"editor.formatOnSave": false,
|
||||
"editor.formatOnSave": true,
|
||||
"[json]": {
|
||||
"editor.formatOnSave": false
|
||||
},
|
||||
|
@ -31,7 +31,6 @@ export function favoritesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
@ -41,7 +40,6 @@ export function favoritesTests() {
|
||||
});
|
||||
|
||||
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);
|
||||
@ -53,22 +51,38 @@ export function favoritesTests() {
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C297620]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesToolbarPrimary, testData.fileDocxSharedFav.favoritesToolbarMore);
|
||||
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.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.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.checkToolbarActions(
|
||||
testData.fileSharedFavLocked.name,
|
||||
testData.fileSharedFavLocked.favoritesToolbarPrimary,
|
||||
testData.fileSharedFavLocked.favoritesToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
@ -82,23 +96,48 @@ export function favoritesTests() {
|
||||
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -36,7 +36,7 @@ import { trashTests } from './trash';
|
||||
describe('Files / folders actions : ', () => {
|
||||
const random = Utils.random();
|
||||
|
||||
const username = `user-${random}`
|
||||
const username = `user-${random}`;
|
||||
|
||||
const parent = `parent-${random}`;
|
||||
|
||||
@ -68,7 +68,7 @@ describe('Files / folders actions : ', () => {
|
||||
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocx.name );
|
||||
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;
|
||||
@ -166,5 +166,4 @@ describe('Files / folders actions : ', () => {
|
||||
describe('on Trash : ', () => {
|
||||
trashTests();
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -32,7 +32,6 @@ export function personalFilesTests(parentName?: string) {
|
||||
const { dataTable } = page;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parentName);
|
||||
@ -44,7 +43,6 @@ export function personalFilesTests(parentName?: string) {
|
||||
});
|
||||
|
||||
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);
|
||||
@ -71,7 +69,11 @@ export function personalFilesTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C297616]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.toolbarPrimary,
|
||||
testData.fileDocxSharedFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
@ -96,18 +98,25 @@ export function personalFilesTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File shared, locked - [C280453]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
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.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);
|
||||
@ -121,28 +130,51 @@ export function personalFilesTests(parentName?: string) {
|
||||
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -31,7 +31,6 @@ export function recentFilesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
@ -67,7 +66,11 @@ export function recentFilesTests() {
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C280616]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.toolbarPrimary,
|
||||
testData.fileDocxSharedFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
@ -92,32 +95,51 @@ export function recentFilesTests() {
|
||||
});
|
||||
|
||||
it('File shared, locked - [C297636]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
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.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);
|
||||
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);
|
||||
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);
|
||||
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
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ export function searchResultsTests() {
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
});
|
||||
@ -43,7 +42,6 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
@ -57,7 +55,11 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('File Office, favorite - [C291827]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.searchToolbarPrimary, testData.fileDocxFav.searchToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxFav.name,
|
||||
testData.fileDocxFav.searchToolbarPrimary,
|
||||
testData.fileDocxFav.searchToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.searchContextMenu);
|
||||
});
|
||||
|
||||
@ -72,12 +74,20 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('File Office, shared - [C297627]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.searchToolbarPrimary, testData.fileDocxShared.searchToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxShared.name,
|
||||
testData.fileDocxShared.searchToolbarPrimary,
|
||||
testData.fileDocxShared.searchToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C280631]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchToolbarPrimary, testData.fileDocxSharedFav.searchToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.searchToolbarPrimary,
|
||||
testData.fileDocxSharedFav.searchToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchContextMenu);
|
||||
});
|
||||
|
||||
@ -87,7 +97,11 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C280641]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.searchToolbarPrimary, testData.fileSharedFav.searchToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.searchToolbarPrimary,
|
||||
testData.fileSharedFav.searchToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.searchContextMenu);
|
||||
});
|
||||
|
||||
@ -97,23 +111,34 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('File favorite, locked - [C280648]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.searchToolbarPrimary, testData.fileFavLocked.searchToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileFavLocked.name,
|
||||
testData.fileFavLocked.searchToolbarPrimary,
|
||||
testData.fileFavLocked.searchToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - [C280574]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.searchToolbarPrimary, testData.fileSharedLocked.searchToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedLocked.name,
|
||||
testData.fileSharedLocked.searchToolbarPrimary,
|
||||
testData.fileSharedLocked.searchToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.searchContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - [C280642]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.searchToolbarPrimary, testData.fileSharedFavLocked.searchToolbarMore);
|
||||
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();
|
||||
@ -133,7 +158,6 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
@ -142,18 +166,36 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('multiple files - [C291820]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.file.name, testData.fileDocxShared.name], testData.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.file.name, testData.fileDocxShared.name],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSel.searchToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - [C326690]', 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);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileDocxFav.name, testData.fileSharedFav.name],
|
||||
testData.multipleSelAllFav.searchContextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileDocxFav.name, testData.fileSharedFav.name],
|
||||
testData.multipleSelAllFav.searchToolbarPrimary,
|
||||
testData.multipleSelAllFav.searchToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C297626]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileLocked.name, testData.fileSharedFavLocked.name],
|
||||
testData.multipleSel.searchContextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileLocked.name, testData.fileSharedFavLocked.name],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSel.searchToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple folders - [C291821]', async () => {
|
||||
@ -161,8 +203,12 @@ export function searchResultsTests() {
|
||||
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);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.folder.name, testData.folderFav.name], testData.multipleSel.searchContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.folder.name, testData.folderFav.name],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSel.searchToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('both files and folders - [C291822]', async () => {
|
||||
@ -170,8 +216,12 @@ export function searchResultsTests() {
|
||||
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);
|
||||
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
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -31,7 +31,6 @@ export function sharedFilesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
@ -47,7 +46,11 @@ export function sharedFilesTests() {
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C280652]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.toolbarPrimary,
|
||||
testData.fileDocxSharedFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
@ -62,32 +65,57 @@ export function sharedFilesTests() {
|
||||
});
|
||||
|
||||
it('File shared, locked - [C286274]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
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.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);
|
||||
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);
|
||||
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);
|
||||
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
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -29,26 +29,203 @@ export const trashActions = ['Permanently Delete', 'Restore'];
|
||||
|
||||
// ----- files -----
|
||||
|
||||
const fileContextMenu = ['Share', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileSharedFavLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileSharedFavLockedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
const fileToolbarMore = ['Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileDocxToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileDocxContextMenu = ['Share', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileDocxToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileDocxContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileSharedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
const fileFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileDocxFavContextMenu = ['Share', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileDocxSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileDocxSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileFavContextMenu = ['Share', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileFavLockedToolbarMore = [
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileDocxFavContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileDocxFavToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileDocxSharedFavContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileDocxSharedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileFavContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileFavToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileFavLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileSharedFavContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileSharedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileFavLockedContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileLockedContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const fileLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileSharedLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const fileSharedLockedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
|
||||
// ---- VIEWER ----
|
||||
|
||||
@ -56,58 +233,263 @@ const viewerSharedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Se
|
||||
const viewerToolbarPrimary = ['Activate full-screen mode', 'Share', 'Download', 'Print', 'View Details', 'More Actions'];
|
||||
const viewerToolbarMore = ['Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const viewerFavToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const viewerDocxToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const viewerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const viewerDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const viewerDocxToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const viewerFavLockedToolbarMore = [
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const viewerDocxFavToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const viewerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
|
||||
|
||||
// ---- FAVORITES workarounds ----
|
||||
|
||||
// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
|
||||
const favoritesContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
// TODO: investigate why 'Permissions' is not displayed and raise issue
|
||||
const favoritesLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
const favoritesLockedContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions'
|
||||
];
|
||||
// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
|
||||
const favoritesToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
// TODO: investigate why 'Permissions' is not displayed and raise issue
|
||||
const favoritesLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
|
||||
const favoritesSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
const favoritesSharedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions'
|
||||
];
|
||||
// TODO: investigate why 'Permissions' is not displayed and raise issue
|
||||
const favoritesSharedLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
const favoritesSharedLockedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions'
|
||||
];
|
||||
|
||||
// ---- SEARCH workarounds ----
|
||||
|
||||
const searchDocxContextMenu = ['Share', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchDocxContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchToolbarPrimary = ['Toggle search filter', 'Share', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
const searchSharedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
const searchFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchSharedFavLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchDocxToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchFavContextMenu = ['Share', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchSharedLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchDocxFavContextMenu = ['Share', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchSharedFavLockedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchDocxToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchFavContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchSharedLockedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchDocxFavContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchDocxFavToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchSharedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchToolbarMore = ['Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchDocxSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchDocxSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchDocxSharedFavContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchDocxSharedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchFavToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchContextMenu = ['Share', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchFavLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchFavLockedContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchLockedContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchSharedFavContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
|
||||
const searchViewerToolbarMore = ['Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchViewerFavToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchViewerDocxToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchViewerDocxToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchViewerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchViewerDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const searchViewerDocxFavToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
const searchViewerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
|
||||
|
||||
export const fileDocx = {
|
||||
name: `file-docx-${Utils.random()}.docx`,
|
||||
description: 'file not shared, not fav, office, not locked',
|
||||
@ -140,7 +522,7 @@ export const fileDocxFav = {
|
||||
searchContextMenu: searchDocxFavContextMenu,
|
||||
searchToolbarPrimary,
|
||||
searchToolbarMore: searchDocxFavToolbarMore,
|
||||
searchViewerToolbarMore: searchViewerDocxFavToolbarMore,
|
||||
searchViewerToolbarMore: searchViewerDocxFavToolbarMore
|
||||
};
|
||||
|
||||
export const file = {
|
||||
@ -405,7 +787,6 @@ export const folderFav2 = {
|
||||
|
||||
// ---- multiple selection ---
|
||||
|
||||
|
||||
// TODO: raise issue to remove 'Permissions'
|
||||
const multipleSelContextMenu = ['Download', 'Favorite', 'Move', 'Copy', 'Delete', 'Permissions'];
|
||||
// TODO: raise issue to remove 'Permissions'
|
||||
@ -429,7 +810,6 @@ const searchMultipleSelToolbarMore = ['Favorite', 'Copy', 'Permissions'];
|
||||
// TODO: raise issue to remove 'Permissions'
|
||||
const searchMultipleSelAllFavToolbarMore = ['Remove Favorite', 'Copy', 'Permissions'];
|
||||
|
||||
|
||||
export const multipleSel = {
|
||||
contextMenu: multipleSelContextMenu,
|
||||
toolbarPrimary: multipleSelToolbarPrimary,
|
||||
@ -438,7 +818,7 @@ export const multipleSel = {
|
||||
searchContextMenu: searchMultipleSelContextMenu,
|
||||
searchToolbarMore: searchMultipleSelToolbarMore,
|
||||
searchToolbarPrimary: searchMultipleSelToolbarPrimary
|
||||
}
|
||||
};
|
||||
|
||||
export const multipleSelAllFav = {
|
||||
contextMenu: multipleSelAllFavContextMenu,
|
||||
@ -451,4 +831,4 @@ export const multipleSelAllFav = {
|
||||
searchToolbarPrimary: searchMultipleSelToolbarPrimary,
|
||||
searchContextMenu: searchMultipleSelAllFavContextMenu,
|
||||
searchToolbarMore: searchMultipleSelAllFavToolbarMore
|
||||
}
|
||||
};
|
||||
|
@ -31,7 +31,6 @@ export function trashTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickTrashAndWait();
|
||||
});
|
||||
@ -51,19 +50,18 @@ export function trashTests() {
|
||||
});
|
||||
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.fileInTrash.name, testData.folderInTrash.name], testData.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([testData.fileInTrash.name, testData.folderInTrash.name], testData.trashActions);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -34,13 +34,11 @@ export function viewerTests(parentName?: string) {
|
||||
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);
|
||||
@ -52,7 +50,11 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, favorite - [C297583]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxFav.name,
|
||||
testData.fileDocxFav.viewerToolbarPrimary,
|
||||
testData.fileDocxFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File simple - [C297587]', async () => {
|
||||
@ -64,11 +66,19 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared - [C297597]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
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);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.viewerToolbarPrimary,
|
||||
testData.fileDocxSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared - [C291831]', async () => {
|
||||
@ -76,7 +86,11 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C297632]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.viewerToolbarPrimary,
|
||||
testData.fileSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File locked - [C291832]', async () => {
|
||||
@ -84,20 +98,31 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File favorite, locked - [C297593]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
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);
|
||||
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);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFavLocked.name,
|
||||
testData.fileSharedFavLocked.viewerToolbarPrimary,
|
||||
testData.fileSharedFavLocked.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('file opened from Recent Files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
@ -107,7 +132,11 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, favorite - [C297600]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxFav.name,
|
||||
testData.fileDocxFav.viewerToolbarPrimary,
|
||||
testData.fileDocxFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File simple - [C326692]', async () => {
|
||||
@ -119,11 +148,19 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared - [C326694]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
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);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.viewerToolbarPrimary,
|
||||
testData.fileDocxSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared - [C326696]', async () => {
|
||||
@ -131,7 +168,11 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C326697]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.viewerToolbarPrimary,
|
||||
testData.fileSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File locked - [C326698]', async () => {
|
||||
@ -139,26 +180,41 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File favorite, locked - [C326701]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxFav.name,
|
||||
testData.fileDocxFav.viewerToolbarPrimary,
|
||||
testData.fileDocxFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File favorite - [C326703]', async () => {
|
||||
@ -166,34 +222,57 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C326704]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.viewerToolbarPrimary,
|
||||
testData.fileDocxSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared - [C326710]', async () => {
|
||||
@ -201,20 +280,31 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C326711]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
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);
|
||||
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);
|
||||
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-');
|
||||
@ -226,7 +316,11 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, favorite - [C326715]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.searchViewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxFav.name,
|
||||
testData.fileDocxFav.viewerToolbarPrimary,
|
||||
testData.fileDocxFav.searchViewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File simple - [C326716]', async () => {
|
||||
@ -238,37 +332,68 @@ export function viewerTests(parentName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared - [C326718]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.searchViewerToolbarMore);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFavLocked.name,
|
||||
testData.fileSharedFavLocked.viewerToolbarPrimary,
|
||||
testData.fileSharedFavLocked.searchViewerToolbarMore
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
NodeContentTree,
|
||||
Utils,
|
||||
AdminActions
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, RepoClient, NodeContentTree, Utils, AdminActions } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Generic tests : ', () => {
|
||||
const random = Utils.random();
|
||||
@ -122,7 +115,6 @@ describe('Generic tests : ', () => {
|
||||
});
|
||||
|
||||
describe('Actions are not displayed when no item is selected', () => {
|
||||
|
||||
it('[C213120] on Personal Files', async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
@ -175,14 +167,14 @@ describe('Generic tests : ', () => {
|
||||
});
|
||||
|
||||
it('[C286268] Context menu appears on right click on a multiple selection of items', async () => {
|
||||
await dataTable.selectMultipleItems([ file1, file2 ]);
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
|
||||
});
|
||||
|
||||
it('[C286269] Context menu appears when right clicking on a single item while having multiple items selected', async () => {
|
||||
await dataTable.selectMultipleItems([ file2, folder1 ]);
|
||||
await dataTable.selectMultipleItems([file2, folder1]);
|
||||
await dataTable.rightClickOnItem(file1);
|
||||
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed for ${file1}`);
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SearchResultsPage,
|
||||
RepoClient,
|
||||
Utils,
|
||||
AdminActions
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, RepoClient, Utils, AdminActions } from '@alfresco/aca-testing-shared';
|
||||
import * as testData from './test-data-libraries';
|
||||
import * as testUtil from '../test-util';
|
||||
|
||||
@ -69,14 +62,15 @@ describe('Library actions : ', () => {
|
||||
await userApi.sites.createSite(testData.siteInTrash.name);
|
||||
await userApi.sites.createSite(testData.site2InTrash.name);
|
||||
|
||||
await Promise.all([
|
||||
userApi.sites.waitForApi({ expect: 8 }),
|
||||
adminApiActions.sites.waitForApi({ expect: 6 + 1 })
|
||||
]);
|
||||
await Promise.all([userApi.sites.waitForApi({ expect: 8 }), adminApiActions.sites.waitForApi({ expect: 6 + 1 })]);
|
||||
|
||||
await userApi.favorites.removeFavoritesByIds([publicUserMemberNotFavId, privateUserMemberNotFavId, moderatedUserMemberNotFavId]);
|
||||
|
||||
await userApi.favorites.addFavoritesByIds('site', [testData.publicNotMemberFav.name, testData.moderatedNotMemberFav.name, testData.moderatedRequestedJoinFav.name]);
|
||||
await userApi.favorites.addFavoritesByIds('site', [
|
||||
testData.publicNotMemberFav.name,
|
||||
testData.moderatedNotMemberFav.name,
|
||||
testData.moderatedRequestedJoinFav.name
|
||||
]);
|
||||
|
||||
await userApi.sites.requestToJoin(testData.moderatedRequestedJoinFav.name);
|
||||
await userApi.sites.requestToJoin(testData.moderatedRequestedJoinNotFav.name);
|
||||
@ -114,7 +108,6 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
describe('on My Libraries', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await Utils.pressEscape();
|
||||
await page.goToMyLibrariesAndWait();
|
||||
@ -125,39 +118,61 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
it('[C213135] Public library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarPrimary, testData.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.publicUserMemberFav.name,
|
||||
testData.publicUserMemberFav.toolbarPrimary,
|
||||
testData.publicUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C290080] Private library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarPrimary, testData.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.privateUserMemberFav.name,
|
||||
testData.privateUserMemberFav.toolbarPrimary,
|
||||
testData.privateUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326676] Moderated library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarPrimary, testData.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedUserMemberFav.name,
|
||||
testData.moderatedUserMemberFav.toolbarPrimary,
|
||||
testData.moderatedUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326677] Public library, user is a member, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.toolbarPrimary, testData.publicUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.publicUserMemberNotFav.name,
|
||||
testData.publicUserMemberNotFav.toolbarPrimary,
|
||||
testData.publicUserMemberNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326678] Private library, user is a member, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.toolbarPrimary, testData.privateUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.privateUserMemberNotFav.name,
|
||||
testData.privateUserMemberNotFav.toolbarPrimary,
|
||||
testData.privateUserMemberNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326679] Moderated library, user is a member, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.toolbarPrimary, testData.moderatedUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedUserMemberNotFav.name,
|
||||
testData.moderatedUserMemberNotFav.toolbarPrimary,
|
||||
testData.moderatedUserMemberNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on Favorite Libraries', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await Utils.pressEscape();
|
||||
await page.goToFavoriteLibrariesAndWait();
|
||||
@ -168,38 +183,61 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
it('[C289892] Public library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarPrimary, testData.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.publicUserMemberFav.name,
|
||||
testData.publicUserMemberFav.toolbarPrimary,
|
||||
testData.publicUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C290090] Private library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarPrimary, testData.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.privateUserMemberFav.name,
|
||||
testData.privateUserMemberFav.toolbarPrimary,
|
||||
testData.privateUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C290091] Moderated library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarPrimary, testData.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedUserMemberFav.name,
|
||||
testData.moderatedUserMemberFav.toolbarPrimary,
|
||||
testData.moderatedUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C290081] Public library, user not a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.publicNotMemberFav.name, testData.publicNotMemberFav.toolbarPrimary, testData.publicNotMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.publicNotMemberFav.name,
|
||||
testData.publicNotMemberFav.toolbarPrimary,
|
||||
testData.publicNotMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.publicNotMemberFav.name, testData.publicNotMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C290082] Moderated library, user not a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.toolbarPrimary, testData.moderatedNotMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedNotMemberFav.name,
|
||||
testData.moderatedNotMemberFav.toolbarPrimary,
|
||||
testData.moderatedNotMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C290089] Moderated library, user requested to join, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.toolbarPrimary, testData.moderatedRequestedJoinFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedRequestedJoinFav.name,
|
||||
testData.moderatedRequestedJoinFav.toolbarPrimary,
|
||||
testData.moderatedRequestedJoinFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.contextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Search Results', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await Utils.pressEscape();
|
||||
await page.clickPersonalFiles();
|
||||
@ -213,62 +251,110 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
it('[C290084] Public library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.searchToolbarPrimary, testData.publicUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.publicUserMemberFav.name,
|
||||
testData.publicUserMemberFav.searchToolbarPrimary,
|
||||
testData.publicUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C290085] Private library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.searchToolbarPrimary, testData.privateUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.privateUserMemberFav.name,
|
||||
testData.privateUserMemberFav.searchToolbarPrimary,
|
||||
testData.privateUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C290086] Moderated library, user is a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.searchToolbarPrimary, testData.moderatedUserMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedUserMemberFav.name,
|
||||
testData.moderatedUserMemberFav.searchToolbarPrimary,
|
||||
testData.moderatedUserMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C291812] Public library, user is a member, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.searchToolbarPrimary, testData.publicUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.publicUserMemberNotFav.name,
|
||||
testData.publicUserMemberNotFav.searchToolbarPrimary,
|
||||
testData.publicUserMemberNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C291813] Private library, user is a member, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.searchToolbarPrimary, testData.privateUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.privateUserMemberNotFav.name,
|
||||
testData.privateUserMemberNotFav.searchToolbarPrimary,
|
||||
testData.privateUserMemberNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C291814] Moderated library, user is a member, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.searchToolbarPrimary, testData.moderatedUserMemberNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedUserMemberNotFav.name,
|
||||
testData.moderatedUserMemberNotFav.searchToolbarPrimary,
|
||||
testData.moderatedUserMemberNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326680] Public library, user not a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.publicNotMemberFav.name, testData.publicNotMemberFav.searchToolbarPrimary, testData.publicNotMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.publicNotMemberFav.name,
|
||||
testData.publicNotMemberFav.searchToolbarPrimary,
|
||||
testData.publicNotMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.publicNotMemberFav.name, testData.publicNotMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326681] Moderated library, user not a member, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.searchToolbarPrimary, testData.moderatedNotMemberFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedNotMemberFav.name,
|
||||
testData.moderatedNotMemberFav.searchToolbarPrimary,
|
||||
testData.moderatedNotMemberFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326682] Public library, user not a member, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.publicNotMemberNotFav.name, testData.publicNotMemberNotFav.searchToolbarPrimary, testData.publicNotMemberNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.publicNotMemberNotFav.name,
|
||||
testData.publicNotMemberNotFav.searchToolbarPrimary,
|
||||
testData.publicNotMemberNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.publicNotMemberNotFav.name, testData.publicNotMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326683] Moderated library, user not a member, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedNotMemberNotFav.name, testData.moderatedNotMemberNotFav.searchToolbarPrimary, testData.moderatedNotMemberNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedNotMemberNotFav.name,
|
||||
testData.moderatedNotMemberNotFav.searchToolbarPrimary,
|
||||
testData.moderatedNotMemberNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedNotMemberNotFav.name, testData.moderatedNotMemberNotFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326685] Moderated library, user requested to join, favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.searchToolbarPrimary, testData.moderatedRequestedJoinFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedRequestedJoinFav.name,
|
||||
testData.moderatedRequestedJoinFav.searchToolbarPrimary,
|
||||
testData.moderatedRequestedJoinFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.contextMenu);
|
||||
});
|
||||
|
||||
it('[C326684] Moderated library, user requested to join, not favorite', async () => {
|
||||
await testUtil.checkToolbarActions(testData.moderatedRequestedJoinNotFav.name, testData.moderatedRequestedJoinNotFav.searchToolbarPrimary, testData.moderatedRequestedJoinNotFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.moderatedRequestedJoinNotFav.name,
|
||||
testData.moderatedRequestedJoinNotFav.searchToolbarPrimary,
|
||||
testData.moderatedRequestedJoinNotFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.moderatedRequestedJoinNotFav.name, testData.moderatedRequestedJoinNotFav.contextMenu);
|
||||
});
|
||||
});
|
||||
@ -289,8 +375,8 @@ describe('Library actions : ', () => {
|
||||
});
|
||||
|
||||
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);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.siteInTrash.name, testData.site2InTrash.name], testData.trashActions);
|
||||
await testUtil.checkMultipleSelToolbarPrimary([testData.siteInTrash.name, testData.site2InTrash.name], testData.trashActions);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -29,7 +29,6 @@ import { Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
export const trashActions = ['Permanently Delete', 'Restore'];
|
||||
|
||||
|
||||
// ---- single selection ----
|
||||
|
||||
const memberFavContextMenu = ['Leave Library', 'Delete', 'Remove Favorite'];
|
||||
@ -47,7 +46,6 @@ const notMemberToolbarPrimary = ['Join', 'More Actions'];
|
||||
const reqJoinNotFavContextMenu = ['Cancel Join Request', 'Delete', 'Favorite'];
|
||||
const reqJoinFavContextMenu = ['Cancel Join Request', 'Delete', 'Remove Favorite'];
|
||||
|
||||
|
||||
export const publicUserMemberFav = {
|
||||
name: `site-public-member-fav-${Utils.random()}`,
|
||||
description: 'public site, user member, user favorite',
|
||||
@ -177,4 +175,3 @@ export const site2InTrash = {
|
||||
name: `deleted-site2-${Utils.random()}`,
|
||||
trashActions
|
||||
};
|
||||
|
||||
|
@ -31,7 +31,6 @@ export function favoritesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
@ -45,76 +44,117 @@ export function favoritesTests() {
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office, favorite - [C286311]', 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 - [C306991]', 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 - [C279187]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.toolbarPrimary,
|
||||
testData.fileDocxSharedFav.favoritesToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C280053]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.favoritesToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.toolbarPrimary,
|
||||
testData.fileSharedFav.favoritesToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File favorite, locked - [C280050]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.favoritesToolbarMore);
|
||||
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 - [C325011]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.favoritesToolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - [C325011]', async () => {
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedFavLocked.name,
|
||||
testData.fileSharedFavLocked.toolbarPrimary,
|
||||
testData.fileSharedFavLocked.favoritesToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
it('Folder favorite - [C325012]', 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 - [C325046]', 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);
|
||||
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 - [C217145]', 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);
|
||||
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 - [C213196]', 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);
|
||||
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 - [C217146]', 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);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.fileFav.name, testData.folderFav.name], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileFav.name, testData.folderFav.name],
|
||||
testData.multipleSelAllFav.toolbarPrimary,
|
||||
testData.multipleSelAllFav.favoritesToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - [C213193]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.favoritesContextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileFav.name, testData.fileGranularPermission],
|
||||
testData.multipleSelAllFav.favoritesContextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileFav.name, testData.fileGranularPermission],
|
||||
testData.multipleSelAllFav.toolbarPrimary,
|
||||
testData.multipleSelAllFav.favoritesToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ export function librariesTests(siteName?: string) {
|
||||
const { dataTable } = page;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
@ -48,7 +47,6 @@ export function librariesTests(siteName?: string) {
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
it('File Office - [C280476]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.toolbarPrimary, testData.fileDocx.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
|
||||
@ -75,7 +73,11 @@ export function librariesTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C280466]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.toolbarPrimary,
|
||||
testData.fileDocxSharedFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
@ -100,19 +102,25 @@ export function librariesTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File shared, locked - [C280666]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
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 - [C280669]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
|
||||
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 - [C280456]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.folder.name, testData.folder.toolbarPrimary, testData.folder.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folder.name, testData.folder.contextMenu);
|
||||
@ -125,37 +133,65 @@ export function librariesTests(siteName?: string) {
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
it('multiple files - [C286264]', 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);
|
||||
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 - [C286283]', 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);
|
||||
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 - [C280478]', 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);
|
||||
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 - [C213121]', 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);
|
||||
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 - [C286266]', 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);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.file.name, testData.folder.name], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.file.name, testData.folder.name],
|
||||
testData.multipleSel.toolbarPrimary,
|
||||
testData.multipleSel.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - [C286285]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileDocxFav.name, testData.fileGranularPermission],
|
||||
testData.multipleSelAllFav.contextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileDocxFav.name, testData.fileGranularPermission],
|
||||
testData.multipleSel.toolbarPrimary,
|
||||
testData.multipleSelAllFav.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ const { searchInput } = searchResultsPage.header;
|
||||
|
||||
export function collaboratorTests(siteName?: string) {
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
@ -91,7 +90,15 @@ export function collaboratorTests(siteName?: string) {
|
||||
await dataTable.waitForHeader();
|
||||
|
||||
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
||||
const expectedToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const expectedToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
@ -100,7 +107,15 @@ export function collaboratorTests(siteName?: string) {
|
||||
await page.clickSharedFilesAndWait();
|
||||
|
||||
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
||||
const expectedToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const expectedToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
@ -109,7 +124,15 @@ export function collaboratorTests(siteName?: string) {
|
||||
await page.clickFavoritesAndWait();
|
||||
|
||||
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
||||
const expectedToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const expectedToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
@ -120,7 +143,15 @@ export function collaboratorTests(siteName?: string) {
|
||||
await searchResultsPage.waitForResults();
|
||||
|
||||
const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
|
||||
const expectedToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
|
||||
const expectedToolbarMore = [
|
||||
'Edit in Microsoft Office™',
|
||||
'Edit Offline',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
@ -225,7 +256,6 @@ export function filesLockedByCurrentUser(siteName?: string) {
|
||||
|
||||
export function filesLockedByOtherUser(siteName?: string) {
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
@ -250,7 +280,16 @@ export function filesLockedByOtherUser(siteName?: string) {
|
||||
|
||||
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
|
||||
// TODO: investigate why 'Upload New Version' appears and raise issue
|
||||
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
|
||||
const expectedToolbarMore = [
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions',
|
||||
'Permissions'
|
||||
];
|
||||
|
||||
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
|
||||
});
|
||||
|
@ -33,7 +33,6 @@ export function searchResultsTests() {
|
||||
const { searchInput } = page.header;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
@ -43,7 +42,6 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
describe('on a file', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
@ -72,12 +70,20 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('File Office, shared - [C286280]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.searchToolbarPrimary, testData.fileDocxShared.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxShared.name,
|
||||
testData.fileDocxShared.searchToolbarPrimary,
|
||||
testData.fileDocxShared.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C286281]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchToolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.searchToolbarPrimary,
|
||||
testData.fileDocxSharedFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
@ -87,7 +93,11 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C291823]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.searchToolbarPrimary, testData.fileSharedFav.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.searchToolbarPrimary,
|
||||
testData.fileSharedFav.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
|
||||
});
|
||||
|
||||
@ -97,24 +107,34 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('File favorite, locked - [C291819]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.searchToolbarPrimary, testData.fileFavLocked.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileFavLocked.name,
|
||||
testData.fileFavLocked.searchToolbarPrimary,
|
||||
testData.fileFavLocked.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - [C291824]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.searchToolbarPrimary, testData.fileSharedLocked.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedLocked.name,
|
||||
testData.fileSharedLocked.searchToolbarPrimary,
|
||||
testData.fileSharedLocked.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - [C291825]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.searchToolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedFavLocked.name,
|
||||
testData.fileSharedFavLocked.searchToolbarPrimary,
|
||||
testData.fileSharedFavLocked.toolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on a folder', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
@ -131,13 +151,10 @@ export function searchResultsTests() {
|
||||
await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.searchToolbarPrimary, testData.folderFav.toolbarMore);
|
||||
await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.contextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on multiple selection', () => {
|
||||
|
||||
describe('of files', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFiles();
|
||||
await searchInput.clickSearchButton();
|
||||
@ -146,23 +163,45 @@ export function searchResultsTests() {
|
||||
});
|
||||
|
||||
it('multiple files - [C291830]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.file.name, testData.fileDocxShared.name], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.file.name, testData.fileDocxShared.name],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSel.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple files - all favorite - [C291834]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileDocxFav.name, testData.fileSharedFav.name],
|
||||
testData.multipleSelAllFav.contextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileDocxFav.name, testData.fileSharedFav.name],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSelAllFav.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C291835]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.fileLocked.name, testData.fileSharedFavLocked.name], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileLocked.name, testData.fileSharedFavLocked.name],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSel.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - [C286310]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSel.searchToolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileDocxFav.name, testData.fileGranularPermission],
|
||||
testData.multipleSelAllFav.contextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileDocxFav.name, testData.fileGranularPermission],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSelAllFav.toolbarMore
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -171,8 +210,12 @@ export function searchResultsTests() {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('folder-');
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.folder.name, testData.folderFav.name], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.folder.name, testData.folderFav.name],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSel.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('both files and folders - [C268128]', async () => {
|
||||
@ -180,10 +223,13 @@ export function searchResultsTests() {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor(`=${testData.file.name} or =${testData.folderFav.name}`);
|
||||
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folderFav.name ], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu([testData.file.name, testData.folderFav.name], testData.multipleSel.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.file.name, testData.folderFav.name],
|
||||
testData.multipleSel.searchToolbarPrimary,
|
||||
testData.multipleSel.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ export function sharedFilesTests() {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
@ -45,14 +44,21 @@ export function sharedFilesTests() {
|
||||
});
|
||||
|
||||
describe('single selection', () => {
|
||||
|
||||
it('File Office, shared - [C326626]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.sharedToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxShared.name,
|
||||
testData.fileDocxShared.toolbarPrimary,
|
||||
testData.fileDocxShared.sharedToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C326627]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.toolbarPrimary,
|
||||
testData.fileDocxSharedFav.sharedToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
@ -62,45 +68,78 @@ export function sharedFilesTests() {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C326629]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.sharedToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.toolbarPrimary,
|
||||
testData.fileSharedFav.sharedToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, locked - [C326631]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.sharedToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedLocked.name,
|
||||
testData.fileSharedLocked.toolbarPrimary,
|
||||
testData.fileSharedLocked.sharedToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.sharedContextMenu);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - [C326632]', async () => {
|
||||
await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.sharedToolbarMore);
|
||||
await testUtil.checkToolbarActions(
|
||||
testData.fileSharedFavLocked.name,
|
||||
testData.fileSharedFavLocked.toolbarPrimary,
|
||||
testData.fileSharedFavLocked.sharedToolbarMore
|
||||
);
|
||||
await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.sharedContextMenu);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('multiple selection', () => {
|
||||
|
||||
it('multiple files - [C326634]', 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);
|
||||
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 - [C326635]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileSharedFav.name, testData.fileSharedFavLocked.name],
|
||||
testData.multipleSelAllFav.contextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileSharedFav.name, testData.fileSharedFavLocked.name],
|
||||
testData.multipleSel.toolbarPrimary,
|
||||
testData.multipleSelAllFav.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple locked files - [C326636]', 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);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileSharedLocked.name, testData.fileSharedFavLocked.name],
|
||||
testData.multipleSel.contextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileSharedLocked.name, testData.fileSharedFavLocked.name],
|
||||
testData.multipleSel.toolbarPrimary,
|
||||
testData.multipleSel.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('multiple files with different granular permissions - [C326639]', async () => {
|
||||
await testUtil.checkMultipleSelContextMenu([ testData.fileSharedFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
|
||||
await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedFav.name, testData.fileGranularPermission ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
|
||||
await testUtil.checkMultipleSelContextMenu(
|
||||
[testData.fileSharedFav.name, testData.fileGranularPermission],
|
||||
testData.multipleSelAllFav.contextMenu
|
||||
);
|
||||
await testUtil.checkMultipleSelToolbarActions(
|
||||
[testData.fileSharedFav.name, testData.fileGranularPermission],
|
||||
testData.multipleSel.toolbarPrimary,
|
||||
testData.multipleSelAllFav.toolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
RepoClient,
|
||||
Utils,
|
||||
AdminActions,
|
||||
FILES,
|
||||
SITE_ROLES
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, RepoClient, Utils, AdminActions, FILES, SITE_ROLES } from '@alfresco/aca-testing-shared';
|
||||
import * as testData from './test-data-permissions';
|
||||
import { librariesTests } from './my-libraries';
|
||||
import { favoritesTests } from './favorites';
|
||||
@ -85,7 +78,7 @@ describe('Special permissions : ', () => {
|
||||
await userManagerApi.sites.addSiteCollaborator(sitePrivate, userCollaborator);
|
||||
await userManagerApi.sites.addSiteManager(sitePrivate, userDemoted);
|
||||
|
||||
await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocx.name );
|
||||
await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocx.name);
|
||||
fileDocxFavId = (await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocxFav.name)).entry.id;
|
||||
await userManagerApi.nodes.createFile(testData.file.name, docLibId);
|
||||
fileFavId = (await userManagerApi.nodes.createFile(testData.fileFav.name, docLibId)).entry.id;
|
||||
@ -158,7 +151,6 @@ describe('Special permissions : ', () => {
|
||||
});
|
||||
|
||||
describe('Consumer', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginWith(userConsumer);
|
||||
});
|
||||
|
@ -55,11 +55,30 @@ const consumerViewerToolbarMore = ['Favorite', 'Copy', 'Manage Versions'];
|
||||
const favoritesConsumerToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
// TODO: remove 'Move' and 'Delete' when ACA-1737 is done
|
||||
// TODO: investigate why 'Upload New Version' appears and raise issue
|
||||
const favoritesConsumerContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
const favoritesConsumerContextMenu = [
|
||||
'Share',
|
||||
'Download',
|
||||
'View',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions'
|
||||
];
|
||||
// TODO: remove 'Move' and 'Delete' when ACA-1737 is done
|
||||
// TODO: investigate why 'Upload New Version' appears and raise issue
|
||||
const favoritesConsumerSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
|
||||
|
||||
const favoritesConsumerSharedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Move',
|
||||
'Copy',
|
||||
'Delete',
|
||||
'Manage Versions'
|
||||
];
|
||||
|
||||
// ---- SHARED FILES workaround ----
|
||||
|
||||
@ -77,13 +96,30 @@ const sharedConsumerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Versio
|
||||
const sharedConsumerContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions'];
|
||||
// TODO: investigate why 'Cancel Editing' appears and raise issue
|
||||
// TODO: investigate why 'Upload New Version' appears and raise issue
|
||||
const sharedConsumerLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions'];
|
||||
const sharedConsumerLockedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Favorite',
|
||||
'Copy',
|
||||
'Manage Versions'
|
||||
];
|
||||
// TODO: investigate why 'Upload New Version' appears and raise issue
|
||||
const sharedConsumerFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
||||
// TODO: investigate why 'Cancel Editing' appears and raise issue
|
||||
// TODO: investigate why 'Upload New Version' appears and raise issue
|
||||
const sharedConsumerFavLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
|
||||
|
||||
const sharedConsumerFavLockedContextMenu = [
|
||||
'Shared Link Settings',
|
||||
'Download',
|
||||
'View',
|
||||
'Cancel Editing',
|
||||
'Upload New Version',
|
||||
'Remove Favorite',
|
||||
'Copy',
|
||||
'Manage Versions'
|
||||
];
|
||||
|
||||
export const fileDocx = {
|
||||
name: `file-docx-${Utils.random()}.docx`,
|
||||
@ -316,7 +352,7 @@ export const folderFav = {
|
||||
favoritesContextMenu: favoritesConsumerFolderContextMenu,
|
||||
favoritesToolbarMore: favoritesConsumerFolderToolbarMore,
|
||||
|
||||
searchToolbarPrimary: searchConsumerFolderToolbarPrimary,
|
||||
searchToolbarPrimary: searchConsumerFolderToolbarPrimary
|
||||
};
|
||||
|
||||
export const folderFav2 = {
|
||||
@ -344,7 +380,6 @@ const favoritesMultipleSelAllFavContextMenu = ['Download', 'Remove Favorite', 'M
|
||||
// TODO: remove 'Move' and 'Delete' when ACA-1737 is done
|
||||
const favoritesMultipleSelAllFavToolbarMore = ['Remove Favorite', 'Move', 'Copy', 'Delete'];
|
||||
|
||||
|
||||
export const multipleSel = {
|
||||
contextMenu: multipleSelContextMenu,
|
||||
toolbarPrimary: multipleSelToolbarPrimary,
|
||||
@ -354,7 +389,7 @@ export const multipleSel = {
|
||||
favoritesToolbarMore: favoritesMultipleSelToolbarMore,
|
||||
|
||||
searchToolbarPrimary: searchMultipleSelToolbarPrimary
|
||||
}
|
||||
};
|
||||
|
||||
export const multipleSelAllFav = {
|
||||
contextMenu: multipleSelAllFavContextMenu,
|
||||
@ -365,4 +400,4 @@ export const multipleSelAllFav = {
|
||||
favoritesToolbarMore: favoritesMultipleSelAllFavToolbarMore,
|
||||
|
||||
searchToolbarPrimary: searchMultipleSelToolbarPrimary
|
||||
}
|
||||
};
|
||||
|
@ -34,7 +34,6 @@ export function viewerTests(siteName?: string) {
|
||||
const { searchInput } = page.header;
|
||||
|
||||
describe('available actions : ', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
@ -44,7 +43,6 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
describe('file opened from File Libraries', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
@ -56,7 +54,11 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, favorite - [C326623]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxFav.name,
|
||||
testData.fileDocxFav.viewerToolbarPrimary,
|
||||
testData.fileDocxFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File simple - [C326624]', async () => {
|
||||
@ -68,11 +70,19 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared - [C326637]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxShared.name,
|
||||
testData.fileDocxShared.viewerToolbarPrimary,
|
||||
testData.fileDocxShared.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C326638]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.viewerToolbarPrimary,
|
||||
testData.fileDocxSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared - [C326648]', async () => {
|
||||
@ -80,7 +90,11 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C326649]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.viewerToolbarPrimary,
|
||||
testData.fileSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File locked - [C326630]', async () => {
|
||||
@ -88,27 +102,41 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File favorite, locked - [C326633]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileFavLocked.name,
|
||||
testData.fileFavLocked.viewerToolbarPrimary,
|
||||
testData.fileFavLocked.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared, locked - [C326650]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedLocked.name,
|
||||
testData.fileSharedLocked.viewerToolbarPrimary,
|
||||
testData.fileSharedLocked.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - [C326651]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
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 - [C326652]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxFav.name,
|
||||
testData.fileDocxFav.viewerToolbarPrimary,
|
||||
testData.fileDocxFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File favorite - [C326653]', async () => {
|
||||
@ -116,35 +144,57 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C326655]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.viewerToolbarPrimary,
|
||||
testData.fileDocxSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C326656]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.viewerToolbarPrimary,
|
||||
testData.fileSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File favorite, locked - [C326654]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileFavLocked.name,
|
||||
testData.fileFavLocked.viewerToolbarPrimary,
|
||||
testData.fileFavLocked.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - [C326657]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
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 - [C326658]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxShared.name,
|
||||
testData.fileDocxShared.viewerToolbarPrimary,
|
||||
testData.fileDocxShared.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C326659]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.viewerToolbarPrimary,
|
||||
testData.fileDocxSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared - [C326660]', async () => {
|
||||
@ -152,21 +202,31 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C326661]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.viewerToolbarPrimary,
|
||||
testData.fileSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared, locked - [C326662]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedLocked.name,
|
||||
testData.fileSharedLocked.viewerToolbarPrimary,
|
||||
testData.fileSharedLocked.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - [C326663]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
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-');
|
||||
@ -178,7 +238,11 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, favorite - [C326665]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxFav.name,
|
||||
testData.fileDocxFav.viewerToolbarPrimary,
|
||||
testData.fileDocxFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File simple - [C326666]', async () => {
|
||||
@ -190,11 +254,19 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File Office, shared - [C326670]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxShared.name,
|
||||
testData.fileDocxShared.viewerToolbarPrimary,
|
||||
testData.fileDocxShared.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File Office, shared, favorite - [C326671]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileDocxSharedFav.name,
|
||||
testData.fileDocxSharedFav.viewerToolbarPrimary,
|
||||
testData.fileDocxSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared - [C326672]', async () => {
|
||||
@ -202,7 +274,11 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File shared, favorite - [C326673]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFav.name,
|
||||
testData.fileSharedFav.viewerToolbarPrimary,
|
||||
testData.fileSharedFav.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File locked - [C326668]', async () => {
|
||||
@ -210,17 +286,28 @@ export function viewerTests(siteName?: string) {
|
||||
});
|
||||
|
||||
it('File favorite, locked - [C326669]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileFavLocked.name,
|
||||
testData.fileFavLocked.viewerToolbarPrimary,
|
||||
testData.fileFavLocked.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared, locked - [C326674]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedLocked.name,
|
||||
testData.fileSharedLocked.viewerToolbarPrimary,
|
||||
testData.fileSharedLocked.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
it('File shared, favorite, locked - [C326675]', async () => {
|
||||
await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
|
||||
await testUtil.checkViewerActions(
|
||||
testData.fileSharedFavLocked.name,
|
||||
testData.fileSharedFavLocked.viewerToolbarPrimary,
|
||||
testData.fileSharedFavLocked.viewerToolbarMore
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -89,7 +89,11 @@ export async function checkMultipleSelToolbarPrimary(items: string[], expectedTo
|
||||
expect(actualPrimaryActions).toEqual(expectedToolbarPrimary);
|
||||
}
|
||||
|
||||
export async function checkMultipleSelToolbarActions(items: string[], expectedToolbarPrimary: string[], expectedToolbarMore: string[]): Promise<void> {
|
||||
export async function checkMultipleSelToolbarActions(
|
||||
items: string[],
|
||||
expectedToolbarPrimary: string[],
|
||||
expectedToolbarMore: string[]
|
||||
): Promise<void> {
|
||||
await dataTable.selectMultipleItems(items);
|
||||
|
||||
const actualPrimaryActions = await toolbar.getButtons();
|
||||
|
@ -23,51 +23,68 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
ContentNodeSelectorDialog,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Copy content', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const source = `source-${Utils.random()}`; let sourceId;
|
||||
const destinationPF = `destinationPersonal-${Utils.random()}`; let destinationIdPF;
|
||||
const destinationRF = `destinationRecent-${Utils.random()}`; let destinationIdRF;
|
||||
const destinationSF = `destinationShared-${Utils.random()}`; let destinationIdSF;
|
||||
const destinationFav = `destinationFav-${Utils.random()}`; let destinationIdFav;
|
||||
const destinationSearch = `destinationSearch-${Utils.random()}`; let destinationIdSearch;
|
||||
const source = `source-${Utils.random()}`;
|
||||
let sourceId: string;
|
||||
const destinationPF = `destinationPersonal-${Utils.random()}`;
|
||||
let destinationIdPF: string;
|
||||
const destinationRF = `destinationRecent-${Utils.random()}`;
|
||||
let destinationIdRF: string;
|
||||
const destinationSF = `destinationShared-${Utils.random()}`;
|
||||
let destinationIdSF: string;
|
||||
const destinationFav = `destinationFav-${Utils.random()}`;
|
||||
let destinationIdFav: string;
|
||||
const destinationSearch = `destinationSearch-${Utils.random()}`;
|
||||
let destinationIdSearch: string;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
const fileInFolder = `fileInFolder-${Utils.random()}.txt`; let fileInFolderId;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id: string;
|
||||
const fileInFolder = `fileInFolder-${Utils.random()}.txt`;
|
||||
let fileInFolderId: string;
|
||||
|
||||
const folder2 = `folder2-${Utils.random()}`; let folder2Id;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let folder2Id: string;
|
||||
const fileInFolder2 = fileInFolder;
|
||||
|
||||
const folderExisting = `folder-existing-${Utils.random()}`; let folderExistingId;
|
||||
const folderExisting = `folder-existing-${Utils.random()}`;
|
||||
let folderExistingId: string;
|
||||
const file1InFolderExisting = `file1InFolderExisting-${Utils.random()}.txt`;
|
||||
const file2InFolderExisting = `file2InFolderExisting-${Utils.random()}.txt`;
|
||||
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
const fileLocked1 = `file-locked1-${Utils.random()}.txt`; let fileLocked1Id;
|
||||
const fileLocked1 = `file-locked1-${Utils.random()}.txt`;
|
||||
let fileLocked1Id: string;
|
||||
|
||||
const folderWithLockedFiles = `folder-locked1-${Utils.random()}`; let folderWithLockedFilesId;
|
||||
const fileLockedInFolder = `file-locked-${Utils.random()}`; let fileLockedInFolderId;
|
||||
const folderWithLockedFiles = `folder-locked1-${Utils.random()}`;
|
||||
let folderWithLockedFilesId: string;
|
||||
const fileLockedInFolder = `file-locked-${Utils.random()}`;
|
||||
let fileLockedInFolderId: string;
|
||||
|
||||
const existingFile = `existing-${Utils.random()}.txt`; let existingFileToCopyId;
|
||||
const existingFile = `existing-${Utils.random()}.txt`;
|
||||
let existingFileToCopyId: string;
|
||||
|
||||
const existingFolder = `existing-${Utils.random()}`; let existingFolderToCopyId;
|
||||
const existingFolder = `existing-${Utils.random()}`;
|
||||
let existingFolderToCopyId: string;
|
||||
|
||||
let existingIdPF, existingIdFav, existingIdSearch;
|
||||
let folderExistingPFId, folderExistingFavId, folderExistingSearchId;
|
||||
let existingIdPF: string;
|
||||
let existingIdFav: string;
|
||||
let existingIdSearch: string;
|
||||
let folderExistingPFId: string;
|
||||
let folderExistingFavId: string;
|
||||
let folderExistingSearchId: string;
|
||||
|
||||
const file2InFolder = `file2InFolder-${Utils.random()}.txt`;
|
||||
const file3InFolder = `file3InFolder-${Utils.random()}.txt`;
|
||||
@ -79,7 +96,8 @@ describe('Copy content', () => {
|
||||
const folderSiteFav = `folderSiteFav-${Utils.random()}`;
|
||||
const folderSiteSearch = `folderSiteSearch-${Utils.random()}`;
|
||||
|
||||
let locationId, destinationId;
|
||||
let locationId: string;
|
||||
let destinationId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -213,17 +231,18 @@ describe('Copy content', () => {
|
||||
|
||||
it('[C280201] Copy multiple items', async () => copyMultipleItems([file2, file3], source, destinationRF));
|
||||
|
||||
it('[C280196] Copy a file with a name that already exists on the destination', async () => copyFileWithNameThatAlreadyExists(existingFile, source, destinationRF));
|
||||
it('[C280196] Copy a file with a name that already exists on the destination', async () =>
|
||||
copyFileWithNameThatAlreadyExists(existingFile, source, destinationRF));
|
||||
|
||||
it('[C291899] Copy items into a library', async () => copyItemsIntoLibrary([file1, file2], source, folderSiteRF));
|
||||
|
||||
it('[C280198] Copy locked file', async () => copyLockedFile(fileLocked1, source, destinationRF, () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdRF;
|
||||
}));
|
||||
it('[C280198] Copy locked file', async () =>
|
||||
copyLockedFile(fileLocked1, source, destinationRF, () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdRF;
|
||||
}));
|
||||
|
||||
it('[C280202] Undo copy of files', async () => undoCopyFile(file4, source, destinationRF));
|
||||
|
||||
});
|
||||
|
||||
describe('from Personal Files', () => {
|
||||
@ -245,33 +264,38 @@ describe('Copy content', () => {
|
||||
|
||||
it('[C291889] Copy multiple items', async () => copyMultipleItems([file2, file3], '', destinationPF));
|
||||
|
||||
it('[C217137] Copy a file with a name that already exists on the destination', async () => copyFileWithNameThatAlreadyExists(existingFile, '', destinationPF));
|
||||
it('[C217137] Copy a file with a name that already exists on the destination', async () =>
|
||||
copyFileWithNameThatAlreadyExists(existingFile, '', destinationPF));
|
||||
|
||||
it('[C217138] Copy a folder with a name that already exists on the destination', async () => copyFolderWithNameThatAlreadyExists(existingFolder, '', destinationPF));
|
||||
it('[C217138] Copy a folder with a name that already exists on the destination', async () =>
|
||||
copyFolderWithNameThatAlreadyExists(existingFolder, '', destinationPF));
|
||||
|
||||
it('[C280282] Copy items into a library', async () => copyItemsIntoLibrary([file1, folder1], '', folderSitePF));
|
||||
|
||||
it('[C217139] Copy locked file', async () => copyLockedFile(fileLocked1, '', destinationPF, () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdPF;
|
||||
}));
|
||||
it('[C217139] Copy locked file', async () =>
|
||||
copyLockedFile(fileLocked1, '', destinationPF, () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdPF;
|
||||
}));
|
||||
|
||||
it('[C217140] Copy folder that contains locked file', async () => copyFolderThatContainsLockedFile(folderWithLockedFiles, '', destinationPF, () => {
|
||||
locationId = folderWithLockedFilesId;
|
||||
destinationId = destinationIdPF;
|
||||
}));
|
||||
it('[C217140] Copy folder that contains locked file', async () =>
|
||||
copyFolderThatContainsLockedFile(folderWithLockedFiles, '', destinationPF, () => {
|
||||
locationId = folderWithLockedFilesId;
|
||||
destinationId = destinationIdPF;
|
||||
}));
|
||||
|
||||
it('[C217171] Undo copy of files', async () => undoCopyFile(file4, '', destinationPF));
|
||||
|
||||
it('[C217172] Undo copy of folders', async () => undoCopyFolder(folder2, '', destinationPF));
|
||||
|
||||
it('[C217173] Undo copy of a file when a file with same name already exists on the destination', async () => undoCopyFileWithExistingName(fileInFolder, '', folder2, async () => {
|
||||
await dataTable.doubleClickOnRowByName(folder1);
|
||||
await dataTable.waitForHeader();
|
||||
}));
|
||||
|
||||
it('[C217174] Undo copy of a folder when a folder with same name already exists on the destination', async () => undoCopyFolderWithExistingName(folderExisting, '', destinationPF));
|
||||
it('[C217173] Undo copy of a file when a file with same name already exists on the destination', async () =>
|
||||
undoCopyFileWithExistingName(fileInFolder, '', folder2, async () => {
|
||||
await dataTable.doubleClickOnRowByName(folder1);
|
||||
await dataTable.waitForHeader();
|
||||
}));
|
||||
|
||||
it('[C217174] Undo copy of a folder when a folder with same name already exists on the destination', async () =>
|
||||
undoCopyFolderWithExistingName(folderExisting, '', destinationPF));
|
||||
});
|
||||
|
||||
describe('from Shared Files', () => {
|
||||
@ -290,17 +314,18 @@ describe('Copy content', () => {
|
||||
|
||||
it('[C280213] Copy multiple items', async () => copyMultipleItems([file2, file3], source, destinationSF));
|
||||
|
||||
it('[C280208] Copy a file with a name that already exists on the destination', async () => copyFileWithNameThatAlreadyExists(existingFile, source, destinationSF));
|
||||
it('[C280208] Copy a file with a name that already exists on the destination', async () =>
|
||||
copyFileWithNameThatAlreadyExists(existingFile, source, destinationSF));
|
||||
|
||||
it('[C291900] Copy items into a library', async () => copyItemsIntoLibrary([file1, file2], source, folderSiteSF));
|
||||
|
||||
it('[C280210] Copy locked file', async () => copyLockedFile(fileLocked1, source, destinationSF, () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdSF;
|
||||
}));
|
||||
it('[C280210] Copy locked file', async () =>
|
||||
copyLockedFile(fileLocked1, source, destinationSF, () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdSF;
|
||||
}));
|
||||
|
||||
it('[C280214] Undo copy of files', async () => undoCopyFile(file4, source, destinationSF));
|
||||
|
||||
});
|
||||
|
||||
describe('from Favorites', () => {
|
||||
@ -321,30 +346,35 @@ describe('Copy content', () => {
|
||||
|
||||
it('[C280225] Copy multiple items', async () => copyMultipleItems([file2, file3], source, destinationFav));
|
||||
|
||||
it('[C280220] Copy a file with a name that already exists on the destination', async () => copyFileWithNameThatAlreadyExists(existingFile, source, destinationFav));
|
||||
it('[C280220] Copy a file with a name that already exists on the destination', async () =>
|
||||
copyFileWithNameThatAlreadyExists(existingFile, source, destinationFav));
|
||||
|
||||
it('[C280221] Copy a folder with a name that already exists on the destination', async () => copyFolderWithNameThatAlreadyExists(existingFolder, source, destinationFav));
|
||||
it('[C280221] Copy a folder with a name that already exists on the destination', async () =>
|
||||
copyFolderWithNameThatAlreadyExists(existingFolder, source, destinationFav));
|
||||
|
||||
it('[C291901] Copy items into a library', async () => copyItemsIntoLibrary([file1, folder1], source, folderSiteFav));
|
||||
|
||||
it('[C280222] Copy locked file', async () => copyLockedFile(fileLocked1, source, destinationFav, () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdFav;
|
||||
}));
|
||||
it('[C280222] Copy locked file', async () =>
|
||||
copyLockedFile(fileLocked1, source, destinationFav, () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdFav;
|
||||
}));
|
||||
|
||||
it('[C280223] Copy folder that contains locked file', async () => copyFolderThatContainsLockedFile(folderWithLockedFiles, source, destinationFav, () => {
|
||||
locationId = folderWithLockedFilesId;
|
||||
destinationId = destinationIdFav;
|
||||
}));
|
||||
it('[C280223] Copy folder that contains locked file', async () =>
|
||||
copyFolderThatContainsLockedFile(folderWithLockedFiles, source, destinationFav, () => {
|
||||
locationId = folderWithLockedFilesId;
|
||||
destinationId = destinationIdFav;
|
||||
}));
|
||||
|
||||
it('[C280226] Undo copy of files', async () => undoCopyFile(file4, source, destinationFav));
|
||||
|
||||
it('[C280227] Undo copy of folders', async () => undoCopyFolder(folder2, source, destinationFav));
|
||||
|
||||
it('[C280228] Undo copy of a file when a file with same name already exists on the destination', async () => undoCopyFileWithExistingName(fileInFolder, folder1, folder2));
|
||||
|
||||
it('[C280229] Undo copy of a folder when a folder with same name already exists on the destination', async () => undoCopyFolderWithExistingName(folderExisting, source, destinationFav));
|
||||
it('[C280228] Undo copy of a file when a file with same name already exists on the destination', async () =>
|
||||
undoCopyFileWithExistingName(fileInFolder, folder1, folder2));
|
||||
|
||||
it('[C280229] Undo copy of a folder when a folder with same name already exists on the destination', async () =>
|
||||
undoCopyFolderWithExistingName(folderExisting, source, destinationFav));
|
||||
});
|
||||
|
||||
describe('from Search Results', () => {
|
||||
@ -360,72 +390,84 @@ describe('Copy content', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C306932] Copy a file', async () => copyFile(file1, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(file1);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306932] Copy a file', async () =>
|
||||
copyFile(file1, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(file1);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306943] Copy a folder with content', async () => copyFolderWithContent(folder1, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(folder1);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306943] Copy a folder with content', async () =>
|
||||
copyFolderWithContent(folder1, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(folder1);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306944] Copy multiple items', async () => copyMultipleItems([file2, file3], source, destinationSearch, async () => {
|
||||
await searchInput.searchFor('file');
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306944] Copy multiple items', async () =>
|
||||
copyMultipleItems([file2, file3], source, destinationSearch, async () => {
|
||||
await searchInput.searchFor('file');
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306933] Copy a file with a name that already exists on the destination', async () => copyFileWithNameThatAlreadyExists(existingFile, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(existingFile);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306933] Copy a file with a name that already exists on the destination', async () =>
|
||||
copyFileWithNameThatAlreadyExists(existingFile, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(existingFile);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306934] Copy a folder with a name that already exists on the destination', async () => copyFolderWithNameThatAlreadyExists(existingFolder, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(existingFolder);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306934] Copy a folder with a name that already exists on the destination', async () =>
|
||||
copyFolderWithNameThatAlreadyExists(existingFolder, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(existingFolder);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306942] Copy items into a library', async () => copyItemsIntoLibrary([file1, file2], source, folderSiteSearch, async () => {
|
||||
await searchInput.searchFor('file');
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306942] Copy items into a library', async () =>
|
||||
copyItemsIntoLibrary([file1, file2], source, folderSiteSearch, async () => {
|
||||
await searchInput.searchFor('file');
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306935] Copy locked file', async () => copyLockedFile(fileLocked1, source, destinationSearch, async () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdSearch;
|
||||
await searchInput.searchFor(fileLocked1);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306935] Copy locked file', async () =>
|
||||
copyLockedFile(fileLocked1, source, destinationSearch, async () => {
|
||||
locationId = sourceId;
|
||||
destinationId = destinationIdSearch;
|
||||
await searchInput.searchFor(fileLocked1);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306936] Copy folder that contains locked file', async () => copyFolderThatContainsLockedFile(folderWithLockedFiles, source, destinationSearch, async () => {
|
||||
locationId = folderWithLockedFilesId;
|
||||
destinationId = destinationIdSearch;
|
||||
await searchInput.searchFor(folderWithLockedFiles);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306936] Copy folder that contains locked file', async () =>
|
||||
copyFolderThatContainsLockedFile(folderWithLockedFiles, source, destinationSearch, async () => {
|
||||
locationId = folderWithLockedFilesId;
|
||||
destinationId = destinationIdSearch;
|
||||
await searchInput.searchFor(folderWithLockedFiles);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306938] Undo copy of files', async () => undoCopyFile(file4, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(file4);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306938] Undo copy of files', async () =>
|
||||
undoCopyFile(file4, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(file4);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306939] Undo copy of folders', async () => undoCopyFolder(folder2, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(folder2);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306939] Undo copy of folders', async () =>
|
||||
undoCopyFolder(folder2, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(folder2);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306940] Undo copy of a file when a file with same name already exists on the destination', async () => undoCopyFileWithExistingName(fileInFolder, folder1, folder2, async () => {
|
||||
await searchInput.searchFor(fileInFolder);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306940] Undo copy of a file when a file with same name already exists on the destination', async () =>
|
||||
undoCopyFileWithExistingName(fileInFolder, folder1, folder2, async () => {
|
||||
await searchInput.searchFor(fileInFolder);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
|
||||
it('[C306941] Undo copy of a folder when a folder with same name already exists on the destination', async () => undoCopyFolderWithExistingName(folderExisting, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(folderExisting);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
it('[C306941] Undo copy of a folder when a folder with same name already exists on the destination', async () =>
|
||||
undoCopyFolderWithExistingName(folderExisting, source, destinationSearch, async () => {
|
||||
await searchInput.searchFor(folderExisting);
|
||||
await dataTable.waitForBody();
|
||||
}));
|
||||
});
|
||||
|
||||
async function copyFile(fileName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function copyFile(fileName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -445,7 +487,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName} not present in ${destination} folder`);
|
||||
}
|
||||
|
||||
async function copyFolderWithContent(folderName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function copyFolderWithContent(folderName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -469,7 +511,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(fileInFolder)).toBe(true, `${fileInFolder} is not present in ${folderName} folder in ${destination}`);
|
||||
}
|
||||
|
||||
async function copyMultipleItems(items: string[], location: string = '', destination: string, doBefore = null) {
|
||||
async function copyMultipleItems(items: string[], location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -491,7 +533,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(items[1])).toBe(true, `${items[1]} not present in ${destination} folder`);
|
||||
}
|
||||
|
||||
async function copyFileWithNameThatAlreadyExists(fileName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function copyFileWithNameThatAlreadyExists(fileName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -511,7 +553,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName}.txt not present in ${destination} folder`);
|
||||
}
|
||||
|
||||
async function copyFolderWithNameThatAlreadyExists(folderName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function copyFolderWithNameThatAlreadyExists(folderName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -534,7 +576,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isItemPresent(file3InFolder)).toBe(true, `${file3InFolder} not present in ${destination} folder in ${folderName}`);
|
||||
}
|
||||
|
||||
async function copyItemsIntoLibrary(items: string[], location: string = '', destination: string, doBefore = null) {
|
||||
async function copyItemsIntoLibrary(items: string[], location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -547,7 +589,7 @@ describe('Copy content', () => {
|
||||
await copyDialog.selectDestination(destination);
|
||||
await copyDialog.copyButton.click();
|
||||
const msg = await page.getSnackBarMessage();
|
||||
expect(msg).toContain(`Copied ${noOfItems} ${ noOfItems === 1 ? 'item' : 'items'}`);
|
||||
expect(msg).toContain(`Copied ${noOfItems} ${noOfItems === 1 ? 'item' : 'items'}`);
|
||||
expect(msg).toContain('Undo');
|
||||
|
||||
await copyDialog.waitForDialogToClose();
|
||||
@ -564,7 +606,7 @@ describe('Copy content', () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function copyLockedFile(fileName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function copyLockedFile(fileName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -587,7 +629,7 @@ describe('Copy content', () => {
|
||||
expect(await apis.user.nodes.isFileLockedByName(fileName, destinationId)).toBe(false, `${fileName} is locked in ${destination}`);
|
||||
}
|
||||
|
||||
async function copyFolderThatContainsLockedFile(folderName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function copyFolderThatContainsLockedFile(folderName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -610,11 +652,16 @@ describe('Copy content', () => {
|
||||
expect(await apis.user.nodes.isFileLockedByName(fileLockedInFolder, locationId)).toBe(true, `${fileLockedInFolder} not locked in ${location}`);
|
||||
|
||||
await dataTable.doubleClickOnRowByName(folderName);
|
||||
expect(await dataTable.isItemPresent(fileLockedInFolder)).toBe(true, `${fileLockedInFolder} is not present in ${folderName} folder from ${destination}`);
|
||||
expect(await apis.user.nodes.isFileLockedByName(fileLockedInFolder, (await apis.user.nodes.getNodeIdFromParent(folderWithLockedFiles, destinationId)))).toBe(false, `${fileLockedInFolder} is locked in ${destination}`);
|
||||
expect(await dataTable.isItemPresent(fileLockedInFolder)).toBe(
|
||||
true,
|
||||
`${fileLockedInFolder} is not present in ${folderName} folder from ${destination}`
|
||||
);
|
||||
expect(
|
||||
await apis.user.nodes.isFileLockedByName(fileLockedInFolder, await apis.user.nodes.getNodeIdFromParent(folderWithLockedFiles, destinationId))
|
||||
).toBe(false, `${fileLockedInFolder} is locked in ${destination}`);
|
||||
}
|
||||
|
||||
async function undoCopyFile(fileName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function undoCopyFile(fileName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -637,7 +684,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
|
||||
}
|
||||
|
||||
async function undoCopyFolder(folderName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function undoCopyFolder(folderName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -660,7 +707,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
|
||||
}
|
||||
|
||||
async function undoCopyFileWithExistingName(fileName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function undoCopyFileWithExistingName(fileName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -687,7 +734,7 @@ describe('Copy content', () => {
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
|
||||
}
|
||||
|
||||
async function undoCopyFolderWithExistingName(folderName: string, location: string = '', destination: string, doBefore = null) {
|
||||
async function undoCopyFolderWithExistingName(folderName: string, location: string = '', destination: string, doBefore?: Function) {
|
||||
if (doBefore) {
|
||||
await doBefore();
|
||||
}
|
||||
@ -707,11 +754,16 @@ describe('Copy content', () => {
|
||||
await dataTable.doubleClickOnRowByName(destination);
|
||||
expect(await dataTable.isItemPresent(folderName)).toBe(true, `${folderName} not present in ${destination} folder`);
|
||||
await dataTable.doubleClickOnRowByName(folderName);
|
||||
expect(await dataTable.isItemPresent(file2InFolderExisting)).toBe(true, `${file2InFolderExisting} not present in ${folderName} in ${destination} folder`);
|
||||
expect(await dataTable.isItemPresent(file1InFolderExisting)).toBe(false, `${file1InFolderExisting} present in ${folderName} in ${destination} folder`);
|
||||
expect(await dataTable.isItemPresent(file2InFolderExisting)).toBe(
|
||||
true,
|
||||
`${file2InFolderExisting} not present in ${folderName} in ${destination} folder`
|
||||
);
|
||||
expect(await dataTable.isItemPresent(file1InFolderExisting)).toBe(
|
||||
false,
|
||||
`${file1InFolderExisting} present in ${folderName} in ${destination} folder`
|
||||
);
|
||||
|
||||
await page.clickTrash();
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
ContentNodeSelectorDialog,
|
||||
RepoClient,
|
||||
Utils,
|
||||
AdminActions
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils, AdminActions } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Destination picker dialog : ', () => {
|
||||
const random = Utils.random();
|
||||
@ -161,7 +154,7 @@ describe('Destination picker dialog : ', () => {
|
||||
expect(await dataTable.isItemPresent(fileInDestination)).toBe(false, 'file is displayed');
|
||||
});
|
||||
|
||||
it('[C263881] Folder links are not displayed', async() => {
|
||||
it('[C263881] Folder links are not displayed', async () => {
|
||||
await dialog.selectLocation('Personal Files');
|
||||
await dataTable.doubleClickOnRowByName(destination);
|
||||
|
||||
@ -290,7 +283,6 @@ describe('Destination picker dialog : ', () => {
|
||||
});
|
||||
|
||||
describe('Users with different permissions', () => {
|
||||
|
||||
it('[C263876] Consumer user cannot select the folder as destination', async () => {
|
||||
await loginPage.loginWith(consumer);
|
||||
await page.dataTable.selectItem(file);
|
||||
|
@ -23,28 +23,30 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
ContentNodeSelectorDialog,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Move content', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const sourcePF = `sourcePersonal-${Utils.random()}`; let sourceIdPF;
|
||||
const destinationPF = `destinationPersonal-${Utils.random()}`; let destinationIdPF;
|
||||
const sourcePF = `sourcePersonal-${Utils.random()}`;
|
||||
let sourceIdPF: string;
|
||||
const destinationPF = `destinationPersonal-${Utils.random()}`;
|
||||
let destinationIdPF: string;
|
||||
|
||||
const sourceRF = `sourceRecent-${Utils.random()}`; let sourceIdRF;
|
||||
const destinationRF = `destinationRecent-${Utils.random()}`; let destinationIdRF;
|
||||
const sourceRF = `sourceRecent-${Utils.random()}`;
|
||||
let sourceIdRF: string;
|
||||
const destinationRF = `destinationRecent-${Utils.random()}`;
|
||||
let destinationIdRF: string;
|
||||
|
||||
const sourceSF = `sourceShared-${Utils.random()}`; let sourceIdSF;
|
||||
const destinationSF = `destinationShared-${Utils.random()}`; let destinationIdSF;
|
||||
const sourceSF = `sourceShared-${Utils.random()}`;
|
||||
let sourceIdSF: string;
|
||||
const destinationSF = `destinationShared-${Utils.random()}`;
|
||||
let destinationIdSF: string;
|
||||
|
||||
const sourceFav = `sourceFavorites-${Utils.random()}`; let sourceIdFav;
|
||||
const destinationFav = `destinationFavorites-${Utils.random()}`; let destinationIdFav;
|
||||
const sourceFav = `sourceFavorites-${Utils.random()}`;
|
||||
let sourceIdFav: string;
|
||||
const destinationFav = `destinationFavorites-${Utils.random()}`;
|
||||
let destinationIdFav: string;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const folderSitePF = `folderSitePersonal-${Utils.random()}`;
|
||||
@ -104,14 +106,16 @@ describe('Move content', () => {
|
||||
describe('from Personal Files', () => {
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id;
|
||||
const fileInFolder = `fileInFolder-${Utils.random()}.txt`;
|
||||
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
const folder2 = `folder2-${Utils.random()}`; let folder2Id;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let folder2Id;
|
||||
const fileInFolder2 = `fileInFolder2-${Utils.random()}.txt`;
|
||||
|
||||
const existingFile = `existing-${Utils.random()}`;
|
||||
@ -398,14 +402,19 @@ describe('Move content', () => {
|
||||
});
|
||||
|
||||
describe('from Shared Files', () => {
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id;
|
||||
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id;
|
||||
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id;
|
||||
|
||||
const existingFile = `existing-${Utils.random()}`; let existingFileId;
|
||||
const existingFile = `existing-${Utils.random()}`;
|
||||
let existingFileId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, sourceIdSF)).entry.id;
|
||||
@ -520,19 +529,26 @@ describe('Move content', () => {
|
||||
});
|
||||
|
||||
describe('from Favorites', () => {
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id;
|
||||
const fileInFolder = `fileInFolder-${Utils.random()}.txt`;
|
||||
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id;
|
||||
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const folder2 = `folder2-${Utils.random()}`; let folder2Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let folder2Id;
|
||||
const fileInFolder2 = `fileInFolder2-${Utils.random()}.txt`;
|
||||
|
||||
const existingFile = `existing-${Utils.random()}`; let existingFileId;
|
||||
const existingFile = `existing-${Utils.random()}`;
|
||||
let existingFileId;
|
||||
|
||||
const existingFolder = `existing-${Utils.random()}`;
|
||||
let existingId1, existingId2;
|
||||
@ -713,5 +729,4 @@ describe('Move content', () => {
|
||||
expect(await dataTable.isItemPresent(fileInFolder2)).toBe(true, `${fileInFolder2} not present in parent folder`);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -54,7 +54,8 @@ describe('Create file from template', () => {
|
||||
const template1InRootFolder = `template3-${random}.txt`;
|
||||
const template2InRootFolder = `template4-${random}.txt`;
|
||||
|
||||
const parent = `parent-${random}`; let parentId;
|
||||
const parent = `parent-${random}`;
|
||||
let parentId: string;
|
||||
const file1 = {
|
||||
name: `file1-${random}.txt`
|
||||
};
|
||||
@ -191,7 +192,7 @@ describe('Create file from template', () => {
|
||||
|
||||
await selectTemplateDialog.breadcrumb.openPath();
|
||||
|
||||
expect(await selectTemplateDialog.breadcrumb.getPathItems()).toEqual([ templatesFolder2, 'Node Templates' ]);
|
||||
expect(await selectTemplateDialog.breadcrumb.getPathItems()).toEqual([templatesFolder2, 'Node Templates']);
|
||||
});
|
||||
|
||||
it(`[C325047] Templates list doesn't allow multiple selection`, async () => {
|
||||
@ -199,14 +200,14 @@ describe('Create file from template', () => {
|
||||
|
||||
await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ template1InRootFolder ], 'Incorrect selected item');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([template1InRootFolder], 'Incorrect selected item');
|
||||
|
||||
await Utils.pressCmd();
|
||||
await selectTemplateDialog.dataTable.selectItem(template2InRootFolder);
|
||||
await Utils.releaseKeyPressed();
|
||||
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ template2InRootFolder ], 'Incorrect selected item');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([template2InRootFolder], 'Incorrect selected item');
|
||||
});
|
||||
|
||||
it('[C325050] Links to files are not displayed', async () => {
|
||||
@ -257,7 +258,7 @@ describe('Create file from template', () => {
|
||||
});
|
||||
|
||||
it('[C325032] Special characters in file name', async () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
const namesWithSpecialChars = ['a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a'];
|
||||
|
||||
for (const name of namesWithSpecialChars) {
|
||||
await createFromTemplateDialog.enterName(name);
|
||||
@ -403,5 +404,4 @@ describe('Create file from template', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -177,7 +177,7 @@ describe('Create folder from template', () => {
|
||||
|
||||
await selectTemplateDialog.breadcrumb.openPath();
|
||||
|
||||
expect(await selectTemplateDialog.breadcrumb.getPathItems()).toEqual([ templateFolder2, 'Space Templates' ]);
|
||||
expect(await selectTemplateDialog.breadcrumb.getPathItems()).toEqual([templateFolder2, 'Space Templates']);
|
||||
});
|
||||
|
||||
it(`[C325150] Templates list doesn't allow multiple selection`, async () => {
|
||||
@ -185,14 +185,14 @@ describe('Create folder from template', () => {
|
||||
|
||||
await selectTemplateDialog.dataTable.selectItem(templateFolder1);
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ templateFolder1 ], 'Incorrect selected item');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([templateFolder1], 'Incorrect selected item');
|
||||
|
||||
await Utils.pressCmd();
|
||||
await selectTemplateDialog.dataTable.selectItem(templateFolder2);
|
||||
await Utils.releaseKeyPressed();
|
||||
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ templateFolder2 ], 'Incorrect selected item');
|
||||
expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([templateFolder2], 'Incorrect selected item');
|
||||
});
|
||||
|
||||
it('[C325153] Links to folders are not displayed', async () => {
|
||||
@ -243,7 +243,7 @@ describe('Create folder from template', () => {
|
||||
});
|
||||
|
||||
it('[C325144] Special characters in folder name', async () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
const namesWithSpecialChars = ['a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a'];
|
||||
|
||||
for (const name of namesWithSpecialChars) {
|
||||
await createFromTemplateDialog.enterName(name);
|
||||
@ -388,5 +388,4 @@ describe('Create folder from template', () => {
|
||||
expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,19 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
CreateOrEditFolderDialog,
|
||||
Utils,
|
||||
clearTextWithBackspace,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, CreateOrEditFolderDialog, Utils, clearTextWithBackspace, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Create folder', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
const folderName1 = `folder-${Utils.random()}`;
|
||||
const folderName2 = `folder-${Utils.random()}`;
|
||||
const folderDescription = 'description of my folder';
|
||||
@ -46,7 +40,7 @@ describe('Create folder', () => {
|
||||
|
||||
const folderSite = `folder-site-${Utils.random()}`;
|
||||
const duplicateFolderSite = `folder-${Utils.random()}`;
|
||||
let docLibUserSite;
|
||||
let docLibUserSite: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -150,7 +144,7 @@ describe('Create folder', () => {
|
||||
});
|
||||
|
||||
it('[C216347] with folder name containing special characters', async () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
const namesWithSpecialChars = ['a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a'];
|
||||
|
||||
await page.dataTable.doubleClickOnRowByName(parent);
|
||||
await page.sidenav.openCreateFolderDialog();
|
||||
@ -258,5 +252,4 @@ describe('Create folder', () => {
|
||||
expect(await createDialog.isDialogOpen()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
CreateLibraryDialog,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, LoginPage, BrowsingPage, CreateLibraryDialog, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Create library', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -43,17 +36,17 @@ describe('Create library', () => {
|
||||
name: `site4-${Utils.random()}`,
|
||||
id: `site4-id-${Utils.random()}`,
|
||||
description: 'site4 description'
|
||||
}
|
||||
};
|
||||
|
||||
const duplicateSite = {
|
||||
name: `duplicate-${Utils.random()}`,
|
||||
id: `duplicate-${Utils.random()}`
|
||||
}
|
||||
};
|
||||
|
||||
const siteInTrash = {
|
||||
name: `site-trash-${Utils.random()}`,
|
||||
id: `site-trash-id-${Utils.random()}`
|
||||
}
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -190,7 +183,7 @@ describe('Create library', () => {
|
||||
});
|
||||
|
||||
it('[C280026] Library ID cannot contain special characters', async () => {
|
||||
const idWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
const idWithSpecialChars = ['a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a'];
|
||||
|
||||
await page.sidenav.openCreateLibraryDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
@ -216,5 +209,4 @@ describe('Create library', () => {
|
||||
expect(await dataTable.isItemPresent(`${duplicateSite.name} (${duplicateSite.id}-2)`)).toBe(true, `${duplicateSite.name} not in the list`);
|
||||
expect(await apis.user.sites.getTitle(`${duplicateSite.id}-2`)).toEqual(duplicateSite.name);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,12 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Delete and undo delete', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -61,21 +56,32 @@ describe('Delete and undo delete', () => {
|
||||
const file6 = `file6-${Utils.random()}.txt`;
|
||||
const file7 = `file7-${Utils.random()}.txt`;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
const folder2 = `folder2-${Utils.random()}`; let folder2Id;
|
||||
const folder3 = `folder3-${Utils.random()}`; let folder3Id;
|
||||
const folder4 = `folder4-${Utils.random()}`; let folder4Id;
|
||||
const folder5 = `folder5-${Utils.random()}`; let folder5Id;
|
||||
const folder6 = `folder6-${Utils.random()}`; let folder6Id;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id: string;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let folder2Id: string;
|
||||
const folder3 = `folder3-${Utils.random()}`;
|
||||
let folder3Id: string;
|
||||
const folder4 = `folder4-${Utils.random()}`;
|
||||
let folder4Id: string;
|
||||
const folder5 = `folder5-${Utils.random()}`;
|
||||
let folder5Id: string;
|
||||
const folder6 = `folder6-${Utils.random()}`;
|
||||
let folder6Id: string;
|
||||
|
||||
const file1InFolder = `file1InFolder-${Utils.random()}.txt`;
|
||||
const file2InFolder = `file2InFolder-${Utils.random()}.txt`;
|
||||
const fileLocked1 = `fileLocked1-${Utils.random()}.txt`; let fileLocked1Id;
|
||||
const fileLocked2 = `fileLocked2-${Utils.random()}.txt`; let fileLocked2Id;
|
||||
const fileLocked3 = `fileLocked3-${Utils.random()}.txt`; let fileLocked3Id;
|
||||
const fileLocked4 = `fileLocked4-${Utils.random()}.txt`; let fileLocked4Id;
|
||||
const fileLocked1 = `fileLocked1-${Utils.random()}.txt`;
|
||||
let fileLocked1Id: string;
|
||||
const fileLocked2 = `fileLocked2-${Utils.random()}.txt`;
|
||||
let fileLocked2Id: string;
|
||||
const fileLocked3 = `fileLocked3-${Utils.random()}.txt`;
|
||||
let fileLocked3Id: string;
|
||||
const fileLocked4 = `fileLocked4-${Utils.random()}.txt`;
|
||||
let fileLocked4Id: string;
|
||||
|
||||
const parent = `parentPF-${Utils.random()}`; let parentId;
|
||||
const parent = `parentPF-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
@ -233,14 +239,21 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
describe('on Shared Files', () => {
|
||||
const sharedFile1 = `sharedFile1-${Utils.random()}.txt`; let sharedFile1Id;
|
||||
const sharedFile2 = `sharedFile2-${Utils.random()}.txt`; let sharedFile2Id;
|
||||
const sharedFile3 = `sharedFile3-${Utils.random()}.txt`; let sharedFile3Id;
|
||||
const sharedFile4 = `sharedFile4-${Utils.random()}.txt`; let sharedFile4Id;
|
||||
const sharedFile5 = `sharedFile5-${Utils.random()}.txt`; let sharedFile5Id;
|
||||
const sharedFile6 = `sharedFile6-${Utils.random()}.txt`; let sharedFile6Id;
|
||||
const sharedFile1 = `sharedFile1-${Utils.random()}.txt`;
|
||||
let sharedFile1Id: string;
|
||||
const sharedFile2 = `sharedFile2-${Utils.random()}.txt`;
|
||||
let sharedFile2Id: string;
|
||||
const sharedFile3 = `sharedFile3-${Utils.random()}.txt`;
|
||||
let sharedFile3Id: string;
|
||||
const sharedFile4 = `sharedFile4-${Utils.random()}.txt`;
|
||||
let sharedFile4Id: string;
|
||||
const sharedFile5 = `sharedFile5-${Utils.random()}.txt`;
|
||||
let sharedFile5Id: string;
|
||||
const sharedFile6 = `sharedFile6-${Utils.random()}.txt`;
|
||||
let sharedFile6Id: string;
|
||||
|
||||
const parent = `parentSF-${Utils.random()}`; let parentId;
|
||||
const parent = `parentSF-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
@ -251,13 +264,7 @@ describe('Delete and undo delete', () => {
|
||||
sharedFile4Id = (await apis.user.nodes.createFile(sharedFile4, parentId)).entry.id;
|
||||
sharedFile5Id = (await apis.user.nodes.createFile(sharedFile5, parentId)).entry.id;
|
||||
sharedFile6Id = (await apis.user.nodes.createFile(sharedFile6, parentId)).entry.id;
|
||||
await apis.user.shared.shareFilesByIds([
|
||||
sharedFile1Id,
|
||||
sharedFile2Id,
|
||||
sharedFile3Id,
|
||||
sharedFile4Id,
|
||||
sharedFile5Id,
|
||||
sharedFile6Id]);
|
||||
await apis.user.shared.shareFilesByIds([sharedFile1Id, sharedFile2Id, sharedFile3Id, sharedFile4Id, sharedFile5Id, sharedFile6Id]);
|
||||
await apis.user.shared.waitForApi({ expect: 6 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
@ -318,29 +325,47 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
const parent = `parentF-${Utils.random()}`; let parentId;
|
||||
const parent = `parentF-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const favFile1 = `favFile1-${Utils.random()}.txt`; let favFile1Id;
|
||||
const favFile2 = `favFile2-${Utils.random()}.txt`; let favFile2Id;
|
||||
const favFile3 = `favFile3-${Utils.random()}.txt`; let favFile3Id;
|
||||
const favFile4 = `favFile4-${Utils.random()}.txt`; let favFile4Id;
|
||||
const favFile5 = `favFile5-${Utils.random()}.txt`; let favFile5Id;
|
||||
const favFile6 = `favFile6-${Utils.random()}.txt`; let favFile6Id;
|
||||
const favFile7 = `favFile7-${Utils.random()}.txt`; let favFile7Id;
|
||||
const favFile1 = `favFile1-${Utils.random()}.txt`;
|
||||
let favFile1Id: string;
|
||||
const favFile2 = `favFile2-${Utils.random()}.txt`;
|
||||
let favFile2Id: string;
|
||||
const favFile3 = `favFile3-${Utils.random()}.txt`;
|
||||
let favFile3Id: string;
|
||||
const favFile4 = `favFile4-${Utils.random()}.txt`;
|
||||
let favFile4Id: string;
|
||||
const favFile5 = `favFile5-${Utils.random()}.txt`;
|
||||
let favFile5Id: string;
|
||||
const favFile6 = `favFile6-${Utils.random()}.txt`;
|
||||
let favFile6Id: string;
|
||||
const favFile7 = `favFile7-${Utils.random()}.txt`;
|
||||
let favFile7Id: string;
|
||||
|
||||
const favFolder1 = `favFolder1-${Utils.random()}`; let favFolder1Id;
|
||||
const favFolder2 = `favFolder2-${Utils.random()}`; let favFolder2Id;
|
||||
const favFolder3 = `favFolder3-${Utils.random()}`; let favFolder3Id;
|
||||
const favFolder4 = `favFolder4-${Utils.random()}`; let favFolder4Id;
|
||||
const favFolder5 = `favFolder5-${Utils.random()}`; let favFolder5Id;
|
||||
const favFolder6 = `favFolder6-${Utils.random()}`; let favFolder6Id;
|
||||
const favFolder1 = `favFolder1-${Utils.random()}`;
|
||||
let favFolder1Id: string;
|
||||
const favFolder2 = `favFolder2-${Utils.random()}`;
|
||||
let favFolder2Id: string;
|
||||
const favFolder3 = `favFolder3-${Utils.random()}`;
|
||||
let favFolder3Id: string;
|
||||
const favFolder4 = `favFolder4-${Utils.random()}`;
|
||||
let favFolder4Id: string;
|
||||
const favFolder5 = `favFolder5-${Utils.random()}`;
|
||||
let favFolder5Id: string;
|
||||
const favFolder6 = `favFolder6-${Utils.random()}`;
|
||||
let favFolder6Id: string;
|
||||
|
||||
const file1InFolder = `file1InFolder-${Utils.random()}.txt`;
|
||||
const file2InFolder = `file2InFolder-${Utils.random()}.txt`;
|
||||
const fileLocked1 = `fileLocked1-${Utils.random()}.txt`; let fileLocked1Id;
|
||||
const fileLocked2 = `fileLocked2-${Utils.random()}.txt`; let fileLocked2Id;
|
||||
const fileLocked3 = `fileLocked3-${Utils.random()}.txt`; let fileLocked3Id;
|
||||
const fileLocked4 = `fileLocked4-${Utils.random()}.txt`; let fileLocked4Id;
|
||||
const fileLocked1 = `fileLocked1-${Utils.random()}.txt`;
|
||||
let fileLocked1Id: string;
|
||||
const fileLocked2 = `fileLocked2-${Utils.random()}.txt`;
|
||||
let fileLocked2Id: string;
|
||||
const fileLocked3 = `fileLocked3-${Utils.random()}.txt`;
|
||||
let fileLocked3Id: string;
|
||||
const fileLocked4 = `fileLocked4-${Utils.random()}.txt`;
|
||||
let fileLocked4Id: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
@ -372,8 +397,8 @@ describe('Delete and undo delete', () => {
|
||||
await apis.user.nodes.lockFile(fileLocked3Id, 'FULL');
|
||||
await apis.user.nodes.lockFile(fileLocked4Id, 'FULL');
|
||||
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ favFile1Id, favFile2Id, favFile3Id, favFile4Id, favFile5Id, favFile6Id, favFile7Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('folder', [ favFolder1Id, favFolder2Id, favFolder3Id, favFolder4Id, favFolder5Id, favFolder6Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [favFile1Id, favFile2Id, favFile3Id, favFile4Id, favFile5Id, favFile6Id, favFile7Id]);
|
||||
await apis.user.favorites.addFavoritesByIds('folder', [favFolder1Id, favFolder2Id, favFolder3Id, favFolder4Id, favFolder5Id, favFolder6Id]);
|
||||
await apis.user.favorites.waitForApi({ expect: 13 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
@ -501,7 +526,8 @@ describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
describe('on Recent Files', () => {
|
||||
const parent = `parentRF-${Utils.random()}`; let parentId;
|
||||
const parent = `parentRF-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const recentFile1 = `recentFile1-${Utils.random()}.txt`;
|
||||
const recentFile2 = `recentFile2-${Utils.random()}.txt`;
|
||||
|
@ -23,18 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SearchResultsPage,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Download', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const filePersonal = `filePersonal-${Utils.random()}.txt`;
|
||||
const fileRecent1 = `fileRecent1-${Utils.random()}.txt`;
|
||||
@ -58,7 +53,12 @@ describe('Download', () => {
|
||||
const unzippedFavorites = `unzippedFavorites-${Utils.random()}`;
|
||||
const unzippedSearch = `unzippedSearch-${Utils.random()}`;
|
||||
|
||||
let fileShared1Id, fileShared2Id, fileFavoritesId, folderPersonalId, folderFavoritesId, folderSearchId;
|
||||
let fileShared1Id: string;
|
||||
let fileShared2Id: string;
|
||||
let fileFavoritesId: string;
|
||||
let folderPersonalId: string;
|
||||
let folderFavoritesId: string;
|
||||
let folderSearchId: string;
|
||||
|
||||
const archiveZip = 'archive.zip';
|
||||
|
||||
@ -73,7 +73,7 @@ describe('Download', () => {
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { searchInput } = searchResultsPage.header;
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
@ -116,7 +116,6 @@ describe('Download', () => {
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
@ -153,13 +152,14 @@ describe('Download', () => {
|
||||
|
||||
expect(await Utils.fileExistsOnOS(filePersonal, unzippedPersonal)).toBe(true, `${filePersonal} not found in unzipped folder`);
|
||||
expect(await Utils.fileExistsOnOS(folderPersonal, unzippedPersonal)).toBe(true, `${folderPersonal} not found in unzipped folder`);
|
||||
expect(await Utils.fileExistsOnOS(fileInFolderPersonal, unzippedPersonal, folderPersonal)).toBe(true, `${fileInFolderPersonal} not found in unzipped folder in ${folderPersonal}`)
|
||||
expect(await Utils.fileExistsOnOS(fileInFolderPersonal, unzippedPersonal, folderPersonal)).toBe(
|
||||
true,
|
||||
`${fileInFolderPersonal} not found in unzipped folder in ${folderPersonal}`
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.favorites.waitForApi({ expect: 2 });
|
||||
done();
|
||||
@ -200,13 +200,14 @@ describe('Download', () => {
|
||||
|
||||
expect(await Utils.fileExistsOnOS(fileFavorites, unzippedFavorites)).toBe(true, `${fileFavorites} not found in unzipped folder`);
|
||||
expect(await Utils.fileExistsOnOS(folderFavorites, unzippedFavorites)).toBe(true, `${folderFavorites} not found in unzipped folder`);
|
||||
expect(await Utils.fileExistsOnOS(fileInFolderFavorites, unzippedFavorites, folderFavorites)).toBe(true, `${fileInFolderFavorites} not found in unzipped folder in ${folderFavorites}`)
|
||||
expect(await Utils.fileExistsOnOS(fileInFolderFavorites, unzippedFavorites, folderFavorites)).toBe(
|
||||
true,
|
||||
`${fileInFolderFavorites} not found in unzipped folder in ${folderFavorites}`
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on Shared Files', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.shared.waitForApi({ expect: 2 });
|
||||
done();
|
||||
@ -235,11 +236,9 @@ describe('Download', () => {
|
||||
expect(await Utils.fileExistsOnOS(fileShared1, unzippedShared)).toBe(true, `${fileShared1} not found in unzipped folder`);
|
||||
expect(await Utils.fileExistsOnOS(fileShared2, unzippedShared)).toBe(true, `${fileShared2} not found in unzipped folder`);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on Recent Files', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.search.waitForApi(username, { expect: 10 });
|
||||
done();
|
||||
@ -268,11 +267,9 @@ describe('Download', () => {
|
||||
expect(await Utils.fileExistsOnOS(fileRecent1, unzippedRecent)).toBe(true, `${fileRecent1} not found in unzipped folder`);
|
||||
expect(await Utils.fileExistsOnOS(fileRecent2, unzippedRecent)).toBe(true, `${fileRecent2} not found in unzipped folder`);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('on Search Results', () => {
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await searchInput.clickSearchButton();
|
||||
@ -311,9 +308,10 @@ describe('Download', () => {
|
||||
|
||||
expect(await Utils.fileExistsOnOS(fileSearch, unzippedSearch)).toBe(true, `${fileSearch} not found in unzipped folder`);
|
||||
expect(await Utils.fileExistsOnOS(folderSearch, unzippedSearch)).toBe(true, `${folderSearch} not found in unzipped folder`);
|
||||
expect(await Utils.fileExistsOnOS(fileInFolderSearch, unzippedSearch, folderSearch)).toBe(true, `${fileInFolderSearch} not found in unzipped folder in ${folderSearch}`)
|
||||
expect(await Utils.fileExistsOnOS(fileInFolderSearch, unzippedSearch, folderSearch)).toBe(
|
||||
true,
|
||||
`${fileInFolderSearch} not found in unzipped folder in ${folderSearch}`
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -37,7 +37,8 @@ import {
|
||||
describe('Edit folder', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
const folderName = `folder-${Utils.random()}`;
|
||||
const folderDescription = 'my folder description';
|
||||
|
||||
@ -52,16 +53,21 @@ describe('Edit folder', () => {
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
|
||||
const folderSite = `folder-site-${Utils.random()}`;
|
||||
const folderSiteToEdit = `folder-site-${Utils.random()}`; let folderSiteToEditId;
|
||||
const folderSiteToEdit = `folder-site-${Utils.random()}`;
|
||||
let folderSiteToEditId: string;
|
||||
const duplicateFolderSite = `folder-${Utils.random()}`;
|
||||
let docLibUserSite;
|
||||
let docLibUserSite: string;
|
||||
|
||||
const folderFavorite = `folder-fav-${Utils.random()}`; let folderFavoriteId;
|
||||
const folderFavoriteToEdit = `folder-fav-${Utils.random()}`; let folderFavoriteToEditId;
|
||||
const folderFavoriteDuplicate = `folder-fav-${Utils.random()}`; let folderFavoriteDuplicateId;
|
||||
const folderFavorite = `folder-fav-${Utils.random()}`;
|
||||
let folderFavoriteId: string;
|
||||
const folderFavoriteToEdit = `folder-fav-${Utils.random()}`;
|
||||
let folderFavoriteToEditId: string;
|
||||
const folderFavoriteDuplicate = `folder-fav-${Utils.random()}`;
|
||||
let folderFavoriteDuplicateId: string;
|
||||
|
||||
const folderSearch = `folder-search-${Utils.random()}`;
|
||||
const folderSearchToEdit = `folder-search-${Utils.random()}`; let folderSearchToEditId;
|
||||
const folderSearchToEdit = `folder-search-${Utils.random()}`;
|
||||
let folderSearchToEditId: string;
|
||||
const folderSearchDuplicate = `folder-search-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
|
@ -23,30 +23,35 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
FILES,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, FILES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Edit offline', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.docx`; let file1Id;
|
||||
const fileLocked = `file-locked-${Utils.random()}.docx`; let fileLockedId;
|
||||
const fileLocked2 = `file-locked2-${Utils.random()}.docx`; let fileLocked2Id;
|
||||
const file1 = `file1-${Utils.random()}.docx`;
|
||||
let file1Id: string;
|
||||
const fileLocked = `file-locked-${Utils.random()}.docx`;
|
||||
let fileLockedId: string;
|
||||
const fileLocked2 = `file-locked2-${Utils.random()}.docx`;
|
||||
let fileLocked2Id: string;
|
||||
|
||||
const fileSearch1 = `file-search-1-${Utils.random()}.docx`; let fileSearch1Id;
|
||||
const fileSearchLocked = `file-search-locked-${Utils.random()}.docx`; let fileSearchLockedId;
|
||||
const fileSearchLocked2 = `file-search-locked2-${Utils.random()}.docx`; let fileSearchLocked2Id;
|
||||
const fileSearch1 = `file-search-1-${Utils.random()}.docx`;
|
||||
let fileSearch1Id: string;
|
||||
const fileSearchLocked = `file-search-locked-${Utils.random()}.docx`;
|
||||
let fileSearchLockedId: string;
|
||||
const fileSearchLocked2 = `file-search-locked2-${Utils.random()}.docx`;
|
||||
let fileSearchLocked2Id: string;
|
||||
|
||||
const parentPF = `parentPersonal-${Utils.random()}`; let parentPFId;
|
||||
const parentSF = `parentShared-${Utils.random()}`; let parentSFId;
|
||||
const parentRF = `parentRecent-${Utils.random()}`; let parentRFId;
|
||||
const parentFav = `parentFav-${Utils.random()}`; let parentFavId;
|
||||
const parentSearch = `parentSearch-${Utils.random()}`; let parentSearchId;
|
||||
const parentPF = `parentPersonal-${Utils.random()}`;
|
||||
let parentPFId: string;
|
||||
const parentSF = `parentShared-${Utils.random()}`;
|
||||
let parentSFId: string;
|
||||
const parentRF = `parentRecent-${Utils.random()}`;
|
||||
let parentRFId: string;
|
||||
const parentFav = `parentFav-${Utils.random()}`;
|
||||
let parentFavId: string;
|
||||
const parentSearch = `parentSearch-${Utils.random()}`;
|
||||
let parentSearchId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
|
@ -23,15 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
ConfirmDialog,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, ConfirmDialog, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Library actions', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -126,8 +118,7 @@ describe('Library actions', () => {
|
||||
});
|
||||
|
||||
describe('Join a public library', () => {
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePublic1Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', sitePublic1Admin);
|
||||
done();
|
||||
@ -152,12 +143,10 @@ describe('Library actions', () => {
|
||||
|
||||
expect(await dataTable.getLibraryRole(siteSearchPublic1Admin)).toEqual('Consumer');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Join a moderated library', () => {
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(siteModerated1Admin, SITE_VISIBILITY.MODERATED);
|
||||
await apis.user.favorites.addFavoriteById('site', siteModerated1Admin);
|
||||
await apis.user.queries.waitForSites(siteSearchModerated1Admin, { expect: 1 });
|
||||
@ -187,12 +176,10 @@ describe('Library actions', () => {
|
||||
const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteSearchModerated1Admin);
|
||||
expect(hasJoinRequest).toBe(true, `Join request does not exist on ${siteSearchModerated1Admin}`);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Leave a library', () => {
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePublic2Admin);
|
||||
await apis.admin.sites.createSite(sitePublic3Admin);
|
||||
await apis.admin.sites.createSite(sitePublic4Admin);
|
||||
@ -281,8 +268,7 @@ describe('Library actions', () => {
|
||||
});
|
||||
|
||||
describe('Cancel join', () => {
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(siteModerated2Admin, SITE_VISIBILITY.MODERATED);
|
||||
await apis.user.favorites.addFavoriteById('site', siteModerated2Admin);
|
||||
await apis.user.sites.requestToJoin(siteModerated2Admin);
|
||||
@ -316,12 +302,10 @@ describe('Library actions', () => {
|
||||
const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteSearchModerated2Admin);
|
||||
expect(hasJoinRequest).toBe(false, `Join request exists on ${siteSearchModerated2Admin}`);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Mark library as favorite', () => {
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePublic6Admin);
|
||||
await apis.admin.sites.addSiteMember(sitePublic6Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.user.queries.waitForSites(siteSearchPublic3Admin, { expect: 1 });
|
||||
@ -345,14 +329,15 @@ describe('Library actions', () => {
|
||||
await dataTable.selectItem(siteSearchPublic3Admin);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(siteSearchPublic3Admin, { expect: true })).toBe(true, `${siteSearchPublic3Admin} not favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(siteSearchPublic3Admin, { expect: true })).toBe(
|
||||
true,
|
||||
`${siteSearchPublic3Admin} not favorite`
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Remove library from favorites', () => {
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePublic7Admin);
|
||||
await apis.admin.sites.createSite(sitePublic8Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', sitePublic7Admin);
|
||||
@ -391,13 +376,15 @@ describe('Library actions', () => {
|
||||
await dataTable.selectItem(siteSearchPublic4Admin);
|
||||
await toolbar.clickMoreActionsRemoveFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(siteSearchPublic4Admin, { expect: false })).toBe(false, `${siteSearchPublic4Admin} still favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(siteSearchPublic4Admin, { expect: false })).toBe(
|
||||
false,
|
||||
`${siteSearchPublic4Admin} still favorite`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Delete a library', () => {
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.sites.createSite(siteForDelete1);
|
||||
await apis.user.sites.createSite(siteForDelete2);
|
||||
await apis.user.queries.waitForSites(siteSearchForDelete, { expect: 1 });
|
||||
@ -435,5 +422,4 @@ describe('Library actions', () => {
|
||||
expect(await dataTable.isItemPresent(siteSearchForDelete)).toBe(false, `${siteSearchForDelete} still displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,17 +23,10 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SITE_VISIBILITY,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SITE_VISIBILITY, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Mark items as favorites', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
|
||||
const fileNotFavUI = `fileNotFavUI-${Utils.random()}.txt`;
|
||||
@ -48,7 +41,17 @@ describe('Mark items as favorites', () => {
|
||||
const fileFav4 = `fileFav4-${Utils.random()}.txt`;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
|
||||
let fileFavUIId, fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id, folderId, parentId;
|
||||
let fileFavUIId: string;
|
||||
let fileNotFav1Id: string;
|
||||
let fileNotFav2Id: string;
|
||||
let fileNotFav3Id: string;
|
||||
let fileNotFav4Id: string;
|
||||
let fileFav1Id: string;
|
||||
let fileFav2Id: string;
|
||||
let fileFav3Id: string;
|
||||
let fileFav4Id: string;
|
||||
let folderId: string;
|
||||
let parentId: string;
|
||||
|
||||
const fileSearchNotFav1 = `search-fileNotFav1-${Utils.random()}.txt`;
|
||||
const fileSearchNotFav2 = `search-fileNotFav2-${Utils.random()}.txt`;
|
||||
@ -60,8 +63,15 @@ describe('Mark items as favorites', () => {
|
||||
const fileSearchFav4 = `search-fileFav4-${Utils.random()}.txt`;
|
||||
const folderSearch = `search-folder-${Utils.random()}`;
|
||||
|
||||
let fileSearchNotFav1Id, fileSearchNotFav2Id, fileSearchNotFav3Id, fileSearchNotFav4Id;
|
||||
let fileSearchFav1Id, fileSearchFav2Id, fileSearchFav3Id, fileSearchFav4Id, folderSearchId;
|
||||
let fileSearchNotFav1Id: string;
|
||||
let fileSearchNotFav2Id: string;
|
||||
let fileSearchNotFav3Id: string;
|
||||
let fileSearchNotFav4Id: string;
|
||||
let fileSearchFav1Id: string;
|
||||
let fileSearchFav2Id: string;
|
||||
let fileSearchFav3Id: string;
|
||||
let fileSearchFav4Id: string;
|
||||
let folderSearchId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -100,14 +110,14 @@ describe('Mark items as favorites', () => {
|
||||
fileSearchFav4Id = (await apis.user.nodes.createFile(fileSearchFav4, parentId)).entry.id;
|
||||
folderSearchId = (await apis.user.nodes.createFolder(folderSearch, parentId)).entry.id;
|
||||
|
||||
const currentFavoritesFiles = (await apis.user.favorites.getFavorites()).list.pagination.totalItems;
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ fileSearchFav1Id, fileSearchFav2Id, fileSearchFav3Id, fileSearchFav4Id ]);
|
||||
await apis.user.favorites.waitForApi({ expect: currentFavoritesFiles + 9 });
|
||||
const currentFavoritesFiles = (await apis.user.favorites.getFavorites()).list.pagination.totalItems;
|
||||
await apis.user.favorites.addFavoritesByIds('file', [fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [fileSearchFav1Id, fileSearchFav2Id, fileSearchFav3Id, fileSearchFav4Id]);
|
||||
await apis.user.favorites.waitForApi({ expect: currentFavoritesFiles + 9 });
|
||||
|
||||
const currentSharedFiles = (await apis.user.shared.getSharedLinks()).list.pagination.totalItems;
|
||||
await apis.user.shared.shareFilesByIds([ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]);
|
||||
await apis.user.shared.shareFilesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]);
|
||||
await apis.user.shared.shareFilesByIds([fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
|
||||
await apis.user.shared.shareFilesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]);
|
||||
await apis.user.shared.waitForApi({ expect: currentSharedFiles + 8 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
@ -127,12 +137,11 @@ describe('Mark items as favorites', () => {
|
||||
describe('on Personal Files', () => {
|
||||
afterAll(async (done) => {
|
||||
try {
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
|
||||
await apis.user.favorites.addFavoriteById('folder', folderId);
|
||||
await apis.user.favorites.removeFavoritesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]);
|
||||
await apis.user.favorites.removeFavoritesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]);
|
||||
await apis.user.favorites.waitForApi({ expect: 10 });
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
done();
|
||||
});
|
||||
|
||||
@ -151,7 +160,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C217187] Favorite action has empty star icon for multiple selection of items when some are not favorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileNotFavUI, fileFavUI ]);
|
||||
await dataTable.selectMultipleItems([fileNotFavUI, fileFavUI]);
|
||||
await toolbar.openMoreMenu();
|
||||
|
||||
expect(await toolbar.menu.getItemIconText('Favorite')).toEqual('star_border');
|
||||
@ -188,7 +197,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C217192] favorite multiple items - all unfavorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]);
|
||||
await dataTable.selectMultipleItems([fileNotFav2, fileNotFav3]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`);
|
||||
@ -196,7 +205,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C217194] favorite multiple items - some favorite and some unfavorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]);
|
||||
await dataTable.selectMultipleItems([fileNotFav4, fileFav2]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`);
|
||||
@ -204,7 +213,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C217193] unfavorite multiple items', async () => {
|
||||
await dataTable.selectMultipleItems([ fileFav3, fileFav4 ])
|
||||
await dataTable.selectMultipleItems([fileFav3, fileFav4]);
|
||||
await toolbar.clickMoreActionsRemoveFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`);
|
||||
@ -215,12 +224,11 @@ describe('Mark items as favorites', () => {
|
||||
describe('on Recent Files', () => {
|
||||
afterAll(async (done) => {
|
||||
try {
|
||||
const currentFavoritesFiles = (await apis.user.favorites.getFavorites()).list.pagination.totalItems;
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]);
|
||||
await apis.user.favorites.removeFavoritesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]);
|
||||
const currentFavoritesFiles = (await apis.user.favorites.getFavorites()).list.pagination.totalItems;
|
||||
await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
|
||||
await apis.user.favorites.removeFavoritesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]);
|
||||
await apis.user.favorites.waitForApi({ expect: currentFavoritesFiles - 1 });
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
done();
|
||||
});
|
||||
|
||||
@ -245,7 +253,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C280355] favorite multiple items - all unfavorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]);
|
||||
await dataTable.selectMultipleItems([fileNotFav2, fileNotFav3]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`);
|
||||
@ -253,7 +261,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C280357] favorite multiple items - some favorite and some unfavorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]);
|
||||
await dataTable.selectMultipleItems([fileNotFav4, fileFav2]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`);
|
||||
@ -261,7 +269,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C280356] unfavorite multiple items', async () => {
|
||||
await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]);
|
||||
await dataTable.selectMultipleItems([fileFav3, fileFav4]);
|
||||
await toolbar.clickMoreActionsRemoveFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`);
|
||||
@ -272,11 +280,10 @@ describe('Mark items as favorites', () => {
|
||||
describe('on Shared Files', () => {
|
||||
afterAll(async (done) => {
|
||||
try {
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]);
|
||||
await apis.user.favorites.removeFavoritesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
|
||||
await apis.user.favorites.removeFavoritesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]);
|
||||
await apis.user.favorites.waitForApi({ expect: 10 });
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
done();
|
||||
});
|
||||
|
||||
@ -301,7 +308,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C280365] favorite multiple items - all unfavorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]);
|
||||
await dataTable.selectMultipleItems([fileNotFav2, fileNotFav3]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`);
|
||||
@ -309,7 +316,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C280367] favorite multiple items - some favorite and some unfavorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]);
|
||||
await dataTable.selectMultipleItems([fileNotFav4, fileFav2]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`);
|
||||
@ -317,7 +324,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C280366] unfavorite multiple items', async () => {
|
||||
await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]);
|
||||
await dataTable.selectMultipleItems([fileFav3, fileFav4]);
|
||||
await toolbar.clickMoreActionsRemoveFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`);
|
||||
@ -328,10 +335,9 @@ describe('Mark items as favorites', () => {
|
||||
describe('on Favorites', () => {
|
||||
afterAll(async (done) => {
|
||||
try {
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
|
||||
await apis.user.favorites.waitForApi({ expect: 10 });
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
done();
|
||||
});
|
||||
|
||||
@ -351,7 +357,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
it('[C280374] unfavorite multiple items', async () => {
|
||||
await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]);
|
||||
await dataTable.selectMultipleItems([fileFav3, fileFav4]);
|
||||
await toolbar.clickMoreActionsRemoveFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`);
|
||||
@ -370,7 +376,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
|
||||
describe('on Search Results', () => {
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.search.waitForNodes('search-f', { expect: 9 });
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkFilesAndFolders();
|
||||
@ -379,7 +385,7 @@ describe('Mark items as favorites', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async done => {
|
||||
afterAll(async (done) => {
|
||||
await page.header.expandSideNav();
|
||||
await page.clickPersonalFiles();
|
||||
done();
|
||||
@ -389,7 +395,10 @@ describe('Mark items as favorites', () => {
|
||||
await dataTable.selectItem(fileSearchNotFav1);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav1Id, { expect: true })).toBe(true, `${fileSearchNotFav1} not marked as favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav1Id, { expect: true })).toBe(
|
||||
true,
|
||||
`${fileSearchNotFav1} not marked as favorite`
|
||||
);
|
||||
});
|
||||
|
||||
it('[C306971] favorite a folder', async () => {
|
||||
@ -403,27 +412,42 @@ describe('Mark items as favorites', () => {
|
||||
await dataTable.selectItem(fileSearchFav1);
|
||||
await toolbar.clickMoreActionsRemoveFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav1Id, { expect: false })).toBe(false, `${fileSearchFav1} is marked as favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav1Id, { expect: false })).toBe(
|
||||
false,
|
||||
`${fileSearchFav1} is marked as favorite`
|
||||
);
|
||||
});
|
||||
|
||||
it('[C306968] favorite multiple items - all unfavorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileSearchNotFav2, fileSearchNotFav3 ]);
|
||||
await dataTable.selectMultipleItems([fileSearchNotFav2, fileSearchNotFav3]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav2Id, { expect: true })).toBe(true, `${fileSearchNotFav2} not marked as favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav3Id, { expect: true })).toBe(true, `${fileSearchNotFav3} not marked as favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav2Id, { expect: true })).toBe(
|
||||
true,
|
||||
`${fileSearchNotFav2} not marked as favorite`
|
||||
);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav3Id, { expect: true })).toBe(
|
||||
true,
|
||||
`${fileSearchNotFav3} not marked as favorite`
|
||||
);
|
||||
});
|
||||
|
||||
it('[C306970] favorite multiple items - some favorite and some unfavorite', async () => {
|
||||
await dataTable.selectMultipleItems([ fileSearchNotFav4, fileSearchFav2 ]);
|
||||
await dataTable.selectMultipleItems([fileSearchNotFav4, fileSearchFav2]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav4Id, { expect: true })).toBe(true, `${fileSearchNotFav4} not marked as favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav2Id, { expect: true })).toBe(true, `${fileSearchFav2} not marked as favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav4Id, { expect: true })).toBe(
|
||||
true,
|
||||
`${fileSearchNotFav4} not marked as favorite`
|
||||
);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav2Id, { expect: true })).toBe(
|
||||
true,
|
||||
`${fileSearchFav2} not marked as favorite`
|
||||
);
|
||||
});
|
||||
|
||||
it('[C306969] unfavorite multiple items', async () => {
|
||||
await dataTable.selectMultipleItems([ fileSearchFav3, fileSearchFav4 ])
|
||||
await dataTable.selectMultipleItems([fileSearchFav3, fileSearchFav4]);
|
||||
await toolbar.clickMoreActionsRemoveFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav3Id, { expect: false })).toBe(false, `${fileSearchFav3} marked as favorite`);
|
||||
@ -431,7 +455,7 @@ describe('Mark items as favorites', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe ('on File Libraries', () => {
|
||||
describe('on File Libraries', () => {
|
||||
const siteName = `site-public-${Utils.random()}`;
|
||||
|
||||
const folderSite = `folderSite-${Utils.random()}`;
|
||||
@ -445,8 +469,15 @@ describe('Mark items as favorites', () => {
|
||||
const fileSiteFav3 = `fileSiteFav3-${Utils.random()}.txt`;
|
||||
const fileSiteFav4 = `fileSiteFav4-${Utils.random()}.txt`;
|
||||
|
||||
let folderSiteId, fileSiteNotFav1Id, fileSiteNotFav2Id, fileSiteNotFav3Id, fileSiteNotFav4Id;
|
||||
let fileSiteFav1Id, fileSiteFav2Id, fileSiteFav3Id, fileSiteFav4Id;
|
||||
let folderSiteId: string;
|
||||
let fileSiteNotFav1Id: string;
|
||||
let fileSiteNotFav2Id: string;
|
||||
let fileSiteNotFav3Id: string;
|
||||
let fileSiteNotFav4Id: string;
|
||||
let fileSiteFav1Id: string;
|
||||
let fileSiteFav2Id: string;
|
||||
let fileSiteFav3Id: string;
|
||||
let fileSiteFav4Id: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
@ -462,7 +493,7 @@ describe('Mark items as favorites', () => {
|
||||
fileSiteFav3Id = (await apis.user.nodes.createFile(fileSiteFav3, folderSiteId)).entry.id;
|
||||
fileSiteFav4Id = (await apis.user.nodes.createFile(fileSiteFav4, folderSiteId)).entry.id;
|
||||
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ fileSiteFav1Id, fileSiteFav2Id, fileSiteFav3Id, fileSiteFav4Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [fileSiteFav1Id, fileSiteFav2Id, fileSiteFav3Id, fileSiteFav4Id]);
|
||||
|
||||
await apis.user.favorites.isFavoriteWithRetry(fileSiteFav1Id, { expect: true });
|
||||
await apis.user.favorites.isFavoriteWithRetry(fileSiteFav2Id, { expect: true });
|
||||
@ -485,7 +516,7 @@ describe('Mark items as favorites', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280391] Favorite a folder', async () => {
|
||||
it('[C280391] Favorite a folder', async () => {
|
||||
await dataTable.selectItem(folderSite);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
@ -497,7 +528,10 @@ describe('Mark items as favorites', () => {
|
||||
await dataTable.selectItem(fileSiteNotFav1);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteNotFav1Id, { expect: true })).toBe(true, `${fileSiteNotFav1} not marked as favorite`);
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteNotFav1Id, { expect: true })).toBe(
|
||||
true,
|
||||
`${fileSiteNotFav1} not marked as favorite`
|
||||
);
|
||||
});
|
||||
|
||||
it('[C280343] Unfavorite an item', async () => {
|
||||
@ -510,7 +544,7 @@ describe('Mark items as favorites', () => {
|
||||
|
||||
it('[C280345] Favorite multiple items - all unfavorite', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await dataTable.selectMultipleItems([ fileSiteNotFav2, fileSiteNotFav3 ]);
|
||||
await dataTable.selectMultipleItems([fileSiteNotFav2, fileSiteNotFav3]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteNotFav2Id, { expect: true })).toBe(true, 'item not marked as favorite');
|
||||
@ -519,7 +553,7 @@ describe('Mark items as favorites', () => {
|
||||
|
||||
it('[C280346] Unfavorite multiple items', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await dataTable.selectMultipleItems([ fileSiteFav2, fileSiteFav3 ]);
|
||||
await dataTable.selectMultipleItems([fileSiteFav2, fileSiteFav3]);
|
||||
await toolbar.clickMoreActionsRemoveFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteFav2Id, { expect: false })).toBe(false, 'item marked as favorite');
|
||||
@ -528,7 +562,7 @@ describe('Mark items as favorites', () => {
|
||||
|
||||
it('[C280347] Favorite multiple items - some favorite and some unfavorite', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await dataTable.selectMultipleItems([ fileSiteNotFav4, fileSiteFav4 ]);
|
||||
await dataTable.selectMultipleItems([fileSiteNotFav4, fileSiteFav4]);
|
||||
await toolbar.clickMoreActionsFavorite();
|
||||
|
||||
expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteNotFav4Id, { expect: true })).toBe(true, 'item not marked as favorite');
|
||||
|
@ -23,13 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SITE_ROLES,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SITE_ROLES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('New menu', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -154,5 +148,4 @@ describe('New menu', () => {
|
||||
tooltip = await menu.getItemTooltip('Create file from template');
|
||||
expect(tooltip).toContain('Files cannot be created whilst viewing the current items');
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,126 +23,120 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
ConfirmDialog,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, ConfirmDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Permanently delete from Trash', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let filesIds;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let filesIds;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let foldersIds;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let foldersIds;
|
||||
|
||||
const site = `site-${Utils.random()}`;
|
||||
const site = `site-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
|
||||
const confirmDialog = new ConfirmDialog();
|
||||
const confirmDialog = new ConfirmDialog();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
filesIds = (await apis.user.nodes.createFiles([ file1, file2, file3 ])).list.entries.map(entries => entries.entry.id);
|
||||
foldersIds = (await apis.user.nodes.createFolders([ folder1, folder2 ])).list.entries.map(entries => entries.entry.id);
|
||||
await apis.user.sites.createSite(site);
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
filesIds = (await apis.user.nodes.createFiles([file1, file2, file3])).list.entries.map((entries: any) => entries.entry.id);
|
||||
foldersIds = (await apis.user.nodes.createFolders([folder1, folder2])).list.entries.map((entries: any) => entries.entry.id);
|
||||
await apis.user.sites.createSite(site);
|
||||
|
||||
await apis.user.nodes.deleteNodesById(filesIds, false);
|
||||
await apis.user.nodes.deleteNodesById(foldersIds, false);
|
||||
await apis.user.sites.deleteSite(site, false);
|
||||
await apis.user.nodes.deleteNodesById(filesIds, false);
|
||||
await apis.user.nodes.deleteNodesById(foldersIds, false);
|
||||
await apis.user.sites.deleteSite(site, false);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.clickTrashAndWait();
|
||||
done();
|
||||
});
|
||||
beforeEach(async (done) => {
|
||||
await page.clickTrashAndWait();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C217091] delete a file', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.deleteButton.click();
|
||||
it('[C217091] delete a file', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.deleteButton.click();
|
||||
|
||||
expect(await page.getSnackBarMessage()).toEqual(`${file1} deleted`);
|
||||
expect(await dataTable.isItemPresent(file1)).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
expect(await page.getSnackBarMessage()).toEqual(`${file1} deleted`);
|
||||
expect(await dataTable.isItemPresent(file1)).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
|
||||
it('[C280416] delete a folder', async () => {
|
||||
await dataTable.selectItem(folder1);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.deleteButton.click();
|
||||
it('[C280416] delete a folder', async () => {
|
||||
await dataTable.selectItem(folder1);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.deleteButton.click();
|
||||
|
||||
expect(await page.getSnackBarMessage()).toEqual(`${folder1} deleted`);
|
||||
expect(await dataTable.isItemPresent(folder1)).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
expect(await page.getSnackBarMessage()).toEqual(`${folder1} deleted`);
|
||||
expect(await dataTable.isItemPresent(folder1)).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
|
||||
it('[C290103] delete a library', async () => {
|
||||
await dataTable.selectItem(site);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.deleteButton.click();
|
||||
it('[C290103] delete a library', async () => {
|
||||
await dataTable.selectItem(site);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.deleteButton.click();
|
||||
|
||||
expect(await page.getSnackBarMessage()).toEqual(`${site} deleted`);
|
||||
expect(await dataTable.isItemPresent(site)).toBe(false, `${site} was not deleted`);
|
||||
});
|
||||
expect(await page.getSnackBarMessage()).toEqual(`${site} deleted`);
|
||||
expect(await dataTable.isItemPresent(site)).toBe(false, `${site} was not deleted`);
|
||||
});
|
||||
|
||||
it('[C280417] delete multiple items', async () => {
|
||||
await dataTable.selectMultipleItems([ file2, folder2 ]);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.deleteButton.click();
|
||||
it('[C280417] delete multiple items', async () => {
|
||||
await dataTable.selectMultipleItems([file2, folder2]);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
await confirmDialog.deleteButton.click();
|
||||
|
||||
expect(await page.getSnackBarMessage()).toEqual(`2 items deleted`);
|
||||
expect(await dataTable.isItemPresent(file2)).toBe(false, 'Item was not deleted');
|
||||
expect(await dataTable.isItemPresent(folder2)).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
expect(await page.getSnackBarMessage()).toEqual(`2 items deleted`);
|
||||
expect(await dataTable.isItemPresent(file2)).toBe(false, 'Item was not deleted');
|
||||
expect(await dataTable.isItemPresent(folder2)).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
|
||||
it('[C269113] Confirmation dialog UI', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
it('[C269113] Confirmation dialog UI', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Delete from trash');
|
||||
expect(await confirmDialog.getText()).toContain('This will permanently remove the selected item(s)');
|
||||
expect(await confirmDialog.isDeleteEnabled()).toBe(true, 'DELETE button is not enabled');
|
||||
expect(await confirmDialog.isKeepEnabled()).toBe(true, 'KEEP button is not enabled');
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Delete from trash');
|
||||
expect(await confirmDialog.getText()).toContain('This will permanently remove the selected item(s)');
|
||||
expect(await confirmDialog.isDeleteEnabled()).toBe(true, 'DELETE button is not enabled');
|
||||
expect(await confirmDialog.isKeepEnabled()).toBe(true, 'KEEP button is not enabled');
|
||||
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('[C269115] Keep action cancels the deletion', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
it('[C269115] Keep action cancels the deletion', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.permanentlyDeleteButton.click();
|
||||
await page.waitForDialog();
|
||||
|
||||
expect(await confirmDialog.isKeepEnabled()).toBe(true, 'KEEP button is not enabled');
|
||||
await confirmDialog.keepButton.click();
|
||||
expect(await dataTable.isItemPresent(file3)).toBe(true, 'Item was deleted');
|
||||
});
|
||||
expect(await confirmDialog.isKeepEnabled()).toBe(true, 'KEEP button is not enabled');
|
||||
await confirmDialog.keepButton.click();
|
||||
expect(await dataTable.isItemPresent(file3)).toBe(true, 'Item was deleted');
|
||||
});
|
||||
});
|
||||
|
@ -24,13 +24,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
APP_ROUTES,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, APP_ROUTES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Restore from Trash', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -56,8 +50,10 @@ describe('Restore from Trash', () => {
|
||||
});
|
||||
|
||||
describe('successful restore', () => {
|
||||
const file = `file-${Utils.random()}.txt`; let fileId;
|
||||
const folder = `folder-${Utils.random()}`; let folderId;
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId: string;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
let folderId: string;
|
||||
const site = `site-${Utils.random()}`;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
@ -146,14 +142,15 @@ describe('Restore from Trash', () => {
|
||||
|
||||
describe('failure to restore', () => {
|
||||
const file1 = `file-${Utils.random()}.txt`;
|
||||
let file1Id1, file1Id2;
|
||||
let file1Id1: string;
|
||||
let file1Id2: string;
|
||||
const file2 = `file-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
let file2Id: string;
|
||||
|
||||
const folder1 = `folder-${Utils.random()}`;
|
||||
let folder1Id;
|
||||
let folder1Id: string;
|
||||
const folder2 = `folder-${Utils.random()}`;
|
||||
let folder2Id;
|
||||
let folder2Id: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
@ -175,10 +172,7 @@ describe('Restore from Trash', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(file1Id2),
|
||||
apis.user.trashcan.emptyTrash()
|
||||
]);
|
||||
await Promise.all([apis.user.nodes.deleteNodeById(file1Id2), apis.user.trashcan.emptyTrash()]);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -199,24 +193,24 @@ describe('Restore from Trash', () => {
|
||||
|
||||
describe('Notification on partial success', () => {
|
||||
const folder1 = `folder1-${Utils.random()}.txt`;
|
||||
let folder1Id;
|
||||
let folder1Id: string;
|
||||
const folder2 = `folder2-${Utils.random()}.txt`;
|
||||
let folder2Id;
|
||||
let folder2Id: string;
|
||||
const file1 = `file-${Utils.random()}.txt`;
|
||||
let file1Id;
|
||||
let file1Id: string;
|
||||
const file2 = `file-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
let file2Id: string;
|
||||
|
||||
const folder3 = `folder3-${Utils.random()}.txt`;
|
||||
let folder3Id;
|
||||
let folder3Id: string;
|
||||
const folder4 = `folder4-${Utils.random()}.txt`;
|
||||
let folder4Id;
|
||||
let folder4Id: string;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id;
|
||||
let file4Id: string;
|
||||
const file5 = `file5-${Utils.random()}.txt`;
|
||||
let file5Id;
|
||||
let file5Id: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
|
@ -24,29 +24,31 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SITE_VISIBILITY,
|
||||
RepoClient,
|
||||
ShareDialog,
|
||||
Viewer,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SITE_VISIBILITY, RepoClient, ShareDialog, Viewer, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Share a file', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
let file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
let file5 = `file5-${Utils.random()}.txt`; let file5Id;
|
||||
let file6 = `file6-${Utils.random()}.txt`; let file6Id;
|
||||
let file7 = `file7-${Utils.random()}.txt`; let file7Id;
|
||||
const file8 = `file8-${Utils.random()}.txt`; let file8Id;
|
||||
let file9 = `file9-${Utils.random()}.txt`; let file9Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
let file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
let file5 = `file5-${Utils.random()}.txt`;
|
||||
let file5Id: string;
|
||||
let file6 = `file6-${Utils.random()}.txt`;
|
||||
let file6Id: string;
|
||||
let file7 = `file7-${Utils.random()}.txt`;
|
||||
let file7Id: string;
|
||||
const file8 = `file8-${Utils.random()}.txt`;
|
||||
let file8Id: string;
|
||||
let file9 = `file9-${Utils.random()}.txt`;
|
||||
let file9Id: string;
|
||||
|
||||
const viewer = new Viewer();
|
||||
const page = new BrowsingPage();
|
||||
@ -70,7 +72,7 @@ describe('Share a file', () => {
|
||||
});
|
||||
|
||||
describe('when logged out', () => {
|
||||
let file6SharedLink;
|
||||
let file6SharedLink: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id;
|
||||
@ -94,7 +96,7 @@ describe('Share a file', () => {
|
||||
await toolbar.downloadButton.click();
|
||||
expect(await Utils.fileExistsOnOS(file6)).toBe(true, 'File not found in download location');
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
describe('when logged in', () => {
|
||||
const expiryDate: any = '2020-12-25T18:30:00.000+0000';
|
||||
@ -110,7 +112,6 @@ describe('Share a file', () => {
|
||||
});
|
||||
|
||||
describe('from Personal Files', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id;
|
||||
@ -220,7 +221,7 @@ describe('Share a file', () => {
|
||||
const date = await shareDialog.dateTimePicker.setDefaultDay();
|
||||
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
|
||||
|
||||
const setDate = (`${date}`).replace(',', '');
|
||||
const setDate = `${date}`.replace(',', '');
|
||||
const inputDate = await shareDialog.getExpireDate();
|
||||
|
||||
expect(new Date(inputDate)).toEqual(new Date(setDate));
|
||||
@ -289,9 +290,9 @@ describe('Share a file', () => {
|
||||
});
|
||||
|
||||
describe('from File Libraries', () => {
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const parentInSite = `parent-site-${Utils.random()}`; let parentInSiteId;
|
||||
const parentInSite = `parent-site-${Utils.random()}`;
|
||||
let parentInSiteId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
@ -401,7 +402,7 @@ describe('Share a file', () => {
|
||||
const date = await shareDialog.dateTimePicker.setDefaultDay();
|
||||
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
|
||||
|
||||
const setDate = (`${date}`).replace(',', '');
|
||||
const setDate = `${date}`.replace(',', '');
|
||||
const inputDate = await shareDialog.getExpireDate();
|
||||
|
||||
expect(new Date(inputDate)).toEqual(new Date(setDate));
|
||||
@ -470,7 +471,6 @@ describe('Share a file', () => {
|
||||
});
|
||||
|
||||
describe('from Recent Files', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id;
|
||||
@ -579,7 +579,7 @@ describe('Share a file', () => {
|
||||
const date = await shareDialog.dateTimePicker.setDefaultDay();
|
||||
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
|
||||
|
||||
const setDate = (`${date}`).replace(',', '');
|
||||
const setDate = `${date}`.replace(',', '');
|
||||
const inputDate = await shareDialog.getExpireDate();
|
||||
|
||||
expect(new Date(inputDate)).toEqual(new Date(setDate));
|
||||
@ -648,7 +648,6 @@ describe('Share a file', () => {
|
||||
});
|
||||
|
||||
describe('from Shared Files', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id;
|
||||
@ -798,7 +797,6 @@ describe('Share a file', () => {
|
||||
});
|
||||
|
||||
describe('from Favorites', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id;
|
||||
@ -919,7 +917,7 @@ describe('Share a file', () => {
|
||||
const date = await shareDialog.dateTimePicker.setDefaultDay();
|
||||
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
|
||||
|
||||
const setDate = (`${date}`).replace(',', '');
|
||||
const setDate = `${date}`.replace(',', '');
|
||||
const inputDate = await shareDialog.getExpireDate();
|
||||
|
||||
expect(new Date(inputDate)).toEqual(new Date(setDate));
|
||||
@ -988,7 +986,6 @@ describe('Share a file', () => {
|
||||
});
|
||||
|
||||
describe('from Search Results', () => {
|
||||
|
||||
file3 = `search-file3-${Utils.random()}.txt`;
|
||||
file5 = `search-file5-${Utils.random()}.txt`;
|
||||
file6 = `search-file6-${Utils.random()}.txt`;
|
||||
@ -1008,7 +1005,7 @@ describe('Share a file', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async done => {
|
||||
beforeEach(async (done) => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkFilesAndFolders();
|
||||
await searchInput.searchFor('search-f');
|
||||
@ -1056,7 +1053,7 @@ describe('Share a file', () => {
|
||||
const date = await shareDialog.dateTimePicker.setDefaultDay();
|
||||
await shareDialog.dateTimePicker.waitForDateTimePickerToClose();
|
||||
|
||||
const setDate = (`${date}`).replace(',', '');
|
||||
const setDate = `${date}`.replace(',', '');
|
||||
const inputDate = await shareDialog.getExpireDate();
|
||||
|
||||
expect(new Date(inputDate)).toEqual(new Date(setDate));
|
||||
@ -1106,5 +1103,5 @@ describe('Share a file', () => {
|
||||
expect(url).toContain(sharedId);
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
|
@ -39,17 +39,24 @@ import {
|
||||
describe('Unshare a file from Search Results', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const file1 = `search-file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `search-file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `search-file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `search-file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file1 = `search-file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `search-file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3 = `search-file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4 = `search-file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
const sitePrivate = `site-private-${Utils.random()}`;
|
||||
|
||||
const fileSite1 = `search-fileSite1-${Utils.random()}.txt`; let fileSite1Id;
|
||||
const fileSite2 = `search-fileSite2-${Utils.random()}.txt`; let fileSite2Id;
|
||||
const fileSite1 = `search-fileSite1-${Utils.random()}.txt`;
|
||||
let fileSite1Id: string;
|
||||
const fileSite2 = `search-fileSite2-${Utils.random()}.txt`;
|
||||
let fileSite2Id: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -239,5 +246,4 @@ describe('Unshare a file from Search Results', () => {
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(fileSite2Id)).toBe(false, `${fileSite2} is shared`);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -39,7 +39,8 @@ import {
|
||||
describe('Unshare a file', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -67,11 +68,14 @@ describe('Unshare a file', () => {
|
||||
});
|
||||
|
||||
describe('from Personal Files', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
@ -182,14 +186,18 @@ describe('Unshare a file', () => {
|
||||
});
|
||||
|
||||
describe('from File Libraries', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const parentInSite = `parent-site-${Utils.random()}`; let parentInSiteId;
|
||||
const parentInSite = `parent-site-${Utils.random()}`;
|
||||
let parentInSiteId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
@ -303,11 +311,14 @@ describe('Unshare a file', () => {
|
||||
});
|
||||
|
||||
describe('from Recent Files', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
@ -416,11 +427,14 @@ describe('Unshare a file', () => {
|
||||
});
|
||||
|
||||
describe('from Shared Files', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
@ -529,11 +543,14 @@ describe('Unshare a file', () => {
|
||||
});
|
||||
|
||||
describe('from Favorites', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
@ -649,15 +666,20 @@ describe('Unshare a file', () => {
|
||||
});
|
||||
|
||||
describe('as Consumer', () => {
|
||||
|
||||
const sitePrivate = `site-private-${Utils.random()}`;
|
||||
|
||||
const file1FileLib = `file1-FL-${Utils.random()}.txt`; let file1FileLibId;
|
||||
const file2FileLib = `file2-FL-${Utils.random()}.txt`; let file2FileLibId;
|
||||
const file1Shared = `file1-Shared-${Utils.random()}.txt`; let file1SharedId;
|
||||
const file2Shared = `file2-Shared-${Utils.random()}.txt`; let file2SharedId;
|
||||
const file1Fav = `file1-Fav-${Utils.random()}.txt`; let file1FavId;
|
||||
const file2Fav = `file2-Fav-${Utils.random()}.txt`; let file2FavId;
|
||||
const file1FileLib = `file1-FL-${Utils.random()}.txt`;
|
||||
let file1FileLibId: string;
|
||||
const file2FileLib = `file2-FL-${Utils.random()}.txt`;
|
||||
let file2FileLibId: string;
|
||||
const file1Shared = `file1-Shared-${Utils.random()}.txt`;
|
||||
let file1SharedId: string;
|
||||
const file2Shared = `file2-Shared-${Utils.random()}.txt`;
|
||||
let file2SharedId: string;
|
||||
const file1Fav = `file1-Fav-${Utils.random()}.txt`;
|
||||
let file1FavId: string;
|
||||
const file2Fav = `file2-Fav-${Utils.random()}.txt`;
|
||||
let file2FavId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
@ -799,5 +821,4 @@ describe('Unshare a file', () => {
|
||||
expect(await apis.user.nodes.isFileShared(file2FavId)).toBe(false, `${file2Fav} is shared`);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,18 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Upload files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id;
|
||||
let folder1Id: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
|
@ -23,41 +23,52 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
FILES,
|
||||
RepoClient,
|
||||
Utils,
|
||||
UploadNewVersionDialog
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, FILES, RepoClient, Utils, UploadNewVersionDialog } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Upload new version', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.docx`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.docx`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.docx`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.docx`; let file4Id;
|
||||
const fileLocked1 = `file-locked1-${Utils.random()}.docx`; let fileLocked1Id;
|
||||
const fileLocked2 = `file-locked2-${Utils.random()}.docx`; let fileLocked2Id;
|
||||
const file1 = `file1-${Utils.random()}.docx`;
|
||||
let file1Id: string;
|
||||
const file2 = `file2-${Utils.random()}.docx`;
|
||||
let file2Id: string;
|
||||
const file3 = `file3-${Utils.random()}.docx`;
|
||||
let file3Id: string;
|
||||
const file4 = `file4-${Utils.random()}.docx`;
|
||||
let file4Id: string;
|
||||
const fileLocked1 = `file-locked1-${Utils.random()}.docx`;
|
||||
let fileLocked1Id: string;
|
||||
const fileLocked2 = `file-locked2-${Utils.random()}.docx`;
|
||||
let fileLocked2Id: string;
|
||||
|
||||
const fileSearch1 = `search-file1-${Utils.random()}.docx`; let fileSearch1Id;
|
||||
const fileSearch2 = `search-file2-${Utils.random()}.docx`; let fileSearch2Id;
|
||||
const fileSearch3 = `search-file3-${Utils.random()}.docx`; let fileSearch3Id;
|
||||
const fileSearch4 = `search-file4-${Utils.random()}.docx`; let fileSearch4Id;
|
||||
const fileLockedSearch1 = `search-file-locked1-${Utils.random()}.docx`; let fileLockedSearch1Id;
|
||||
const fileLockedSearch2 = `search-file-locked2-${Utils.random()}.docx`; let fileLockedSearch2Id;
|
||||
const fileSearch1 = `search-file1-${Utils.random()}.docx`;
|
||||
let fileSearch1Id: string;
|
||||
const fileSearch2 = `search-file2-${Utils.random()}.docx`;
|
||||
let fileSearch2Id: string;
|
||||
const fileSearch3 = `search-file3-${Utils.random()}.docx`;
|
||||
let fileSearch3Id: string;
|
||||
const fileSearch4 = `search-file4-${Utils.random()}.docx`;
|
||||
let fileSearch4Id: string;
|
||||
const fileLockedSearch1 = `search-file-locked1-${Utils.random()}.docx`;
|
||||
let fileLockedSearch1Id: string;
|
||||
const fileLockedSearch2 = `search-file-locked2-${Utils.random()}.docx`;
|
||||
let fileLockedSearch2Id: string;
|
||||
|
||||
const parentPF = `parentPersonal-${Utils.random()}`; let parentPFId;
|
||||
const parentSF = `parentShared-${Utils.random()}`; let parentSFId;
|
||||
const parentRF = `parentRecent-${Utils.random()}`; let parentRFId;
|
||||
const parentFav = `parentFav-${Utils.random()}`; let parentFavId;
|
||||
const parentSearch = `parentSearch-${Utils.random()}`; let parentSearchId;
|
||||
const parentPF = `parentPersonal-${Utils.random()}`;
|
||||
let parentPFId: string;
|
||||
const parentSF = `parentShared-${Utils.random()}`;
|
||||
let parentSFId: string;
|
||||
const parentRF = `parentRecent-${Utils.random()}`;
|
||||
let parentRFId: string;
|
||||
const parentFav = `parentFav-${Utils.random()}`;
|
||||
let parentFavId: string;
|
||||
const parentSearch = `parentSearch-${Utils.random()}`;
|
||||
let parentSearchId: string;
|
||||
|
||||
const nameConflictMessage = 'New version not uploaded, another file with the same name already exists';
|
||||
|
||||
const file = FILES.pdfFile; let fileId;
|
||||
const file = FILES.pdfFile;
|
||||
let fileId: string;
|
||||
const fileToUpload1 = FILES.docxFile;
|
||||
const fileToUpload2 = FILES.xlsxFile;
|
||||
const fileToUpload3 = FILES.pdfFile;
|
||||
@ -708,7 +719,7 @@ describe('Upload new version', () => {
|
||||
await apis.user.nodes.lockFile(fileLockedSearch1Id);
|
||||
await apis.user.nodes.lockFile(fileLockedSearch2Id);
|
||||
|
||||
await apis.user.search.waitForNodes('search-f', { expect: 6 })
|
||||
await apis.user.search.waitForNodes('search-f', { expect: 6 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
@ -870,5 +881,4 @@ describe('Upload new version', () => {
|
||||
expect(await apis.user.nodes.isFileLockedWrite(fileLockedSearch2Id)).toBe(true, `${fileLockedSearch2} was unlocked`);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -25,13 +25,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { Logger } from '@alfresco/adf-testing';
|
||||
import {
|
||||
BrowsingPage,
|
||||
LoginPage,
|
||||
CreateOrEditFolderDialog,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { BrowsingPage, LoginPage, CreateOrEditFolderDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('General', () => {
|
||||
const loginPage = new LoginPage();
|
||||
@ -40,7 +34,7 @@ describe('General', () => {
|
||||
const adminApi = new RepoClient();
|
||||
const { nodes: nodesApi, authentication: authApi } = adminApi;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
let folderId;
|
||||
let folderId: string;
|
||||
|
||||
describe('on session expire', () => {
|
||||
beforeAll(async (done) => {
|
||||
|
@ -24,20 +24,15 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
PAGE_TITLES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { PAGE_TITLES, LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Page titles', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const adminApi = new RepoClient();
|
||||
const { nodes: nodesApi } = adminApi;
|
||||
const file = `file-${Utils.random()}.txt`; let fileId;
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId: string;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
describe('on Login / Logout pages', () => {
|
||||
|
@ -24,14 +24,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
APP_ROUTES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient,
|
||||
navigate
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { APP_ROUTES, LoginPage, BrowsingPage, Utils, RepoClient, navigate } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Login', () => {
|
||||
const peopleApi = new RepoClient().people;
|
||||
@ -49,7 +42,9 @@ describe('Login', () => {
|
||||
|
||||
const johnDoe = {
|
||||
username: `user-${Utils.random()}`,
|
||||
get password() { return this.username; },
|
||||
get password() {
|
||||
return this.username;
|
||||
},
|
||||
firstName: 'John',
|
||||
lastName: 'Doe'
|
||||
};
|
||||
|
@ -24,13 +24,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient,
|
||||
APP_ROUTES
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, Utils, RepoClient, APP_ROUTES } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Logout', () => {
|
||||
const page = new BrowsingPage();
|
||||
|
@ -23,30 +23,24 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
EXTENSIBILITY_CONFIGS,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, EXTENSIBILITY_CONFIGS, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Context submenu', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
let fileId: string;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
let folderId;
|
||||
let folderId: string;
|
||||
|
||||
const restrictedPermissionsItem = 'Share';
|
||||
|
||||
const menuItem1 = {
|
||||
label: 'Test Menu1',
|
||||
submenu: [ 'Test submenu1', 'Test submenu2', restrictedPermissionsItem ]
|
||||
submenu: ['Test submenu1', 'Test submenu2', restrictedPermissionsItem]
|
||||
};
|
||||
const menuItem2 = {
|
||||
label: 'Test Menu2',
|
||||
submenu: [ restrictedPermissionsItem ]
|
||||
submenu: [restrictedPermissionsItem]
|
||||
};
|
||||
|
||||
const apis = {
|
||||
@ -56,11 +50,11 @@ describe('Extensions - Context submenu', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const {dataTable} = page;
|
||||
const { dataTable } = page;
|
||||
const contextMenu = dataTable.menu;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({username});
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
folderId = (await apis.user.nodes.createFolder(folder)).entry.id;
|
||||
|
||||
@ -104,7 +98,10 @@ describe('Extensions - Context submenu', () => {
|
||||
expect(await contextMenu.getSubmenuItemsCount()).toBe(2, 'submenu has wrong number of items');
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[0])).toBe(true, `${menuItem1.submenu[0]} is not displayed for ${file}`);
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[1])).toBe(true, `${menuItem1.submenu[1]} is not displayed for ${file}`);
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[2])).toBe(false, `no permission submenu ${restrictedPermissionsItem} is displayed`);
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[2])).toBe(
|
||||
false,
|
||||
`no permission submenu ${restrictedPermissionsItem} is displayed`
|
||||
);
|
||||
});
|
||||
|
||||
it('[C287784] The parent item is not displayed if all its children have no permission to be displayed', async () => {
|
||||
|
@ -23,18 +23,12 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
BrowsingPage,
|
||||
LoginPage,
|
||||
RepoClient,
|
||||
EXTENSIBILITY_CONFIGS,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { BrowsingPage, LoginPage, RepoClient, EXTENSIBILITY_CONFIGS, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - DocumentList presets', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
let fileId: string;
|
||||
|
||||
const testData = [
|
||||
{
|
||||
@ -76,7 +70,7 @@ describe('Extensions - DocumentList presets', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async done => {
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
done();
|
||||
});
|
||||
@ -87,16 +81,14 @@ describe('Extensions - DocumentList presets', () => {
|
||||
});
|
||||
|
||||
it('[C286700] Sets the columns to display', async () => {
|
||||
const expectedColumns = testData
|
||||
.filter(item => !item.disabled)
|
||||
.map(data => data.label);
|
||||
const expectedColumns = testData.filter((item) => !item.disabled).map((data) => data.label);
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C286699] Disabled items are not shown', async () => {
|
||||
const noColumnLabel = testData.find(item => item.disabled).label;
|
||||
const noColumnLabel = testData.find((item) => item.disabled).label;
|
||||
const element = dataTable.getColumnHeaderByLabel(noColumnLabel);
|
||||
|
||||
expect(await element.isPresent()).toBe(false, `"${noColumnLabel}" is displayed`);
|
||||
|
@ -23,65 +23,57 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
RepoClient,
|
||||
EXTENSIBILITY_CONFIGS,
|
||||
Utils,
|
||||
Header,
|
||||
Menu
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, RepoClient, EXTENSIBILITY_CONFIGS, Utils, Header, Menu } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Info Drawer', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const disabledMenu = {
|
||||
id: 'settings',
|
||||
title: 'App settings',
|
||||
description: 'Application settings',
|
||||
icon: 'settings'
|
||||
};
|
||||
const disabledMenu = {
|
||||
id: 'settings',
|
||||
title: 'App settings',
|
||||
description: 'Application settings',
|
||||
icon: 'settings'
|
||||
};
|
||||
|
||||
const enabledMenu = {
|
||||
id: 'button',
|
||||
title: 'New Button',
|
||||
description: 'new button description',
|
||||
icon: 'alarm_on'
|
||||
};
|
||||
const enabledMenu = {
|
||||
id: 'button',
|
||||
title: 'New Button',
|
||||
description: 'new button description',
|
||||
icon: 'alarm_on'
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const header = new Header();
|
||||
const toolbarMenu = new Menu();
|
||||
const header = new Header();
|
||||
const toolbarMenu = new Menu();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const loginPage = new LoginPage();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.HEADER);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.HEADER);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await header.closeMoreMenu();
|
||||
done();
|
||||
});
|
||||
afterEach(async (done) => {
|
||||
await header.closeMoreMenu();
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C286474] Add a new button in the header', async () => {
|
||||
await header.openMoreMenu();
|
||||
expect(await toolbarMenu.isMenuItemPresent(enabledMenu.title)).toBe(true, 'menu item not present');
|
||||
expect(await toolbarMenu.getItemIconText(enabledMenu.title)).toEqual(enabledMenu.icon);
|
||||
});
|
||||
|
||||
it('[C286477] Disable a button from the header', async () => {
|
||||
await header.openMoreMenu();
|
||||
expect(await toolbarMenu.isMenuItemPresent(disabledMenu.title)).toBe(true, `${disabledMenu.title} menu item not present`);
|
||||
expect(await toolbarMenu.isMenuItemDisabled(disabledMenu.title)).toEqual('true', `${disabledMenu.title} is not disabled`);
|
||||
});
|
||||
it('[C286474] Add a new button in the header', async () => {
|
||||
await header.openMoreMenu();
|
||||
expect(await toolbarMenu.isMenuItemPresent(enabledMenu.title)).toBe(true, 'menu item not present');
|
||||
expect(await toolbarMenu.getItemIconText(enabledMenu.title)).toEqual(enabledMenu.icon);
|
||||
});
|
||||
|
||||
it('[C286477] Disable a button from the header', async () => {
|
||||
await header.openMoreMenu();
|
||||
expect(await toolbarMenu.isMenuItemPresent(disabledMenu.title)).toBe(true, `${disabledMenu.title} menu item not present`);
|
||||
expect(await toolbarMenu.isMenuItemDisabled(disabledMenu.title)).toEqual('true', `${disabledMenu.title} is not disabled`);
|
||||
});
|
||||
});
|
||||
|
@ -23,140 +23,133 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage, BrowsingPage,
|
||||
InfoDrawer,
|
||||
RepoClient,
|
||||
EXTENSIBILITY_CONFIGS,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, InfoDrawer, RepoClient, EXTENSIBILITY_CONFIGS, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Info Drawer', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId: string;
|
||||
|
||||
const properties_tab = {
|
||||
order: 1,
|
||||
title: 'MY PROPERTIES'
|
||||
};
|
||||
const properties_tab = {
|
||||
order: 1,
|
||||
title: 'MY PROPERTIES'
|
||||
};
|
||||
|
||||
const custom_tab = {
|
||||
order: 2,
|
||||
icon: 'mood',
|
||||
title: 'MY CUSTOM TITLE',
|
||||
component: 'app.toolbar.toggleFavorite'
|
||||
};
|
||||
const custom_tab = {
|
||||
order: 2,
|
||||
icon: 'mood',
|
||||
title: 'MY CUSTOM TITLE',
|
||||
component: 'app.toolbar.toggleFavorite'
|
||||
};
|
||||
|
||||
const no_title_tab = {
|
||||
order: 3,
|
||||
icon: 'check_circle',
|
||||
title: ''
|
||||
};
|
||||
const no_title_tab = {
|
||||
order: 3,
|
||||
icon: 'check_circle',
|
||||
title: ''
|
||||
};
|
||||
|
||||
const comments_tab = {
|
||||
title: 'COMMENTS'
|
||||
};
|
||||
const comments_tab = {
|
||||
title: 'COMMENTS'
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const infoDrawer = new InfoDrawer();
|
||||
const infoDrawer = new InfoDrawer();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(fileId);
|
||||
done();
|
||||
});
|
||||
|
||||
describe('', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
done();
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.INFO_DRAWER);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(fileId);
|
||||
done();
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await page.dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.INFO_DRAWER);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
it('[C284646] Add a new tab with icon and title', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await page.dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C284646] Add a new tab with icon and title', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
const val = await infoDrawer.getTabTitle(custom_tab.order);
|
||||
expect(await infoDrawer.isTabPresent(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not present`);
|
||||
expect(val.trim()).toEqual(`${custom_tab.icon}\n${custom_tab.title}`.trim());
|
||||
});
|
||||
|
||||
it('[C284647] Remove existing tab', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabPresent(comments_tab.title)).toBe(false, `${comments_tab.title} tab should not be present!`);
|
||||
});
|
||||
|
||||
it('[C284648] Change tab title', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabPresent(properties_tab.title)).toBe(true, `${properties_tab.title} tab is not present`);
|
||||
expect(await infoDrawer.getTabTitle(properties_tab.order)).toEqual(properties_tab.title);
|
||||
});
|
||||
|
||||
it('[C284649] Tab with icon and no title', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabPresent(no_title_tab.title)).toBe(true, `${no_title_tab.title} tab is not present`);
|
||||
expect((await infoDrawer.getTabTitle(no_title_tab.order)).trim()).toEqual(`${no_title_tab.icon}`.trim());
|
||||
});
|
||||
|
||||
it('[C284651] Insert new component in tab', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabDisplayed(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not displayed`);
|
||||
await infoDrawer.clickTab(custom_tab.title);
|
||||
expect(await infoDrawer.getComponentIdOfTab()).toEqual(custom_tab.component);
|
||||
});
|
||||
const val = await infoDrawer.getTabTitle(custom_tab.order);
|
||||
expect(await infoDrawer.isTabPresent(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not present`);
|
||||
expect(val.trim()).toEqual(`${custom_tab.icon}\n${custom_tab.title}`.trim());
|
||||
});
|
||||
|
||||
describe('', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.INFO_DRAWER_EMPTY);
|
||||
await loginPage.loginWith(username);
|
||||
await page.clickPersonalFilesAndWait();
|
||||
done();
|
||||
});
|
||||
it('[C284647] Remove existing tab', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
it('[C284650] Remove all tabs', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isEmpty()).toBe(true, 'Info Drawer is not empty');
|
||||
});
|
||||
expect(await infoDrawer.isTabPresent(comments_tab.title)).toBe(false, `${comments_tab.title} tab should not be present!`);
|
||||
});
|
||||
|
||||
it('[C284648] Change tab title', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabPresent(properties_tab.title)).toBe(true, `${properties_tab.title} tab is not present`);
|
||||
expect(await infoDrawer.getTabTitle(properties_tab.order)).toEqual(properties_tab.title);
|
||||
});
|
||||
|
||||
it('[C284649] Tab with icon and no title', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabPresent(no_title_tab.title)).toBe(true, `${no_title_tab.title} tab is not present`);
|
||||
expect((await infoDrawer.getTabTitle(no_title_tab.order)).trim()).toEqual(`${no_title_tab.icon}`.trim());
|
||||
});
|
||||
|
||||
it('[C284651] Insert new component in tab', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabDisplayed(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not displayed`);
|
||||
await infoDrawer.clickTab(custom_tab.title);
|
||||
expect(await infoDrawer.getComponentIdOfTab()).toEqual(custom_tab.component);
|
||||
});
|
||||
});
|
||||
|
||||
describe('', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.INFO_DRAWER_EMPTY);
|
||||
await loginPage.loginWith(username);
|
||||
await page.clickPersonalFilesAndWait();
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C284650] Remove all tabs', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isEmpty()).toBe(true, 'Info Drawer is not empty');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -23,22 +23,14 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
BrowsingPage,
|
||||
LoginPage,
|
||||
RepoClient,
|
||||
EXTENSIBILITY_CONFIGS,
|
||||
Utils,
|
||||
InfoDrawer,
|
||||
MetadataCard
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { BrowsingPage, LoginPage, RepoClient, EXTENSIBILITY_CONFIGS, Utils, InfoDrawer, MetadataCard } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Metadata presets', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file = `file-${Utils.random()}.png`;
|
||||
|
||||
let fileId;
|
||||
let fileId: string;
|
||||
|
||||
const properties_tab = {
|
||||
title: 'Properties',
|
||||
@ -71,7 +63,7 @@ describe('Extensions - Metadata presets', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createImage(file)).entry.id;
|
||||
|
||||
@ -82,7 +74,7 @@ describe('Extensions - Metadata presets', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async done => {
|
||||
beforeEach(async (done) => {
|
||||
await page.refresh();
|
||||
|
||||
await page.dataTable.selectItem(file);
|
||||
@ -96,7 +88,7 @@ describe('Extensions - Metadata presets', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async done => {
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(fileId);
|
||||
done();
|
||||
});
|
||||
|
@ -23,155 +23,147 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Viewer,
|
||||
RepoClient,
|
||||
EXTENSIBILITY_CONFIGS,
|
||||
FILES,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, Viewer, RepoClient, EXTENSIBILITY_CONFIGS, FILES, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Viewer', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const pdfFile = {
|
||||
file_name: FILES.pdfFile,
|
||||
component: 'app.components.tabs.metadata'
|
||||
};
|
||||
let pdfFileId;
|
||||
const pdfFile = {
|
||||
file_name: FILES.pdfFile,
|
||||
component: 'app.components.tabs.metadata'
|
||||
};
|
||||
let pdfFileId: string;
|
||||
|
||||
const docxFile = {
|
||||
file_name: FILES.docxFile,
|
||||
component: 'app.components.tabs.comments'
|
||||
};
|
||||
let docxFileId;
|
||||
const docxFile = {
|
||||
file_name: FILES.docxFile,
|
||||
component: 'app.components.tabs.comments'
|
||||
};
|
||||
let docxFileId: string;
|
||||
|
||||
const customAction = {
|
||||
id: 'app.viewer.my-action',
|
||||
title: 'My action',
|
||||
icon: 'http'
|
||||
};
|
||||
const customAction = {
|
||||
id: 'app.viewer.my-action',
|
||||
title: 'My action',
|
||||
icon: 'http'
|
||||
};
|
||||
|
||||
const customSecondaryAction = {
|
||||
id: 'app.viewer.my-secondary-action',
|
||||
title: 'My secondary action',
|
||||
icon: 'alarm'
|
||||
};
|
||||
const customSecondaryAction = {
|
||||
id: 'app.viewer.my-secondary-action',
|
||||
title: 'My secondary action',
|
||||
icon: 'alarm'
|
||||
};
|
||||
|
||||
const downloadButton = {
|
||||
id: 'app.viewer.download',
|
||||
title: 'My custom title'
|
||||
};
|
||||
const downloadButton = {
|
||||
id: 'app.viewer.download',
|
||||
title: 'My custom title'
|
||||
};
|
||||
|
||||
const moveAction = {
|
||||
id: 'app.viewer.move',
|
||||
title: 'My new title'
|
||||
}
|
||||
const moveAction = {
|
||||
id: 'app.viewer.move',
|
||||
title: 'My new title'
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
const viewer = new Viewer();
|
||||
const { toolbar } = viewer;
|
||||
const viewer = new Viewer();
|
||||
const { toolbar } = viewer;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
pdfFileId = (await apis.user.upload.uploadFile(pdfFile.file_name)).entry.id;
|
||||
docxFileId = (await apis.user.upload.uploadFile(docxFile.file_name)).entry.id;
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
pdfFileId = (await apis.user.upload.uploadFile(pdfFile.file_name)).entry.id;
|
||||
docxFileId = (await apis.user.upload.uploadFile(docxFile.file_name)).entry.id;
|
||||
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.VIEWER);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.VIEWER);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodesById([pdfFileId, docxFileId]);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('content', () => {
|
||||
it('[C284659] Insert new component in a content viewer', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
|
||||
expect(await viewer.getComponentIdOfView()).toEqual(pdfFile.component);
|
||||
await viewer.closeButton.click();
|
||||
|
||||
await page.dataTable.doubleClickOnRowByName(docxFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
|
||||
expect(await viewer.getComponentIdOfView()).toEqual(docxFile.component);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions', () => {
|
||||
it('[C286416] Add a new action in the toolbar', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.isButtonPresent(customAction.title)).toBe(true, 'Custom action is not present');
|
||||
expect(await toolbar.getButtonByTitleAttribute(customAction.title).getAttribute('id')).toEqual(customAction.id);
|
||||
expect(await toolbar.getButtonByTitleAttribute(customAction.title).getText()).toEqual(customAction.icon);
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodesById([ pdfFileId, docxFileId ]);
|
||||
done();
|
||||
it('[C286417] Modify title of action from toolbar', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.getButtonById(downloadButton.id).getAttribute('title')).toEqual(downloadButton.title);
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
done();
|
||||
it('[C286419] Remove action from toolbar', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.isPrintPresent()).toBe(false, 'Print button is still displayed');
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar More actions menu', () => {
|
||||
it('[C286420] Add a new action', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent(customSecondaryAction.title)).toBe(true, 'action is not present');
|
||||
expect(await toolbar.menu.getItemIconText(customSecondaryAction.title)).toEqual(customSecondaryAction.icon);
|
||||
expect(await toolbar.menu.getItemIdAttribute(customSecondaryAction.title)).toEqual(customSecondaryAction.id);
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
it('[C286421] Modify title of action from More actions menu', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.getItemById(moveAction.id).getAttribute('title')).toEqual(moveAction.title);
|
||||
});
|
||||
|
||||
describe('content', () => {
|
||||
it('[C284659] Insert new component in a content viewer', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
|
||||
expect(await viewer.getComponentIdOfView()).toEqual(pdfFile.component);
|
||||
await viewer.closeButton.click();
|
||||
it('[C286423] Remove action from More actions menu', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await page.dataTable.doubleClickOnRowByName(docxFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
|
||||
expect(await viewer.getComponentIdOfView()).toEqual(docxFile.component);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions', () => {
|
||||
it('[C286416] Add a new action in the toolbar', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.isButtonPresent(customAction.title)).toBe(true, 'Custom action is not present');
|
||||
expect(await toolbar.getButtonByTitleAttribute(customAction.title).getAttribute('id')).toEqual(customAction.id);
|
||||
expect(await toolbar.getButtonByTitleAttribute(customAction.title).getText()).toEqual(customAction.icon);
|
||||
});
|
||||
|
||||
it('[C286417] Modify title of action from toolbar', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.getButtonById(downloadButton.id).getAttribute('title')).toEqual(downloadButton.title);
|
||||
});
|
||||
|
||||
it('[C286419] Remove action from toolbar', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.isPrintPresent()).toBe(false, 'Print button is still displayed');
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar More actions menu', () => {
|
||||
it('[C286420] Add a new action', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent(customSecondaryAction.title)).toBe(true, 'action is not present');
|
||||
expect(await toolbar.menu.getItemIconText(customSecondaryAction.title)).toEqual(customSecondaryAction.icon);
|
||||
expect(await toolbar.menu.getItemIdAttribute(customSecondaryAction.title)).toEqual(customSecondaryAction.id);
|
||||
});
|
||||
|
||||
it('[C286421] Modify title of action from More actions menu', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.getItemById(moveAction.id).getAttribute('title')).toEqual(moveAction.title);
|
||||
});
|
||||
|
||||
it('[C286423] Remove action from More actions menu', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.managePermissionsAction.isPresent()).toBe(false, 'Action is still displayed');
|
||||
});
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.managePermissionsAction.isPresent()).toBe(false, 'Action is still displayed');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -23,35 +23,35 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
import * as moment from 'moment';
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
const moment = require('moment');
|
||||
|
||||
describe('Comments', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
const folder2 = `folder2-${Utils.random()}`; let folder2Id;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let folder2Id: string;
|
||||
|
||||
const fileWith1Comment = `file1Comment-${Utils.random()}.txt`; let fileWith1CommentId;
|
||||
const fileWith2Comments = `file2Comments-${Utils.random()}.txt`; let fileWith2CommentsId;
|
||||
const fileWith1Comment = `file1Comment-${Utils.random()}.txt`;
|
||||
let fileWith1CommentId: string;
|
||||
const fileWith2Comments = `file2Comments-${Utils.random()}.txt`;
|
||||
let fileWith2CommentsId: string;
|
||||
|
||||
const file2Personal = `file2Personal-${Utils.random()}.txt`;
|
||||
const file2Shared = `file2Shared-${Utils.random()}.txt`; let file2SharedId;
|
||||
const file2Shared = `file2Shared-${Utils.random()}.txt`;
|
||||
let file2SharedId: string;
|
||||
const file2Recent = `file2Recent-${Utils.random()}.txt`;
|
||||
const file2Favorites = `file2Favorites-${Utils.random()}.txt`; let file2FavoritesId;
|
||||
const file2Favorites = `file2Favorites-${Utils.random()}.txt`;
|
||||
let file2FavoritesId: string;
|
||||
|
||||
let commentFile1Entry;
|
||||
let comment1File2Entry, comment2File2Entry;
|
||||
let commentFile1Entry: any;
|
||||
let comment1File2Entry: any;
|
||||
let comment2File2Entry: any;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -73,7 +73,7 @@ describe('Comments', () => {
|
||||
await apis.user.nodes.createFile(file1, parentId);
|
||||
await apis.user.nodes.createFile(file2Personal, parentId);
|
||||
await apis.user.nodes.createFile(file2Recent, parentId);
|
||||
file2SharedId = (await apis.user.nodes.createFile(file2Shared, parentId)).entry.id
|
||||
file2SharedId = (await apis.user.nodes.createFile(file2Shared, parentId)).entry.id;
|
||||
file2FavoritesId = (await apis.user.nodes.createFile(file2Favorites, parentId)).entry.id;
|
||||
|
||||
fileWith1CommentId = (await apis.user.nodes.createFile(fileWith1Comment, parentId)).entry.id;
|
||||
@ -378,7 +378,10 @@ describe('Comments', () => {
|
||||
expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
|
||||
expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
|
||||
expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(
|
||||
moment(commentFile1Entry.createdAt).fromNow(),
|
||||
'Incorrect comment created time'
|
||||
);
|
||||
expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
|
||||
});
|
||||
|
||||
@ -397,7 +400,10 @@ describe('Comments', () => {
|
||||
expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
|
||||
expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
|
||||
expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(
|
||||
moment(commentFile1Entry.createdAt).fromNow(),
|
||||
'Incorrect comment created time'
|
||||
);
|
||||
expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
|
||||
});
|
||||
|
||||
@ -416,7 +422,10 @@ describe('Comments', () => {
|
||||
expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
|
||||
expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
|
||||
expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(
|
||||
moment(commentFile1Entry.createdAt).fromNow(),
|
||||
'Incorrect comment created time'
|
||||
);
|
||||
expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
|
||||
});
|
||||
|
||||
@ -435,10 +444,11 @@ describe('Comments', () => {
|
||||
expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
|
||||
expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
|
||||
expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(
|
||||
moment(commentFile1Entry.createdAt).fromNow(),
|
||||
'Incorrect comment created time'
|
||||
);
|
||||
expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,23 +23,15 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils,
|
||||
FILES,
|
||||
DATE_TIME_FORMAT,
|
||||
DATE_FORMAT
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils, FILES, DATE_TIME_FORMAT, DATE_FORMAT } from '@alfresco/aca-testing-shared';
|
||||
|
||||
import * as moment from 'moment';
|
||||
const moment = require('moment');
|
||||
|
||||
describe('File / Folder properties', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const file1 = {
|
||||
name: `file1-${Utils.random()}.txt`,
|
||||
@ -47,15 +39,15 @@ describe('File / Folder properties', () => {
|
||||
description: 'file description',
|
||||
author: 'file author'
|
||||
};
|
||||
let file1Id;
|
||||
let file1Id: string;
|
||||
|
||||
const image1 = {
|
||||
name: FILES.jpgFile,
|
||||
title: 'image title',
|
||||
description: 'image description',
|
||||
author: 'image author'
|
||||
}
|
||||
let image1Id;
|
||||
};
|
||||
let image1Id: string;
|
||||
|
||||
const folder1 = {
|
||||
name: `folder1-${Utils.random()}`,
|
||||
@ -63,7 +55,7 @@ describe('File / Folder properties', () => {
|
||||
description: 'folder description',
|
||||
author: 'folder author'
|
||||
};
|
||||
let folder1Id;
|
||||
let folder1Id: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -152,16 +144,7 @@ describe('File / Folder properties', () => {
|
||||
it('[C307106] Folder properties', async () => {
|
||||
const apiProps = await apis.user.nodes.getNodeById(folder1Id);
|
||||
|
||||
const expectedPropLabels = [
|
||||
'Name',
|
||||
'Title',
|
||||
'Creator',
|
||||
'Created Date',
|
||||
'Modifier',
|
||||
'Modified Date',
|
||||
'Author',
|
||||
'Description'
|
||||
];
|
||||
const expectedPropLabels = ['Name', 'Title', 'Creator', 'Created Date', 'Modifier', 'Modified Date', 'Author', 'Description'];
|
||||
const expectedPropValues = [
|
||||
folder1.name,
|
||||
folder1.title,
|
||||
@ -231,7 +214,7 @@ describe('File / Folder properties', () => {
|
||||
properties['exif:flash'],
|
||||
properties['exif:focalLength'].toString(),
|
||||
properties['exif:isoSpeedRatings'],
|
||||
(properties['exif:orientation']).toString(),
|
||||
properties['exif:orientation'].toString(),
|
||||
properties['exif:manufacturer'],
|
||||
properties['exif:model'],
|
||||
properties['exif:software']
|
||||
@ -252,5 +235,4 @@ describe('File / Folder properties', () => {
|
||||
expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,18 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('General', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
@ -89,5 +84,4 @@ describe('General', () => {
|
||||
|
||||
expect(await infoDrawer.isOpen()).toBe(false, 'Info drawer open');
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,15 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SITE_VISIBILITY, SITE_ROLES, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Library properties', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
@ -56,7 +48,7 @@ describe('Library properties', () => {
|
||||
name: `site-for-rename-${Utils.random()}`,
|
||||
visibility: SITE_VISIBILITY.PRIVATE,
|
||||
description: 'new description'
|
||||
}
|
||||
};
|
||||
|
||||
const siteDup = `site3-${Utils.random()}`;
|
||||
|
||||
@ -99,7 +91,7 @@ describe('Library properties', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async done => {
|
||||
afterEach(async (done) => {
|
||||
if (await infoDrawer.isOpen()) {
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
}
|
||||
@ -120,7 +112,7 @@ describe('Library properties', () => {
|
||||
|
||||
expect(await aboutTab.getName()).toEqual(site.name);
|
||||
expect(await aboutTab.getLibraryId()).toEqual(site.id);
|
||||
expect((await aboutTab.getVisibility()).toLowerCase()).toEqual((site.visibility).toLowerCase());
|
||||
expect((await aboutTab.getVisibility()).toLowerCase()).toEqual(site.visibility.toLowerCase());
|
||||
expect(await aboutTab.getDescription()).toEqual(site.description);
|
||||
|
||||
expect(await aboutTab.isEditLibraryPropertiesDisplayed()).toBe(true, 'Edit action is not displayed');
|
||||
@ -231,7 +223,7 @@ describe('Library properties', () => {
|
||||
});
|
||||
|
||||
describe('Non manager', () => {
|
||||
afterAll(async done => {
|
||||
afterAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
@ -260,5 +252,4 @@ describe('Library properties', () => {
|
||||
expect(await page.getSnackBarMessage()).toEqual('There was an error updating library properties');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,13 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SearchResultsPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Empty list views', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Favorites', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -86,13 +79,13 @@ describe('Favorites', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodes([ favFolderName, parentFolder ]);
|
||||
await apis.user.nodes.deleteNodes([favFolderName, parentFolder]);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280482] has the correct columns', async () => {
|
||||
const expectedColumns = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by' ];
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Modified', 'Modified by'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -127,17 +120,17 @@ describe('Favorites', () => {
|
||||
|
||||
it('[C213650] Location column redirect - item in user Home', async () => {
|
||||
await dataTable.clickItemLocation(favFolderName);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280484] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(fileName2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', parentFolder ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', parentFolder]);
|
||||
});
|
||||
|
||||
it('[C280485] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileName1);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'My Libraries', siteName ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName]);
|
||||
});
|
||||
|
||||
it('[C213230] Navigate into folder from Favorites', async () => {
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('File Libraries', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -95,8 +88,8 @@ describe('File Libraries', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.sites.deleteSites([ userSitePublic, userSiteModerated, userSitePrivate, siteId1, siteId2 ]);
|
||||
await apis.admin.sites.deleteSites([ adminSite1, adminSite2, adminSite3, adminSite4, adminSite5, adminSite6 ]);
|
||||
await apis.user.sites.deleteSites([userSitePublic, userSiteModerated, userSitePrivate, siteId1, siteId2]);
|
||||
await apis.admin.sites.deleteSites([adminSite1, adminSite2, adminSite3, adminSite4, adminSite5, adminSite6]);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -107,7 +100,7 @@ describe('File Libraries', () => {
|
||||
});
|
||||
|
||||
it('[C217095] has the correct columns', async () => {
|
||||
const expectedColumns = [ 'Name', 'Description', 'My Role', 'Visibility' ];
|
||||
const expectedColumns = ['Name', 'Description', 'My Role', 'Visibility'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -150,10 +143,7 @@ describe('File Libraries', () => {
|
||||
});
|
||||
|
||||
it('[C217098] Site ID is displayed when two sites have the same name', async () => {
|
||||
const expectedSites = [
|
||||
`${siteName} (${siteId1})`,
|
||||
`${siteName} (${siteId2})`
|
||||
];
|
||||
const expectedSites = [`${siteName} (${siteId1})`, `${siteName} (${siteId2})`];
|
||||
const actualSites = await dataTable.getCellsContainingName(siteName);
|
||||
expect(actualSites.sort()).toEqual(expectedSites.sort());
|
||||
});
|
||||
@ -176,7 +166,7 @@ describe('File Libraries', () => {
|
||||
});
|
||||
|
||||
it('[C289893] has the correct columns', async () => {
|
||||
const expectedColumns = [ 'Name', 'Description', 'My Role', 'Visibility' ];
|
||||
const expectedColumns = ['Name', 'Description', 'My Role', 'Visibility'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -219,10 +209,7 @@ describe('File Libraries', () => {
|
||||
});
|
||||
|
||||
it('[C289896] Site ID is displayed when two sites have the same name', async () => {
|
||||
const expectedSites = [
|
||||
`${siteName} (${siteId1})`,
|
||||
`${siteName} (${siteId2})`
|
||||
];
|
||||
const expectedSites = [`${siteName} (${siteId1})`, `${siteName} (${siteId2})`];
|
||||
const actualSites = await dataTable.getCellsContainingName(siteName);
|
||||
expect(actualSites.sort()).toEqual(expectedSites.sort());
|
||||
});
|
||||
|
@ -24,21 +24,17 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
import { LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Generic errors', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const username2 = `user2-${Utils.random()}`;
|
||||
|
||||
const parent = `folder-${Utils.random()}`; let parentId;
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const parent = `folder-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
@ -84,7 +80,6 @@ describe('Generic errors', () => {
|
||||
|
||||
expect(await page.genericError.isDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(await page.genericErrorTitle.getText()).toContain(`This item no longer exists or you don't have permission to view it.`);
|
||||
|
||||
});
|
||||
|
||||
it('[C217314] Permission denied', async () => {
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Special permissions', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
@ -25,13 +25,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import {
|
||||
APP_ROUTES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { APP_ROUTES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Personal Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -51,20 +45,14 @@ describe('Personal Files', () => {
|
||||
const userFile = `file-${Utils.random()}.txt`;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.people.createUser({ username }),
|
||||
apis.admin.nodes.createFolders([ adminFolder ])
|
||||
]);
|
||||
await apis.user.nodes.createFolders([ userFolder ]);
|
||||
await apis.user.nodes.createFiles([ userFile ], userFolder);
|
||||
await Promise.all([apis.admin.people.createUser({ username }), apis.admin.nodes.createFolders([adminFolder])]);
|
||||
await apis.user.nodes.createFolders([userFolder]);
|
||||
await apis.user.nodes.createFiles([userFile], userFolder);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.nodes.deleteNodes([ adminFolder ]),
|
||||
apis.user.nodes.deleteNodes([ userFolder ])
|
||||
]);
|
||||
await Promise.all([apis.admin.nodes.deleteNodes([adminFolder]), apis.user.nodes.deleteNodes([userFolder])]);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -97,7 +85,7 @@ describe('Personal Files', () => {
|
||||
});
|
||||
|
||||
it('[C217142] has the correct columns', async () => {
|
||||
const expectedColumns = [ 'Name', 'Size', 'Modified', 'Modified by' ];
|
||||
const expectedColumns = ['Name', 'Size', 'Modified', 'Modified by'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -114,7 +102,7 @@ describe('Personal Files', () => {
|
||||
it('[C213244] navigates to folder', async () => {
|
||||
const nodeId = (await apis.user.nodes.getNodeByPath(`/${userFolder}`)).entry.id;
|
||||
|
||||
await dataTable.doubleClickOnRowByName(userFolder)
|
||||
await dataTable.doubleClickOnRowByName(userFolder);
|
||||
await dataTable.waitForHeader();
|
||||
|
||||
expect(await browser.getCurrentUrl()).toContain(nodeId, 'Node ID is not in the URL');
|
||||
|
@ -23,24 +23,21 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Recent Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const folderName = `folder-${Utils.random()}`; let folderId;
|
||||
const folderName = `folder-${Utils.random()}`;
|
||||
let folderId: string;
|
||||
const fileName1 = `file-${Utils.random()}.txt`;
|
||||
const fileName2 = `file-${Utils.random()}.txt`; let file2Id;
|
||||
const fileName2 = `file-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const fileName3 = `file-${Utils.random()}.txt`;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const folderSite = `folder2-${Utils.random()}`; let folderSiteId;
|
||||
const folderSite = `folder2-${Utils.random()}`;
|
||||
let folderSiteId: string;
|
||||
const fileSite = `file-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
@ -54,10 +51,10 @@ describe('Recent Files', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
folderId = (await apis.user.nodes.createFolders([ folderName ])).entry.id;
|
||||
await apis.user.nodes.createFiles([ fileName1 ], folderName);
|
||||
file2Id = (await apis.user.nodes.createFiles([ fileName2 ])).entry.id;
|
||||
const id = (await apis.user.nodes.createFiles([ fileName3 ])).entry.id;
|
||||
folderId = (await apis.user.nodes.createFolders([folderName])).entry.id;
|
||||
await apis.user.nodes.createFiles([fileName1], folderName);
|
||||
file2Id = (await apis.user.nodes.createFiles([fileName2])).entry.id;
|
||||
const id = (await apis.user.nodes.createFiles([fileName3])).entry.id;
|
||||
await apis.user.nodes.deleteNodeById(id, false);
|
||||
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
@ -77,14 +74,14 @@ describe('Recent Files', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodesById([ folderId, file2Id ]);
|
||||
await apis.user.nodes.deleteNodesById([folderId, file2Id]);
|
||||
await apis.user.sites.deleteSite(siteName);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C213168] has the correct columns', async () => {
|
||||
const expectedColumns = [ 'Name', 'Location', 'Size', 'Modified' ];
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Modified'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -120,16 +117,16 @@ describe('Recent Files', () => {
|
||||
|
||||
it('[C213176] Location column redirect - file in user Home', async () => {
|
||||
await dataTable.clickItemLocation(fileName2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280486] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(fileName1);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderName ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', folderName]);
|
||||
});
|
||||
|
||||
it('[C280487] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileSite);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'My Libraries', siteName, folderSite ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName, folderSite]);
|
||||
});
|
||||
});
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Shared Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -39,11 +32,16 @@ describe('Shared Files', () => {
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileAdmin = `fileSite-${Utils.random()}.txt`;
|
||||
|
||||
const folderUser = `folder-${Utils.random()}`; let folderId;
|
||||
const file1User = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2User = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3User = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4User = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const folderUser = `folder-${Utils.random()}`;
|
||||
let folderId: string;
|
||||
const file1User = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2User = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3User = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4User = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -91,7 +89,7 @@ describe('Shared Files', () => {
|
||||
});
|
||||
|
||||
it('[C213113] has the correct columns', async () => {
|
||||
const expectedColumns = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ];
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -123,17 +121,17 @@ describe('Shared Files', () => {
|
||||
|
||||
it('[C213666] Location column redirect - file in user Home', async () => {
|
||||
await dataTable.clickItemLocation(file4User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280490] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(file1User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderUser ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', folderUser]);
|
||||
});
|
||||
|
||||
it('[C280491] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileAdmin);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'My Libraries', siteName ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName]);
|
||||
});
|
||||
|
||||
it('[C213667] Location column displays a tooltip with the entire path of the file', async () => {
|
||||
|
@ -23,12 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('File / folder tooltips', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -59,7 +54,7 @@ describe('File / folder tooltips', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder( parent )).entry.id;
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
file1Id = (await apis.user.nodes.createFile(file, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(fileWithDesc, parentId, '', fileDescription)).entry.id;
|
||||
@ -70,21 +65,16 @@ describe('File / folder tooltips', () => {
|
||||
file7Id = (await apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentId, fileTitle, fileNameEqDescDiffTitle)).entry.id;
|
||||
file8Id = (await apis.user.nodes.createFile(fileTitleEqDesc, parentId, fileTitle, fileTitle)).entry.id;
|
||||
|
||||
await apis.user.shared.shareFilesByIds([ file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id ]);
|
||||
await apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id]);
|
||||
|
||||
await apis.user.favorites.addFavoritesByIds('file', [
|
||||
file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id
|
||||
]);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodes([ parent ]),
|
||||
apis.user.trashcan.emptyTrash()
|
||||
]);
|
||||
await Promise.all([apis.user.nodes.deleteNodes([parent]), apis.user.trashcan.emptyTrash()]);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -254,26 +244,28 @@ describe('File / folder tooltips', () => {
|
||||
let file5TrashId, file6TrashId, file7TrashId, file8TrashId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
parentForTrashId = (await apis.user.nodes.createFolder( parentForTrash )).entry.id;
|
||||
parentForTrashId = (await apis.user.nodes.createFolder(parentForTrash)).entry.id;
|
||||
file1TrashId = (await apis.user.nodes.createFile(file, parentForTrashId)).entry.id;
|
||||
file2TrashId = (await apis.user.nodes.createFile(fileWithDesc, parentForTrashId, '', fileDescription)).entry.id;
|
||||
file3TrashId = (await apis.user.nodes.createFile(fileWithTitle, parentForTrashId, fileTitle)).entry.id;
|
||||
file4TrashId = (await apis.user.nodes.createFile(fileWithTitleAndDesc, parentForTrashId, fileTitle, fileDescription)).entry.id;
|
||||
file5TrashId = (await apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentForTrashId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)).entry.id;
|
||||
file5TrashId = (await apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentForTrashId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)).entry
|
||||
.id;
|
||||
file6TrashId = (await apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentForTrashId, fileNameEqTitleDiffDesc, fileDescription)).entry.id;
|
||||
file7TrashId = (await apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentForTrashId, fileTitle, fileNameEqDescDiffTitle)).entry.id;
|
||||
file8TrashId = (await apis.user.nodes.createFile(fileTitleEqDesc, parentForTrashId, fileTitle, fileTitle)).entry.id;
|
||||
|
||||
await apis.user.nodes.deleteNodesById([
|
||||
file1TrashId, file2TrashId, file3TrashId, file4TrashId, file5TrashId, file6TrashId, file7TrashId, file8TrashId
|
||||
], false);
|
||||
await apis.user.nodes.deleteNodesById(
|
||||
[file1TrashId, file2TrashId, file3TrashId, file4TrashId, file5TrashId, file6TrashId, file7TrashId, file8TrashId],
|
||||
false
|
||||
);
|
||||
|
||||
await page.clickTrashAndWait();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodes([ parentForTrash ]);
|
||||
await apis.user.nodes.deleteNodes([parentForTrash]);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
|
@ -23,32 +23,34 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Trash', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileSite = `file-${Utils.random()}.txt`; let fileSiteId;
|
||||
const fileSite = `file-${Utils.random()}.txt`;
|
||||
let fileSiteId;
|
||||
|
||||
const folderAdmin = `folder-${Utils.random()}`; let folderAdminId;
|
||||
const fileAdmin = `file-${Utils.random()}.txt`; let fileAdminId;
|
||||
const folderAdmin = `folder-${Utils.random()}`;
|
||||
let folderAdminId;
|
||||
const fileAdmin = `file-${Utils.random()}.txt`;
|
||||
let fileAdminId;
|
||||
|
||||
const folderUser = `folder-${Utils.random()}`; let folderUserId;
|
||||
const fileUser = `file-${Utils.random()}.txt`; let fileUserId;
|
||||
const folderUser = `folder-${Utils.random()}`;
|
||||
let folderUserId;
|
||||
const fileUser = `file-${Utils.random()}.txt`;
|
||||
let fileUserId;
|
||||
|
||||
const folderDeleted = `folder-${Utils.random()}`; let folderDeletedId;
|
||||
const fileDeleted = `file-${Utils.random()}.txt`; let fileDeletedId;
|
||||
const folderDeleted = `folder-${Utils.random()}`;
|
||||
let folderDeletedId;
|
||||
const fileDeleted = `file-${Utils.random()}.txt`;
|
||||
let fileDeletedId;
|
||||
|
||||
const folderNotDeleted = `folder-${Utils.random()}`; let folderNotDeletedId;
|
||||
const fileInFolder = `file-${Utils.random()}.txt`; let fileInFolderId;
|
||||
const folderNotDeleted = `folder-${Utils.random()}`;
|
||||
let folderNotDeletedId: string;
|
||||
const fileInFolder = `file-${Utils.random()}.txt`;
|
||||
let fileInFolderId;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@ -61,21 +63,21 @@ describe('Trash', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileAdminId = (await apis.admin.nodes.createFiles([ fileAdmin ])).entry.id;
|
||||
folderAdminId = (await apis.admin.nodes.createFolders([ folderAdmin ])).entry.id;
|
||||
fileAdminId = (await apis.admin.nodes.createFiles([fileAdmin])).entry.id;
|
||||
folderAdminId = (await apis.admin.nodes.createFolders([folderAdmin])).entry.id;
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
fileSiteId = (await apis.admin.nodes.createFile(fileSite, docLibId)).entry.id;
|
||||
fileUserId = (await apis.user.nodes.createFiles([ fileUser ])).entry.id;
|
||||
folderUserId = (await apis.user.nodes.createFolders([ folderUser ])).entry.id;
|
||||
fileUserId = (await apis.user.nodes.createFiles([fileUser])).entry.id;
|
||||
folderUserId = (await apis.user.nodes.createFolders([folderUser])).entry.id;
|
||||
folderDeletedId = (await apis.user.nodes.createFolder(folderDeleted)).entry.id;
|
||||
fileDeletedId = (await apis.user.nodes.createFiles([ fileDeleted ], folderDeleted)).entry.id;
|
||||
fileDeletedId = (await apis.user.nodes.createFiles([fileDeleted], folderDeleted)).entry.id;
|
||||
folderNotDeletedId = (await apis.user.nodes.createFolder(folderNotDeleted)).entry.id;
|
||||
fileInFolderId = (await apis.user.nodes.createFiles([ fileInFolder ], folderNotDeleted)).entry.id;
|
||||
fileInFolderId = (await apis.user.nodes.createFiles([fileInFolder], folderNotDeleted)).entry.id;
|
||||
|
||||
await apis.admin.nodes.deleteNodesById([ fileAdminId, folderAdminId ], false);
|
||||
await apis.user.nodes.deleteNodesById([ fileSiteId, fileUserId, folderUserId, fileInFolderId ], false);
|
||||
await apis.admin.nodes.deleteNodesById([fileAdminId, folderAdminId], false);
|
||||
await apis.user.nodes.deleteNodesById([fileSiteId, fileUserId, folderUserId, fileInFolderId], false);
|
||||
await apis.user.nodes.deleteNodeById(fileDeletedId, false);
|
||||
await apis.user.nodes.deleteNodeById(folderDeletedId, false);
|
||||
|
||||
@ -83,11 +85,7 @@ describe('Trash', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodeById(folderNotDeletedId),
|
||||
apis.admin.trashcan.emptyTrash()
|
||||
]);
|
||||
await Promise.all([apis.admin.sites.deleteSite(siteName), apis.user.nodes.deleteNodeById(folderNotDeletedId), apis.admin.trashcan.emptyTrash()]);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -103,7 +101,7 @@ describe('Trash', () => {
|
||||
});
|
||||
|
||||
it('[C213217] has the correct columns', async () => {
|
||||
const expectedColumns = [ 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ];
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Deleted', 'Deleted by'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -132,7 +130,7 @@ describe('Trash', () => {
|
||||
});
|
||||
|
||||
it('[C280494] has the correct columns', async () => {
|
||||
const expectedColumns = [ 'Name', 'Location', 'Size', 'Deleted'];
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Deleted'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -170,17 +168,17 @@ describe('Trash', () => {
|
||||
|
||||
it('[C217144] Location column redirect - file in user Home', async () => {
|
||||
await dataTable.clickItemLocation(fileUser);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280496] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(fileInFolder);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderNotDeleted ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', folderNotDeleted]);
|
||||
});
|
||||
|
||||
it('[C280497] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileSite);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'My Libraries', siteName ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -25,26 +25,25 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import {
|
||||
SITE_VISIBILITY,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { SITE_VISIBILITY, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Breadcrumb', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const subFolder1 = `subFolder1-${Utils.random()}`; let subFolder1Id;
|
||||
const subFolder2 = `subFolder2-${Utils.random()}`; let subFolder2Id;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
const subFolder1 = `subFolder1-${Utils.random()}`;
|
||||
let subFolder1Id: string;
|
||||
const subFolder2 = `subFolder2-${Utils.random()}`;
|
||||
let subFolder2Id: string;
|
||||
const fileName1 = `file1-${Utils.random()}.txt`;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
|
||||
const parent2 = `parent2-${Utils.random()}`; let parent2Id;
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
const parent2 = `parent2-${Utils.random()}`;
|
||||
let parent2Id: string;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id: string;
|
||||
const folder1Renamed = `renamed-${Utils.random()}`;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
@ -52,8 +51,8 @@ describe('Breadcrumb', () => {
|
||||
const { breadcrumb } = page;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
beforeAll(async (done) => {
|
||||
@ -78,11 +77,7 @@ describe('Breadcrumb', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(parentId),
|
||||
apis.user.nodes.deleteNodeById(parent2Id),
|
||||
apis.user.sites.deleteSite(siteName)
|
||||
]);
|
||||
await Promise.all([apis.user.nodes.deleteNodeById(parentId), apis.user.nodes.deleteNodeById(parent2Id), apis.user.sites.deleteSite(siteName)]);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -133,7 +128,7 @@ describe('Breadcrumb', () => {
|
||||
await page.dataTable.doubleClickOnRowByName(parent);
|
||||
await page.dataTable.doubleClickOnRowByName(subFolder1);
|
||||
await page.dataTable.doubleClickOnRowByName(subFolder2);
|
||||
const expectedBreadcrumb = [ 'Personal Files', parent, subFolder1, subFolder2 ];
|
||||
const expectedBreadcrumb = ['Personal Files', parent, subFolder1, subFolder2];
|
||||
expect(await breadcrumb.getAllItems()).toEqual(expectedBreadcrumb);
|
||||
});
|
||||
|
||||
@ -143,7 +138,7 @@ describe('Breadcrumb', () => {
|
||||
await page.dataTable.doubleClickOnRowByName(parent);
|
||||
await page.dataTable.doubleClickOnRowByName(subFolder1);
|
||||
await page.dataTable.doubleClickOnRowByName(subFolder2);
|
||||
const expectedItems = [ 'My Libraries', siteName, parent, subFolder1, subFolder2 ];
|
||||
const expectedItems = ['My Libraries', siteName, parent, subFolder1, subFolder2];
|
||||
expect(await breadcrumb.getAllItems()).toEqual(expectedItems);
|
||||
});
|
||||
|
||||
@ -153,7 +148,7 @@ describe('Breadcrumb', () => {
|
||||
await page.dataTable.doubleClickOnRowByName(subFolder1);
|
||||
await page.dataTable.doubleClickOnRowByName(subFolder2);
|
||||
await breadcrumb.clickItem(subFolder1);
|
||||
const expectedBreadcrumb = [ 'Personal Files', parent, subFolder1 ];
|
||||
const expectedBreadcrumb = ['Personal Files', parent, subFolder1];
|
||||
expect(await breadcrumb.getAllItems()).toEqual(expectedBreadcrumb);
|
||||
});
|
||||
|
||||
@ -174,7 +169,7 @@ describe('Breadcrumb', () => {
|
||||
await page.dataTable.doubleClickOnRowByName(parent2);
|
||||
await page.dataTable.doubleClickOnRowByName(folder1);
|
||||
await page.dataTable.wait();
|
||||
await apis.user.nodes.renameNode(folder1Id, folder1Renamed)
|
||||
await apis.user.nodes.renameNode(folder1Id, folder1Renamed);
|
||||
await page.refresh();
|
||||
await page.dataTable.wait();
|
||||
expect(await breadcrumb.currentItem.getText()).toEqual(folder1Renamed);
|
||||
@ -188,13 +183,14 @@ describe('Breadcrumb', () => {
|
||||
await page.clickTrash();
|
||||
await page.dataTable.waitForEmptyState();
|
||||
await browser.navigate().back();
|
||||
const expectedBreadcrumb = [ 'Personal Files', parent, subFolder1, subFolder2 ];
|
||||
const expectedBreadcrumb = ['Personal Files', parent, subFolder1, subFolder2];
|
||||
expect(await breadcrumb.getAllItems()).toEqual(expectedBreadcrumb);
|
||||
});
|
||||
|
||||
describe('as admin', () => {
|
||||
const user2 = `user2-${Utils.random()}`;
|
||||
const userFolder = `userFolder-${Utils.random()}`; let userFolderId;
|
||||
const userFolder = `userFolder-${Utils.random()}`;
|
||||
let userFolderId: string;
|
||||
const user2Api = new RepoClient(user2, user2);
|
||||
|
||||
beforeAll(async (done) => {
|
||||
@ -212,9 +208,9 @@ describe('Breadcrumb', () => {
|
||||
it(`[C260970] Breadcrumb on navigation to a user's home`, async () => {
|
||||
await page.dataTable.doubleClickOnRowByName('User Homes');
|
||||
await page.dataTable.doubleClickOnRowByName(user2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', 'User Homes', user2 ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', 'User Homes', user2]);
|
||||
await page.dataTable.doubleClickOnRowByName(userFolder);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', 'User Homes', user2, userFolder ]);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', 'User Homes', user2, userFolder]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -24,14 +24,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
APP_ROUTES,
|
||||
SIDEBAR_LABELS,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SearchResultsPage,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { APP_ROUTES, SIDEBAR_LABELS, LoginPage, BrowsingPage, SearchResultsPage, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Sidebar', () => {
|
||||
const loginPage = new LoginPage();
|
||||
|
@ -23,22 +23,20 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Viewer,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, Viewer, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Single click on item name', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id: string;
|
||||
|
||||
const deletedFile1 = `file1-${Utils.random()}.txt`; let deletedFile1Id;
|
||||
const deletedFolder1 = `folder1-${Utils.random()}`; let deletedFolder1Id;
|
||||
const deletedFile1 = `file1-${Utils.random()}.txt`;
|
||||
let deletedFile1Id: string;
|
||||
const deletedFolder1 = `folder1-${Utils.random()}`;
|
||||
let deletedFolder1Id: string;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileSite = `fileSite-${Utils.random()}.txt`;
|
||||
@ -65,7 +63,7 @@ describe('Single click on item name', () => {
|
||||
await apis.user.nodes.deleteNodeById(deletedFolder1Id, false);
|
||||
|
||||
await apis.user.sites.createSite(siteName);
|
||||
const docLibId = (await apis.user.sites.getDocLibId(siteName));
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
await apis.user.nodes.createFile(fileSite, docLibId);
|
||||
|
||||
await apis.user.shared.shareFileById(file1Id);
|
||||
@ -201,7 +199,7 @@ describe('Single click on item name', () => {
|
||||
});
|
||||
|
||||
describe('on Search Results', () => {
|
||||
beforeEach(async done => {
|
||||
beforeEach(async (done) => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkFilesAndFolders();
|
||||
done();
|
||||
@ -238,5 +236,4 @@ describe('Single click on item name', () => {
|
||||
expect(await breadcrumb.currentItem.getText()).toBe(folder1);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -30,7 +30,6 @@ export function favoritesTests() {
|
||||
const { dataTable, pagination } = page;
|
||||
|
||||
describe('Pagination controls : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
});
|
||||
@ -57,7 +56,7 @@ export function favoritesTests() {
|
||||
});
|
||||
|
||||
it('current page menu items - [C280115]', async () => {
|
||||
await pagination.openMaxItemsMenu()
|
||||
await pagination.openMaxItemsMenu();
|
||||
await pagination.menu.clickMenuItem('25');
|
||||
expect(await pagination.getMaxItems()).toContain('25');
|
||||
expect(await pagination.getTotalPages()).toContain('of 5');
|
||||
|
@ -23,12 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
Utils,
|
||||
AdminActions,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, Utils, AdminActions, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { personalFilesTests } from './personal-files';
|
||||
import { recentFilesTests } from './recent-files';
|
||||
import { searchResultsTests } from './search-results';
|
||||
@ -55,7 +50,7 @@ describe('Pagination on multiple pages : ', () => {
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await userApi.nodes.createFolder(parent)).entry.id;
|
||||
filesIds = (await userApi.nodes.createFiles(files, parent)).list.entries.map(entries => entries.entry.id);
|
||||
filesIds = (await userApi.nodes.createFiles(files, parent)).list.entries.map((entries: any) => entries.entry.id);
|
||||
|
||||
await userApi.shared.shareFilesByIds(filesIds);
|
||||
await userApi.favorites.addFavoritesByIds('file', filesIds);
|
||||
@ -63,7 +58,7 @@ describe('Pagination on multiple pages : ', () => {
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: 101 }),
|
||||
userApi.shared.waitForApi({ expect: 101 }),
|
||||
userApi.search.waitForApi(username, { expect: 101 }),
|
||||
userApi.search.waitForApi(username, { expect: 101 })
|
||||
]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
@ -92,5 +87,4 @@ describe('Pagination on multiple pages : ', () => {
|
||||
describe('on Favorites', () => {
|
||||
favoritesTests();
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,13 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
AdminActions,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, Utils, AdminActions, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Pagination on multiple pages', () => {
|
||||
const random = Utils.random();
|
||||
@ -56,7 +50,7 @@ describe('Pagination on multiple pages', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.sites.deleteSites(sites);
|
||||
})
|
||||
});
|
||||
|
||||
describe('on My Libraries', () => {
|
||||
beforeAll(async () => {
|
||||
@ -255,5 +249,4 @@ describe('Pagination on multiple pages', () => {
|
||||
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,13 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
Utils,
|
||||
AdminActions,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, Utils, AdminActions, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Pagination on multiple pages on Trash', () => {
|
||||
const random = Utils.random();
|
||||
@ -49,10 +43,10 @@ describe('Pagination on multiple pages on Trash', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
filesDeletedIds = (await userApi.nodes.createFiles(filesForDelete)).list.entries.map(entries => entries.entry.id);
|
||||
filesDeletedIds = (await userApi.nodes.createFiles(filesForDelete)).list.entries.map((entries: any) => entries.entry.id);
|
||||
|
||||
await userApi.nodes.deleteNodesById(filesDeletedIds, false);
|
||||
await userApi.trashcan.waitForApi({expect: 101});
|
||||
await userApi.trashcan.waitForApi({ expect: 101 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
await page.clickTrashAndWait();
|
||||
|
@ -30,7 +30,6 @@ export function personalFilesTests(parentName: string) {
|
||||
const { dataTable, pagination } = page;
|
||||
|
||||
describe('Pagination controls : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parentName);
|
||||
|
@ -30,7 +30,6 @@ export function recentFilesTests() {
|
||||
const { dataTable, pagination } = page;
|
||||
|
||||
describe('Pagination controls : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
});
|
||||
|
@ -31,7 +31,6 @@ export function searchResultsTests() {
|
||||
const { searchInput } = page.header;
|
||||
|
||||
describe('Pagination controls : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.searchFor('my-file-');
|
||||
|
@ -30,7 +30,6 @@ export function sharedFilesTests() {
|
||||
const { dataTable, pagination } = page;
|
||||
|
||||
describe('Pagination controls : ', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SearchResultsPage,
|
||||
Utils,
|
||||
AdminActions,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, Utils, AdminActions, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Pagination on single page', () => {
|
||||
const random = Utils.random();
|
||||
@ -76,11 +69,7 @@ describe('Pagination on single page', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await Promise.all([
|
||||
userApi.nodes.deleteNodeById(fileId),
|
||||
userApi.sites.deleteSite(siteId),
|
||||
userApi.trashcan.emptyTrash()
|
||||
]);
|
||||
await Promise.all([userApi.nodes.deleteNodeById(fileId), userApi.sites.deleteSite(siteId), userApi.trashcan.emptyTrash()]);
|
||||
});
|
||||
|
||||
it('[C280112] page selector not displayed on Favorites', async () => {
|
||||
@ -124,5 +113,4 @@ describe('Pagination on single page', () => {
|
||||
await searchResultsPage.waitForResults();
|
||||
expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed');
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,17 +23,9 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
SearchResultsPage,
|
||||
RepoClient,
|
||||
Utils,
|
||||
FILES,
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils, FILES, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-testing-shared';
|
||||
|
||||
import * as moment from 'moment';
|
||||
const moment = require('moment');
|
||||
|
||||
describe('Search filters', () => {
|
||||
const random = Utils.random();
|
||||
@ -44,7 +36,8 @@ describe('Search filters', () => {
|
||||
const parent = `parent-${random}`;
|
||||
let parentId: string;
|
||||
|
||||
const site = `site-${Utils.random()}`; let docLibId;
|
||||
const site = `site-${Utils.random()}`;
|
||||
let docLibId: string;
|
||||
|
||||
const fileJpgUser1 = {
|
||||
name: `search-filters-file-1-${random}.jpg`,
|
||||
@ -112,10 +105,7 @@ describe('Search filters', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user1.nodes.deleteNodeById(parentId),
|
||||
apis.user1.sites.deleteSite(site)
|
||||
]);
|
||||
await Promise.all([apis.user1.nodes.deleteNodeById(parentId), apis.user1.sites.deleteSite(site)]);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -562,7 +552,10 @@ describe('Search filters', () => {
|
||||
await modifiedDateFilter.expandPanel();
|
||||
expect(await modifiedDateFilter.getFiltersValues()).toEqual(expectedDateFilters, 'Incorrect Modified date filters facets');
|
||||
await modifiedDateFilter.filterCategoriesBy('This');
|
||||
expect(await modifiedDateFilter.getFiltersValues()).toEqual(['This week (2)', 'This month (2)', 'This year (2)'], 'Incorrect Modified date filters facets');
|
||||
expect(await modifiedDateFilter.getFiltersValues()).toEqual(
|
||||
['This week (2)', 'This month (2)', 'This year (2)'],
|
||||
'Incorrect Modified date filters facets'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -23,29 +23,23 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
SearchResultsPage,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
import * as moment from 'moment';
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
const moment = require('moment');
|
||||
|
||||
describe('Search results - files and folders', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file = `test-file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
let fileId: string;
|
||||
const fileTitle = 'file title';
|
||||
const fileDescription = 'file description';
|
||||
|
||||
/* cspell:disable-next-line */
|
||||
const fileRussian = `любимый-сайт-${Utils.random()}`;
|
||||
let fileRussianId;
|
||||
let fileRussianId: string;
|
||||
|
||||
const folder = `test-folder-${Utils.random()}`;
|
||||
let folderId;
|
||||
let folderId: string;
|
||||
const folderTitle = 'folder title';
|
||||
const folderDescription = 'folder description';
|
||||
|
||||
@ -61,7 +55,7 @@ describe('Search results - files and folders', () => {
|
||||
const { searchInput } = page.header;
|
||||
const { dataTable, breadcrumb } = page;
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
|
||||
fileId = (await apis.user.nodes.createFile(file, '-my-', fileTitle, fileDescription)).entry.id;
|
||||
@ -77,12 +71,12 @@ describe('Search results - files and folders', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async done => {
|
||||
beforeEach(async (done) => {
|
||||
await page.refresh();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async done => {
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(fileId),
|
||||
apis.user.nodes.deleteNodeById(fileRussianId),
|
||||
|
@ -23,20 +23,16 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
SearchResultsPage,
|
||||
RepoClient,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Search results general', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file = `test-file-${Utils.random()}.txt`; let fileId;
|
||||
const folder = `test-folder-${Utils.random()}`; let folderId;
|
||||
const file = `test-file-${Utils.random()}.txt`;
|
||||
let fileId: string;
|
||||
const folder = `test-folder-${Utils.random()}`;
|
||||
let folderId: string;
|
||||
const site = `test-site-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
@ -64,11 +60,7 @@ describe('Search results general', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(fileId),
|
||||
apis.user.nodes.deleteNodeById(folderId),
|
||||
apis.user.sites.deleteSite(site)
|
||||
]);
|
||||
await Promise.all([apis.user.nodes.deleteNodeById(fileId), apis.user.nodes.deleteNodeById(folderId), apis.user.sites.deleteSite(site)]);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -152,5 +144,4 @@ describe('Search results general', () => {
|
||||
|
||||
expect(await dataTable.isItemPresent(site)).toBe(true, `${site} not displayed`);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,14 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
SearchResultsPage,
|
||||
RepoClient,
|
||||
Utils,
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Search results - libraries', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@ -114,8 +107,8 @@ describe('Search results - libraries', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSites([ adminSite1, adminSite2, adminSite3, adminSite4, adminPrivate ]),
|
||||
apis.user.sites.deleteSites([ site1.id, site2.id, site3.id, site4.id, userSitePublic, userSiteModerated, userSitePrivate, siteRussian.id ])
|
||||
apis.admin.sites.deleteSites([adminSite1, adminSite2, adminSite3, adminSite4, adminPrivate]),
|
||||
apis.user.sites.deleteSites([site1.id, site2.id, site3.id, site4.id, userSitePublic, userSiteModerated, userSitePrivate, siteRussian.id])
|
||||
]);
|
||||
done();
|
||||
});
|
||||
@ -176,7 +169,7 @@ describe('Search results - libraries', () => {
|
||||
await searchInput.searchFor(site1.name);
|
||||
await dataTable.waitForBody();
|
||||
|
||||
const expectedColumns = [ 'Name', 'Description', 'My Role', 'Visibility' ];
|
||||
const expectedColumns = ['Name', 'Description', 'My Role', 'Visibility'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
expect(actualColumns).toEqual(expectedColumns);
|
||||
@ -214,7 +207,7 @@ describe('Search results - libraries', () => {
|
||||
[adminSite4]: SITE_ROLES.SITE_MANAGER.LABEL
|
||||
};
|
||||
|
||||
const sitesList = await dataTable.getSitesNameAndRole();
|
||||
const sitesList: any = await dataTable.getSitesNameAndRole();
|
||||
|
||||
for (const site of Object.keys(expectedSitesRoles)) {
|
||||
expect(sitesList[site]).toEqual(expectedSitesRoles[site]);
|
||||
@ -238,5 +231,4 @@ describe('Search results - libraries', () => {
|
||||
|
||||
expect(await dataTable.isItemPresent(siteRussian.name)).toBe(true, `${siteRussian.name} not displayed`);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -23,13 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
SearchResultsPage,
|
||||
RepoClient,
|
||||
Utils,
|
||||
FILES
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils, FILES } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Search sorting', () => {
|
||||
const random = Utils.random();
|
||||
@ -101,7 +95,7 @@ describe('Search sorting', () => {
|
||||
|
||||
await page.sortingPicker.clickSortByDropdown();
|
||||
|
||||
const expectedOptions = [ 'Relevance', 'Filename', 'Title', 'Modified date', 'Modifier', 'Created date', 'Size', 'Type' ];
|
||||
const expectedOptions = ['Relevance', 'Filename', 'Title', 'Modified date', 'Modifier', 'Created date', 'Size', 'Type'];
|
||||
expect(await page.sortingPicker.getSortByOptionsList()).toEqual(expectedOptions, 'Incorrect sort options list');
|
||||
});
|
||||
|
||||
|
@ -59,25 +59,33 @@ describe('Viewer actions', () => {
|
||||
const manageVersionsDialog = new ManageVersionsDialog();
|
||||
const uploadNewVersionDialog = new UploadNewVersionDialog();
|
||||
|
||||
beforeAll(async done => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
done();
|
||||
});
|
||||
|
||||
describe('from Personal Files', () => {
|
||||
const parent = `parentPF-${Utils.random()}`; let parentId;
|
||||
const destination = `destPF-${Utils.random()}`; let destinationId;
|
||||
const parent = `parentPF-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
const destination = `destPF-${Utils.random()}`;
|
||||
let destinationId: string;
|
||||
|
||||
const docxPersonalFiles = `docxPF-${Utils.random()}.docx`; let docxFileId;
|
||||
const docxPersonalFiles = `docxPF-${Utils.random()}.docx`;
|
||||
let docxFileId: string;
|
||||
|
||||
const xlsxPersonalFiles = `xlsxPF-${Utils.random()}.xlsx`;
|
||||
const pdfPersonalFiles = `pdfPF-${Utils.random()}.pdf`;
|
||||
const filePersonalFiles = docxFile2; let filePersonalFilesId;
|
||||
const filePersonalFiles = docxFile2;
|
||||
let filePersonalFilesId: string;
|
||||
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`; let fileForEditOfflineId;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`; let fileForCancelEditingId;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`; let fileForUploadNewVersionId;
|
||||
const fileForUploadNewVersion2 = `file4-${Utils.random()}.docx`; let fileForUploadNewVersionId2;
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`;
|
||||
let fileForEditOfflineId: string;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`;
|
||||
let fileForCancelEditingId: string;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
|
||||
let fileForUploadNewVersionId: string;
|
||||
const fileForUploadNewVersion2 = `file4-${Utils.random()}.docx`;
|
||||
let fileForUploadNewVersionId2: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
@ -98,7 +106,6 @@ describe('Viewer actions', () => {
|
||||
await apis.user.nodes.lockFile(fileForUploadNewVersionId);
|
||||
await apis.user.nodes.lockFile(fileForUploadNewVersionId2);
|
||||
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
@ -291,17 +298,23 @@ describe('Viewer actions', () => {
|
||||
|
||||
describe('from File Libraries', () => {
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const destination = `destFL-${Utils.random()}`; let destinationId;
|
||||
const destination = `destFL-${Utils.random()}`;
|
||||
let destinationId: string;
|
||||
|
||||
const docxLibraries = `docxFL-${Utils.random()}.docx`; let docxFileId;
|
||||
const docxLibraries = `docxFL-${Utils.random()}.docx`;
|
||||
let docxFileId: string;
|
||||
|
||||
const xlsxLibraries = `xlsxFL-${Utils.random()}.xlsx`;
|
||||
const pdfLibraries = `pdfFL-${Utils.random()}.pdf`;
|
||||
const fileLibraries = docxFile2; let fileLibrariesId;
|
||||
const fileLibraries = docxFile2;
|
||||
let fileLibrariesId: string;
|
||||
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`; let fileForEditOfflineId;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`; let fileForCancelEditingId;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`; let fileForUploadNewVersionId;
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`;
|
||||
let fileForEditOfflineId: string;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`;
|
||||
let fileForCancelEditingId: string;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
|
||||
let fileForUploadNewVersionId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.sites.createSite(siteName);
|
||||
@ -469,21 +482,28 @@ describe('Viewer actions', () => {
|
||||
});
|
||||
|
||||
describe('from Recent Files', () => {
|
||||
const parent = `parentRF-${Utils.random()}`; let parentId;
|
||||
const destination = `destRF-${Utils.random()}`; let destinationId;
|
||||
const parent = `parentRF-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
const destination = `destRF-${Utils.random()}`;
|
||||
let destinationId: string;
|
||||
|
||||
const docxRecentFiles = `docxRF-${Utils.random()}.docx`; let docxFileId;
|
||||
const docxRecentFiles = `docxRF-${Utils.random()}.docx`;
|
||||
let docxFileId: string;
|
||||
|
||||
const xlsxRecentFiles = `xlsxRF-${Utils.random()}.xlsx`;
|
||||
const pdfRecentFiles = `pdfRF-${Utils.random()}.pdf`;
|
||||
const fileRecent = docxFile2; let fileRecentId;
|
||||
const fileRecent = docxFile2;
|
||||
let fileRecentId: string;
|
||||
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`; let fileForEditOfflineId;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`; let fileForCancelEditingId;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`; let fileForUploadNewVersionId;
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`;
|
||||
let fileForEditOfflineId: string;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`;
|
||||
let fileForCancelEditingId: string;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
|
||||
let fileForUploadNewVersionId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.search.waitForApi(username, {expect: 0});
|
||||
await apis.user.search.waitForApi(username, { expect: 0 });
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
destinationId = (await apis.user.nodes.createFolder(destination)).entry.id;
|
||||
@ -498,11 +518,10 @@ describe('Viewer actions', () => {
|
||||
await apis.user.nodes.lockFile(fileForCancelEditingId);
|
||||
await apis.user.nodes.lockFile(fileForUploadNewVersionId);
|
||||
|
||||
|
||||
await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxRecentFiles);
|
||||
await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfRecentFiles);
|
||||
|
||||
await apis.user.search.waitForApi(username, {expect: 7});
|
||||
await apis.user.search.waitForApi(username, { expect: 7 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
@ -651,18 +670,27 @@ describe('Viewer actions', () => {
|
||||
});
|
||||
|
||||
describe('from Shared Files', () => {
|
||||
const parent = `parentSF-${Utils.random()}`; let parentId;
|
||||
const destination = `destSF-${Utils.random()}`; let destinationId;
|
||||
const parent = `parentSF-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
const destination = `destSF-${Utils.random()}`;
|
||||
let destinationId: string;
|
||||
|
||||
const docxSharedFiles = `docxSF-${Utils.random()}.docx`; let docxFileId;
|
||||
const docxSharedFiles = `docxSF-${Utils.random()}.docx`;
|
||||
let docxFileId: string;
|
||||
|
||||
const xlsxSharedFiles = `xlsxSF-${Utils.random()}.xlsx`; let xlsxFileId;
|
||||
const pdfSharedFiles = `pdfSF-${Utils.random()}.pdf`; let pdfFileId;
|
||||
const fileShared = docxFile2; let fileSharedId;
|
||||
const xlsxSharedFiles = `xlsxSF-${Utils.random()}.xlsx`;
|
||||
let xlsxFileId: string;
|
||||
const pdfSharedFiles = `pdfSF-${Utils.random()}.pdf`;
|
||||
let pdfFileId: string;
|
||||
const fileShared = docxFile2;
|
||||
let fileSharedId: string;
|
||||
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`; let fileForEditOfflineId;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`; let fileForCancelEditingId;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`; let fileForUploadNewVersionId;
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`;
|
||||
let fileForEditOfflineId: string;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`;
|
||||
let fileForCancelEditingId: string;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
|
||||
let fileForUploadNewVersionId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
@ -680,8 +708,16 @@ describe('Viewer actions', () => {
|
||||
await apis.user.nodes.lockFile(fileForCancelEditingId);
|
||||
await apis.user.nodes.lockFile(fileForUploadNewVersionId);
|
||||
|
||||
await apis.user.shared.shareFilesByIds([docxFileId, xlsxFileId, pdfFileId, fileForCancelEditingId, fileForEditOfflineId, fileForUploadNewVersionId, fileSharedId])
|
||||
await apis.user.shared.waitForApi({expect: 7});
|
||||
await apis.user.shared.shareFilesByIds([
|
||||
docxFileId,
|
||||
xlsxFileId,
|
||||
pdfFileId,
|
||||
fileForCancelEditingId,
|
||||
fileForEditOfflineId,
|
||||
fileForUploadNewVersionId,
|
||||
fileSharedId
|
||||
]);
|
||||
await apis.user.shared.waitForApi({ expect: 7 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
@ -831,19 +867,26 @@ describe('Viewer actions', () => {
|
||||
|
||||
describe('from Favorites', () => {
|
||||
const parent = `parentFav-${Utils.random()}`;
|
||||
let parentId;
|
||||
let parentId: string;
|
||||
const destination = `destFav-${Utils.random()}`;
|
||||
let destinationId;
|
||||
let destinationId: string;
|
||||
|
||||
const docxFavorites = `docxFav-${Utils.random()}.docx`; let docxFileId;
|
||||
const docxFavorites = `docxFav-${Utils.random()}.docx`;
|
||||
let docxFileId: string;
|
||||
|
||||
const xlsxFavorites = `xlsxFav-${Utils.random()}.xlsx`; let xlsxFileId;
|
||||
const pdfFavorites = `pdfFav-${Utils.random()}.pdf`; let pdfFileId;
|
||||
const fileFav = docxFile2; let fileFavId;
|
||||
const xlsxFavorites = `xlsxFav-${Utils.random()}.xlsx`;
|
||||
let xlsxFileId: string;
|
||||
const pdfFavorites = `pdfFav-${Utils.random()}.pdf`;
|
||||
let pdfFileId: string;
|
||||
const fileFav = docxFile2;
|
||||
let fileFavId: string;
|
||||
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`; let fileForEditOfflineId;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`; let fileForCancelEditingId;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`; let fileForUploadNewVersionId;
|
||||
const fileForEditOffline = `file1-${Utils.random()}.docx`;
|
||||
let fileForEditOfflineId: string;
|
||||
const fileForCancelEditing = `file2-${Utils.random()}.docx`;
|
||||
let fileForCancelEditingId: string;
|
||||
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`;
|
||||
let fileForUploadNewVersionId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
@ -861,9 +904,16 @@ describe('Viewer actions', () => {
|
||||
await apis.user.nodes.lockFile(fileForCancelEditingId);
|
||||
await apis.user.nodes.lockFile(fileForUploadNewVersionId);
|
||||
|
||||
|
||||
await apis.user.favorites.addFavoritesByIds('file', [docxFileId, xlsxFileId, pdfFileId, fileForEditOfflineId, fileForCancelEditingId, fileForUploadNewVersionId, fileFavId])
|
||||
await apis.user.favorites.waitForApi({expect: 7});
|
||||
await apis.user.favorites.addFavoritesByIds('file', [
|
||||
docxFileId,
|
||||
xlsxFileId,
|
||||
pdfFileId,
|
||||
fileForEditOfflineId,
|
||||
fileForCancelEditingId,
|
||||
fileForUploadNewVersionId,
|
||||
fileFavId
|
||||
]);
|
||||
await apis.user.favorites.waitForApi({ expect: 7 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
|
@ -23,175 +23,172 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
FILES, SITE_VISIBILITY,
|
||||
RepoClient,
|
||||
Utils,
|
||||
Viewer
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, FILES, SITE_VISIBILITY, RepoClient, Utils, Viewer } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Viewer general', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const xlsxFile = FILES.xlsxFile; let xlsxFileId;
|
||||
const fileAdmin = FILES.docxFile; let fileAdminId;
|
||||
const xlsxFile = FILES.xlsxFile;
|
||||
let xlsxFileId: string;
|
||||
const fileAdmin = FILES.docxFile;
|
||||
let fileAdminId: string;
|
||||
|
||||
const siteAdmin = `siteAdmin-${Utils.random()}`; let docLibId;
|
||||
const siteUser = `siteUser-${Utils.random()}`; let docLibSiteUserId;
|
||||
const siteAdmin = `siteAdmin-${Utils.random()}`;
|
||||
let docLibId: string;
|
||||
const siteUser = `siteUser-${Utils.random()}`;
|
||||
let docLibSiteUserId: string;
|
||||
|
||||
const fileInSite = FILES.docxFile;
|
||||
const fileInSite = FILES.docxFile;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const viewer = new Viewer();
|
||||
const { searchInput } = page.header;
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const viewer = new Viewer();
|
||||
const { searchInput } = page.header;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
xlsxFileId = (await apis.user.upload.uploadFile(xlsxFile, parentId)).entry.id;
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
xlsxFileId = (await apis.user.upload.uploadFile(xlsxFile, parentId)).entry.id;
|
||||
|
||||
await apis.admin.sites.createSite(siteAdmin, SITE_VISIBILITY.PRIVATE);
|
||||
docLibId = await apis.admin.sites.getDocLibId(siteAdmin);
|
||||
fileAdminId = (await apis.admin.upload.uploadFile(fileAdmin, docLibId)).entry.id;
|
||||
await apis.admin.sites.createSite(siteAdmin, SITE_VISIBILITY.PRIVATE);
|
||||
docLibId = await apis.admin.sites.getDocLibId(siteAdmin);
|
||||
fileAdminId = (await apis.admin.upload.uploadFile(fileAdmin, docLibId)).entry.id;
|
||||
|
||||
await apis.user.sites.createSite(siteUser, SITE_VISIBILITY.PUBLIC);
|
||||
docLibSiteUserId = await apis.user.sites.getDocLibId(siteUser);
|
||||
await apis.user.upload.uploadFile(fileInSite, docLibSiteUserId);
|
||||
await apis.user.sites.createSite(siteUser, SITE_VISIBILITY.PUBLIC);
|
||||
docLibSiteUserId = await apis.user.sites.getDocLibId(siteUser);
|
||||
await apis.user.upload.uploadFile(fileInSite, docLibSiteUserId);
|
||||
|
||||
await apis.user.shared.shareFileById(xlsxFileId);
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
await apis.user.favorites.addFavoriteById('file', xlsxFileId);
|
||||
await apis.user.favorites.waitForApi({ expect: 2 });
|
||||
await apis.user.shared.shareFileById(xlsxFileId);
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
await apis.user.favorites.addFavoriteById('file', xlsxFileId);
|
||||
await apis.user.favorites.waitForApi({ expect: 2 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.header.expandSideNav();
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
beforeEach(async (done) => {
|
||||
await page.header.expandSideNav();
|
||||
await page.clickPersonalFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.header.expandSideNav();
|
||||
done();
|
||||
});
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.header.expandSideNav();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
await apis.admin.sites.deleteSite(siteAdmin);
|
||||
await apis.user.sites.deleteSite(siteUser);
|
||||
done();
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
await apis.admin.sites.deleteSite(siteAdmin);
|
||||
await apis.user.sites.deleteSite(siteUser);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C279269] Viewer opens on double clicking on a file from Personal Files', async () => {
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
});
|
||||
it('[C279269] Viewer opens on double clicking on a file from Personal Files', async () => {
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
});
|
||||
|
||||
it('[C279270] Viewer opens when clicking the View action for a file', async () => {
|
||||
await dataTable.selectItem(xlsxFile);
|
||||
await page.toolbar.viewButton.click();
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
});
|
||||
it('[C279270] Viewer opens when clicking the View action for a file', async () => {
|
||||
await dataTable.selectItem(xlsxFile);
|
||||
await page.toolbar.viewButton.click();
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
});
|
||||
|
||||
it('[C279283] The viewer general elements are displayed', async () => {
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
it('[C279283] The viewer general elements are displayed', async () => {
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
|
||||
it('[C279271] Close the viewer', async () => {
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
await viewer.closeButton.click();
|
||||
expect(await viewer.isViewerOpened()).toBe(false, 'Viewer did not close');
|
||||
});
|
||||
it('[C279271] Close the viewer', async () => {
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
await viewer.closeButton.click();
|
||||
expect(await viewer.isViewerOpened()).toBe(false, 'Viewer did not close');
|
||||
});
|
||||
|
||||
it('[C284632] Close button tooltip', async () => {
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.getCloseButtonTooltip()).toEqual('Close');
|
||||
});
|
||||
it('[C284632] Close button tooltip', async () => {
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.getCloseButtonTooltip()).toEqual('Close');
|
||||
});
|
||||
|
||||
it('[C279285] Viewer opens when accessing the preview URL for a file', async () => {
|
||||
const previewURL = `personal-files/${parentId}/(viewer:view/${xlsxFileId})`
|
||||
await page.load(previewURL);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.getFileTitle()).toEqual(xlsxFile);
|
||||
});
|
||||
it('[C279285] Viewer opens when accessing the preview URL for a file', async () => {
|
||||
const previewURL = `personal-files/${parentId}/(viewer:view/${xlsxFileId})`;
|
||||
await page.load(previewURL);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.getFileTitle()).toEqual(xlsxFile);
|
||||
});
|
||||
|
||||
it('[C279287] Viewer does not open when accessing the preview URL for a file without permissions', async () => {
|
||||
const previewURL = `libraries/${docLibId}/(viewer:view/${fileAdminId})`
|
||||
await page.load(previewURL);
|
||||
expect(await viewer.isViewerOpened()).toBe(false, 'Viewer should not be opened!');
|
||||
});
|
||||
it('[C279287] Viewer does not open when accessing the preview URL for a file without permissions', async () => {
|
||||
const previewURL = `libraries/${docLibId}/(viewer:view/${fileAdminId})`;
|
||||
await page.load(previewURL);
|
||||
expect(await viewer.isViewerOpened()).toBe(false, 'Viewer should not be opened!');
|
||||
});
|
||||
|
||||
it('[C284633] Viewer opens for a file from File Libraries', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteUser);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(fileInSite);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
it('[C284633] Viewer opens for a file from File Libraries', async () => {
|
||||
await page.goToMyLibrariesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(siteUser);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(fileInSite);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
|
||||
it('[C284636] Viewer opens for a file from Recent Files', async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
it('[C284636] Viewer opens for a file from Recent Files', async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
|
||||
it('[C284635] Viewer opens for a file from Shared Files', async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
it('[C284635] Viewer opens for a file from Shared Files', async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
|
||||
it('[C284634] Viewer opens for a file from Favorites', async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
it('[C284634] Viewer opens for a file from Favorites', async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
|
||||
it('[C279175] Viewer opens for a file from Search Results', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkFilesAndFolders();
|
||||
await searchInput.searchFor(xlsxFile);
|
||||
await dataTable.waitForBody();
|
||||
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
it('[C279175] Viewer opens for a file from Search Results', async () => {
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkFilesAndFolders();
|
||||
await searchInput.searchFor(xlsxFile);
|
||||
await dataTable.waitForBody();
|
||||
|
||||
await dataTable.doubleClickOnRowByName(xlsxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed');
|
||||
expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed');
|
||||
expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed');
|
||||
});
|
||||
});
|
||||
|
@ -23,20 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
FILES,
|
||||
RepoClient,
|
||||
Utils,
|
||||
Viewer,
|
||||
PasswordDialog
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, FILES, RepoClient, Utils, Viewer, PasswordDialog } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Viewer - password protected file', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const protectedFile = FILES.protectedFile;
|
||||
|
||||
|
@ -2,6 +2,10 @@
|
||||
"extends": "./tsconfig.e2e.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"noUnusedLocals": true
|
||||
"noUnusedLocals": true,
|
||||
"noImplicitAny": true,
|
||||
"esModuleInterop": true,
|
||||
"allowJs": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
}
|
||||
}
|
||||
|
28
package-lock.json
generated
28
package-lock.json
generated
@ -2683,12 +2683,24 @@
|
||||
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/cookiejar": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz",
|
||||
"integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/estree": {
|
||||
"version": "0.0.39",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
|
||||
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/event-emitter": {
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/event-emitter/-/event-emitter-0.3.3.tgz",
|
||||
"integrity": "sha512-UfnOK1pIxO7P+EgPRZXD9jMpimd8QEFcEZ5R67R1UhGbv4zghU5+NE7U8M8G9H5Jc8FI51rqDWQs6FtUfq2e/Q==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz",
|
||||
@ -2777,6 +2789,16 @@
|
||||
"integrity": "sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/superagent": {
|
||||
"version": "4.1.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.8.tgz",
|
||||
"integrity": "sha512-iol9KxQ7SLHatBJUiZ4uABrS4VS1frLjqPednxZz82eoCzo3Uy3TOH0p0ZIBbfBj8E/xqOtvizjBs9h7xi/l2g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/cookiejar": "*",
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/webpack-sources": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.8.tgz",
|
||||
@ -14144,9 +14166,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
||||
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
|
||||
"integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
|
||||
"dev": true
|
||||
},
|
||||
"process": {
|
||||
|
@ -73,10 +73,12 @@
|
||||
"@angular/cli": "^10.0.2",
|
||||
"@angular/compiler-cli": "10.0.3",
|
||||
"@angular/language-service": "10.0.3",
|
||||
"@types/event-emitter": "^0.3.3",
|
||||
"@types/jasmine": "3.5.11",
|
||||
"@types/jasminewd2": "^2.0.8",
|
||||
"@types/node": "^14.0.23",
|
||||
"@types/selenium-webdriver": "^4.0.9",
|
||||
"@types/superagent": "^4.1.8",
|
||||
"adf-tslint-rules": "0.0.7",
|
||||
"ajv-cli": "^3.1.0",
|
||||
"chrome-remote-interface": "^0.28.2",
|
||||
@ -96,7 +98,7 @@
|
||||
"lint-staged": "^10.2.11",
|
||||
"ng-packagr": "^10.0.1",
|
||||
"node-stream-zip": "^1.9.1",
|
||||
"prettier": "^1.17.1",
|
||||
"prettier": "^2.0.5",
|
||||
"protractor": "^7.0.0",
|
||||
"protractor-screenshoter-plugin": "0.10.3",
|
||||
"rxjs-tslint": "^0.1.8",
|
||||
|
@ -38,11 +38,7 @@ export interface AcaRuleContext extends RuleContext {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canCopyNode(context: RuleContext): boolean {
|
||||
return [
|
||||
hasSelection(context),
|
||||
navigation.isNotTrashcan(context),
|
||||
navigation.isNotLibraries(context)
|
||||
].every(Boolean);
|
||||
return [hasSelection(context), navigation.isNotTrashcan(context), navigation.isNotLibraries(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,14 +47,10 @@ export function canCopyNode(context: RuleContext): boolean {
|
||||
*/
|
||||
export function canAddFavorite(context: RuleContext): boolean {
|
||||
if (!context.selection.isEmpty) {
|
||||
if (
|
||||
navigation.isFavorites(context) ||
|
||||
navigation.isLibraries(context) ||
|
||||
navigation.isTrashcan(context)
|
||||
) {
|
||||
if (navigation.isFavorites(context) || navigation.isLibraries(context) || navigation.isTrashcan(context)) {
|
||||
return false;
|
||||
}
|
||||
return context.selection.nodes.some(node => !node.entry.isFavorite);
|
||||
return context.selection.nodes.some((node) => !node.entry.isFavorite);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -72,7 +64,7 @@ export function canRemoveFavorite(context: RuleContext): boolean {
|
||||
if (navigation.isFavorites(context)) {
|
||||
return true;
|
||||
}
|
||||
return context.selection.nodes.every(node => node.entry.isFavorite);
|
||||
return context.selection.nodes.every((node) => node.entry.isFavorite);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -82,12 +74,7 @@ export function canRemoveFavorite(context: RuleContext): boolean {
|
||||
* JSON ref: `app.selection.file.canShare`
|
||||
*/
|
||||
export function canShareFile(context: RuleContext): boolean {
|
||||
return [
|
||||
context.selection.file,
|
||||
navigation.isNotTrashcan(context),
|
||||
repository.hasQuickShareEnabled(context),
|
||||
!isShared(context)
|
||||
].every(Boolean);
|
||||
return [context.selection.file, navigation.isNotTrashcan(context), repository.hasQuickShareEnabled(context), !isShared(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,11 +82,7 @@ export function canShareFile(context: RuleContext): boolean {
|
||||
* JSON ref: `canToggleJoinLibrary`
|
||||
*/
|
||||
export function canToggleJoinLibrary(context: RuleContext): boolean {
|
||||
return [
|
||||
hasLibrarySelected(context),
|
||||
!isPrivateLibrary(context),
|
||||
hasNoLibraryRole(context)
|
||||
].every(Boolean);
|
||||
return [hasLibrarySelected(context), !isPrivateLibrary(context), hasNoLibraryRole(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,10 +91,7 @@ export function canToggleJoinLibrary(context: RuleContext): boolean {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canEditFolder(context: RuleContext): boolean {
|
||||
return [
|
||||
canUpdateSelectedFolder(context),
|
||||
navigation.isNotTrashcan(context)
|
||||
].every(Boolean);
|
||||
return [canUpdateSelectedFolder(context), navigation.isNotTrashcan(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -123,15 +103,8 @@ export function isShared(context: RuleContext): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
(navigation.isNotTrashcan(context),
|
||||
!context.selection.isEmpty && context.selection.file)
|
||||
) {
|
||||
return !!(
|
||||
context.selection.file.entry &&
|
||||
context.selection.file.entry.properties &&
|
||||
context.selection.file.entry.properties['qshare:sharedId']
|
||||
);
|
||||
if ((navigation.isNotTrashcan(context), !context.selection.isEmpty && context.selection.file)) {
|
||||
return !!(context.selection.file.entry && context.selection.file.entry.properties && context.selection.file.entry.properties['qshare:sharedId']);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -225,10 +198,7 @@ export function canUpload(context: RuleContext): boolean {
|
||||
export function canDownloadSelection(context: RuleContext): boolean {
|
||||
if (!context.selection.isEmpty && navigation.isNotTrashcan(context)) {
|
||||
return context.selection.nodes.every((node: any) => {
|
||||
return (
|
||||
node.entry &&
|
||||
(node.entry.isFile || node.entry.isFolder || !!node.entry.nodeId)
|
||||
);
|
||||
return node.entry && (node.entry.isFile || node.entry.isFolder || !!node.entry.nodeId);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
@ -258,13 +228,7 @@ export function hasLibrarySelected(context: RuleContext): boolean {
|
||||
*/
|
||||
export function isPrivateLibrary(context: RuleContext): boolean {
|
||||
const library = context.selection.library;
|
||||
return library
|
||||
? !!(
|
||||
library.entry &&
|
||||
library.entry.visibility &&
|
||||
library.entry.visibility === 'PRIVATE'
|
||||
)
|
||||
: false;
|
||||
return library ? !!(library.entry && library.entry.visibility && library.entry.visibility === 'PRIVATE') : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -321,8 +285,7 @@ export function canUpdateSelectedFolder(context: RuleContext): boolean {
|
||||
if (folder) {
|
||||
return (
|
||||
// workaround for Favorites Api
|
||||
navigation.isFavorites(context) ||
|
||||
context.permissions.check(folder.entry, ['update'])
|
||||
navigation.isFavorites(context) || context.permissions.check(folder.entry, ['update'])
|
||||
);
|
||||
}
|
||||
return false;
|
||||
@ -334,16 +297,12 @@ export function canUpdateSelectedFolder(context: RuleContext): boolean {
|
||||
*/
|
||||
export function hasLockedFiles(context: RuleContext): boolean {
|
||||
if (context && context.selection && context.selection.nodes) {
|
||||
return context.selection.nodes.some(node => {
|
||||
return context.selection.nodes.some((node) => {
|
||||
if (!node.entry.isFile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
node.entry.isLocked ||
|
||||
(node.entry.properties &&
|
||||
node.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK')
|
||||
);
|
||||
return node.entry.isLocked || (node.entry.properties && node.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK');
|
||||
});
|
||||
}
|
||||
|
||||
@ -362,8 +321,7 @@ export function isWriteLocked(context: RuleContext): boolean {
|
||||
context.selection.file.entry &&
|
||||
context.selection.file.entry.properties &&
|
||||
(context.selection.file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||
|
||||
context.selection.file.entry.properties['cm:lockType'] ===
|
||||
'READ_ONLY_LOCK')
|
||||
context.selection.file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK')
|
||||
);
|
||||
}
|
||||
|
||||
@ -376,8 +334,7 @@ export function isUserWriteLockOwner(context: RuleContext): boolean {
|
||||
return (
|
||||
isWriteLocked(context) &&
|
||||
context.selection.file.entry.properties['cm:lockOwner'] &&
|
||||
context.selection.file.entry.properties['cm:lockOwner'].id ===
|
||||
context.profile.id
|
||||
context.selection.file.entry.properties['cm:lockOwner'].id === context.profile.id
|
||||
);
|
||||
}
|
||||
|
||||
@ -395,11 +352,7 @@ export function canLockFile(context: RuleContext): boolean {
|
||||
*/
|
||||
export function canUnlockFile(context: RuleContext): boolean {
|
||||
const { file } = context.selection;
|
||||
return (
|
||||
isWriteLocked(context) &&
|
||||
(context.permissions.check(file.entry, ['delete']) ||
|
||||
isUserWriteLockOwner(context))
|
||||
);
|
||||
return isWriteLocked(context) && (context.permissions.check(file.entry, ['delete']) || isUserWriteLockOwner(context));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -414,9 +367,7 @@ export function canUploadVersion(context: RuleContext): boolean {
|
||||
return [
|
||||
hasFileSelected(context),
|
||||
navigation.isNotTrashcan(context),
|
||||
isWriteLocked(context)
|
||||
? isUserWriteLockOwner(context)
|
||||
: canUpdateSelectedNode(context)
|
||||
isWriteLocked(context) ? isUserWriteLockOwner(context) : canUpdateSelectedNode(context)
|
||||
].every(Boolean);
|
||||
}
|
||||
|
||||
@ -435,9 +386,7 @@ export function isTrashcanItemSelected(context: RuleContext): boolean {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canViewFile(context: RuleContext): boolean {
|
||||
return [hasFileSelected(context), navigation.isNotTrashcan(context)].every(
|
||||
Boolean
|
||||
);
|
||||
return [hasFileSelected(context), navigation.isNotTrashcan(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -455,10 +404,7 @@ export function canLeaveLibrary(context: RuleContext): boolean {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canToggleSharedLink(context: RuleContext): boolean {
|
||||
return [
|
||||
hasFileSelected(context),
|
||||
[canShareFile(context), isShared(context)].some(Boolean)
|
||||
].every(Boolean);
|
||||
return [hasFileSelected(context), [canShareFile(context), isShared(context)].some(Boolean)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -467,11 +413,7 @@ export function canToggleSharedLink(context: RuleContext): boolean {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canShowInfoDrawer(context: RuleContext): boolean {
|
||||
return [
|
||||
hasSelection(context),
|
||||
navigation.isNotLibraries(context),
|
||||
navigation.isNotTrashcan(context)
|
||||
].every(Boolean);
|
||||
return [hasSelection(context), navigation.isNotLibraries(context), navigation.isNotTrashcan(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -480,11 +422,7 @@ export function canShowInfoDrawer(context: RuleContext): boolean {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canManageFileVersions(context: RuleContext): boolean {
|
||||
return [
|
||||
hasFileSelected(context),
|
||||
navigation.isNotTrashcan(context),
|
||||
!hasLockedFiles(context)
|
||||
].every(Boolean);
|
||||
return [hasFileSelected(context), navigation.isNotTrashcan(context), !hasLockedFiles(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -493,10 +431,7 @@ export function canManageFileVersions(context: RuleContext): boolean {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canManagePermissions(context: RuleContext): boolean {
|
||||
return [
|
||||
canUpdateSelectedNode(context),
|
||||
navigation.isNotTrashcan(context)
|
||||
].every(Boolean);
|
||||
return [canUpdateSelectedNode(context), navigation.isNotTrashcan(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -505,11 +440,7 @@ export function canManagePermissions(context: RuleContext): boolean {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canToggleEditOffline(context: RuleContext): boolean {
|
||||
return [
|
||||
hasFileSelected(context),
|
||||
navigation.isNotTrashcan(context),
|
||||
canLockFile(context) || canUnlockFile(context)
|
||||
].every(Boolean);
|
||||
return [hasFileSelected(context), navigation.isNotTrashcan(context), canLockFile(context) || canUnlockFile(context)].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -520,12 +451,9 @@ export function canToggleEditOffline(context: RuleContext): boolean {
|
||||
export function canToggleFavorite(context: RuleContext): boolean {
|
||||
return [
|
||||
[canAddFavorite(context), canRemoveFavorite(context)].some(Boolean),
|
||||
[
|
||||
navigation.isRecentFiles(context),
|
||||
navigation.isSharedFiles(context),
|
||||
navigation.isSearchResults(context),
|
||||
navigation.isFavorites(context)
|
||||
].some(Boolean)
|
||||
[navigation.isRecentFiles(context), navigation.isSharedFiles(context), navigation.isSearchResults(context), navigation.isFavorites(context)].some(
|
||||
Boolean
|
||||
)
|
||||
].every(Boolean);
|
||||
}
|
||||
|
||||
@ -553,9 +481,5 @@ export function canShowLogout(context: AcaRuleContext): boolean {
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function isLibraryManager(context: RuleContext): boolean {
|
||||
return (
|
||||
hasLibrarySelected(context) &&
|
||||
context.selection.library.entry &&
|
||||
context.selection.library.entry.role === 'SiteManager'
|
||||
);
|
||||
return hasLibrarySelected(context) && context.selection.library.entry && context.selection.library.entry.role === 'SiteManager';
|
||||
}
|
||||
|
@ -31,12 +31,7 @@ import { RuleContext } from '@alfresco/adf-extensions';
|
||||
*/
|
||||
export function isPreview(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return (
|
||||
url &&
|
||||
(url.includes('/preview/') ||
|
||||
url.includes('viewer:view') ||
|
||||
url.includes('/view/'))
|
||||
);
|
||||
return url && (url.includes('/preview/') || url.includes('viewer:view') || url.includes('/view/'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -114,9 +109,7 @@ export function isLibraryFiles(context: RuleContext): boolean {
|
||||
*/
|
||||
export function isLibraries(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return (
|
||||
url && (url.endsWith('/libraries') || url.startsWith('/search-libraries'))
|
||||
);
|
||||
return url && (url.endsWith('/libraries') || url.startsWith('/search-libraries'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -148,10 +141,8 @@ export function isNotRecentFiles(context: RuleContext): boolean {
|
||||
* Checks if a **Search Results** route is activated.
|
||||
* JSON ref: `app.navigation.isSearchResults`
|
||||
*/
|
||||
export function isSearchResults(
|
||||
context: RuleContext /*,
|
||||
...args: RuleParameter[]*/
|
||||
): boolean {
|
||||
export function isSearchResults(context: RuleContext /*,
|
||||
...args: RuleParameter[]*/): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url && url.startsWith('/search');
|
||||
}
|
||||
@ -170,11 +161,7 @@ export function isNotSearchResults(context: RuleContext): boolean {
|
||||
*/
|
||||
export function isSharedPreview(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return (
|
||||
url &&
|
||||
(url.startsWith('/shared/preview/') ||
|
||||
(url.startsWith('/shared') && url.includes('viewer:view')))
|
||||
);
|
||||
return url && (url.startsWith('/shared/preview/') || (url.startsWith('/shared') && url.includes('viewer:view')));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -183,11 +170,7 @@ export function isSharedPreview(context: RuleContext): boolean {
|
||||
*/
|
||||
export function isFavoritesPreview(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return (
|
||||
url &&
|
||||
(url.startsWith('/favorites/preview/') ||
|
||||
(url.startsWith('/favorites') && url.includes('viewer:view')))
|
||||
);
|
||||
return url && (url.startsWith('/favorites/preview/') || (url.startsWith('/favorites') && url.includes('viewer:view')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,9 +52,7 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
|
||||
it('should emit true and complete in case of only one callback is present, completed', () => {
|
||||
const subject = new Subject<true>();
|
||||
const guard = new ExtensionsDataLoaderGuard([
|
||||
() => subject.asObservable()
|
||||
]);
|
||||
const guard = new ExtensionsDataLoaderGuard([() => subject.asObservable()]);
|
||||
|
||||
guard.canActivate(route).subscribe(emittedSpy, erroredSpy, completedSpy);
|
||||
|
||||
@ -70,9 +68,7 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
});
|
||||
|
||||
it('should emit true and complete in case of only one callback is present, errored', () => {
|
||||
const guard = new ExtensionsDataLoaderGuard([
|
||||
() => throwError(new Error())
|
||||
]);
|
||||
const guard = new ExtensionsDataLoaderGuard([() => throwError(new Error())]);
|
||||
|
||||
guard.canActivate(route).subscribe(emittedSpy, erroredSpy, completedSpy);
|
||||
expect(emittedSpy).toHaveBeenCalledWith(true);
|
||||
@ -83,10 +79,7 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
it('should NOT complete in case of multiple callbacks are present and not all of them have been completed', () => {
|
||||
const subject1 = new Subject<true>();
|
||||
const subject2 = new Subject<true>();
|
||||
const guard = new ExtensionsDataLoaderGuard([
|
||||
() => subject1.asObservable(),
|
||||
() => subject2.asObservable()
|
||||
]);
|
||||
const guard = new ExtensionsDataLoaderGuard([() => subject1.asObservable(), () => subject2.asObservable()]);
|
||||
|
||||
guard.canActivate(route).subscribe(emittedSpy, erroredSpy, completedSpy);
|
||||
|
||||
@ -101,10 +94,7 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
it('should emit true and complete in case of multiple callbacks are present and all of them have been completed', () => {
|
||||
const subject1 = new Subject<true>();
|
||||
const subject2 = new Subject<true>();
|
||||
const guard = new ExtensionsDataLoaderGuard([
|
||||
() => subject1.asObservable(),
|
||||
() => subject2.asObservable()
|
||||
]);
|
||||
const guard = new ExtensionsDataLoaderGuard([() => subject1.asObservable(), () => subject2.asObservable()]);
|
||||
|
||||
guard.canActivate(route).subscribe(emittedSpy, erroredSpy, completedSpy);
|
||||
|
||||
@ -119,10 +109,7 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
|
||||
it('should emit true and complete even if one of the observables are errored, to not block the application loading', () => {
|
||||
const subject1 = new Subject<true>();
|
||||
const guard = new ExtensionsDataLoaderGuard([
|
||||
() => subject1.asObservable(),
|
||||
() => throwError(new Error())
|
||||
]);
|
||||
const guard = new ExtensionsDataLoaderGuard([() => subject1.asObservable(), () => throwError(new Error())]);
|
||||
|
||||
guard.canActivate(route).subscribe(emittedSpy, erroredSpy, completedSpy);
|
||||
|
||||
@ -135,7 +122,7 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
it('should call canActivate only once', () => {
|
||||
const subject1 = new Subject<true>();
|
||||
const extensionLoaders = {
|
||||
fct1: function() {
|
||||
fct1: function () {
|
||||
return subject1.asObservable();
|
||||
}
|
||||
};
|
||||
|
@ -28,17 +28,13 @@ import { CanActivate, ActivatedRouteSnapshot } from '@angular/router';
|
||||
import { Observable, forkJoin, of } from 'rxjs';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
export type ExtensionLoaderCallback = (
|
||||
route: ActivatedRouteSnapshot
|
||||
) => Observable<boolean>;
|
||||
export type ExtensionLoaderCallback = (route: ActivatedRouteSnapshot) => Observable<boolean>;
|
||||
|
||||
export function DefaultExtensionLoaderFactory() {
|
||||
return [];
|
||||
}
|
||||
|
||||
export const EXTENSION_DATA_LOADERS = new InjectionToken<
|
||||
ExtensionLoaderCallback[]
|
||||
>('EXTENSION_DATA_LOADERS', {
|
||||
export const EXTENSION_DATA_LOADERS = new InjectionToken<ExtensionLoaderCallback[]>('EXTENSION_DATA_LOADERS', {
|
||||
providedIn: 'root',
|
||||
factory: DefaultExtensionLoaderFactory
|
||||
});
|
||||
@ -60,20 +56,16 @@ export class ExtensionsDataLoaderGuard implements CanActivate {
|
||||
return of(true);
|
||||
}
|
||||
|
||||
const dataLoaderCallbacks = this.extensionDataLoaders.map(callback =>
|
||||
callback(route)
|
||||
);
|
||||
const dataLoaderCallbacks = this.extensionDataLoaders.map((callback) => callback(route));
|
||||
|
||||
// Undocumented forkJoin behaviour/bug:
|
||||
// https://github.com/ReactiveX/rxjs/issues/3246
|
||||
// So all callbacks need to emit before completion, otherwise forkJoin will short circuit
|
||||
return forkJoin(...dataLoaderCallbacks).pipe(
|
||||
map(() => true),
|
||||
catchError(e => {
|
||||
catchError((e) => {
|
||||
// tslint:disable-next-line
|
||||
console.error(
|
||||
'Some of the extension data loader guards has been errored.'
|
||||
);
|
||||
console.error('Some of the extension data loader guards has been errored.');
|
||||
// tslint:disable-next-line
|
||||
console.error(e);
|
||||
return of(true);
|
||||
|
@ -23,12 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
Component,
|
||||
ViewEncapsulation,
|
||||
ChangeDetectionStrategy,
|
||||
Input
|
||||
} from '@angular/core';
|
||||
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-generic-error',
|
||||
|
@ -26,10 +26,7 @@ import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { Store } from '@ngrx/store';
|
||||
import {
|
||||
SetInfoDrawerStateAction,
|
||||
ToggleInfoDrawerAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { SetInfoDrawerStateAction, ToggleInfoDrawerAction } from '@alfresco/aca-shared/store';
|
||||
import { of, Subject } from 'rxjs';
|
||||
import { InfoDrawerComponent } from './info-drawer.component';
|
||||
import { LibTestingModule } from '../../testing/lib-testing-module';
|
||||
@ -64,11 +61,7 @@ describe('InfoDrawerComponent', () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [LibTestingModule, SharedToolbarModule],
|
||||
declarations: [InfoDrawerComponent],
|
||||
providers: [
|
||||
ContentApiService,
|
||||
{ provide: AppExtensionService, useValue: extensionServiceMock },
|
||||
{ provide: Store, useValue: storeMock }
|
||||
],
|
||||
providers: [ContentApiService, { provide: AppExtensionService, useValue: extensionServiceMock }, { provide: Store, useValue: storeMock }],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
});
|
||||
|
||||
@ -95,9 +88,7 @@ describe('InfoDrawerComponent', () => {
|
||||
fixture.detectChanges();
|
||||
component.ngOnDestroy();
|
||||
|
||||
expect(storeMock.dispatch).toHaveBeenCalledWith(
|
||||
new SetInfoDrawerStateAction(false)
|
||||
);
|
||||
expect(storeMock.dispatch).toHaveBeenCalledWith(new SetInfoDrawerStateAction(false));
|
||||
});
|
||||
|
||||
it('should set displayNode when node is library', async(() => {
|
||||
@ -174,9 +165,7 @@ describe('InfoDrawerComponent', () => {
|
||||
|
||||
fixture.debugElement.nativeElement.dispatchEvent(event);
|
||||
|
||||
expect(storeMock.dispatch).toHaveBeenCalledWith(
|
||||
new ToggleInfoDrawerAction()
|
||||
);
|
||||
expect(storeMock.dispatch).toHaveBeenCalledWith(new ToggleInfoDrawerAction());
|
||||
});
|
||||
|
||||
it('should show the icons from extension', () => {
|
||||
|
@ -23,26 +23,11 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
Component,
|
||||
HostListener,
|
||||
Input,
|
||||
OnChanges,
|
||||
OnDestroy,
|
||||
OnInit
|
||||
} from '@angular/core';
|
||||
import {
|
||||
MinimalNodeEntity,
|
||||
MinimalNodeEntryEntity,
|
||||
SiteEntry
|
||||
} from '@alfresco/js-api';
|
||||
import { Component, HostListener, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, SiteEntry } from '@alfresco/js-api';
|
||||
import { ContentActionRef, SidebarTabRef } from '@alfresco/adf-extensions';
|
||||
import { Store } from '@ngrx/store';
|
||||
import {
|
||||
getAppSelection,
|
||||
SetInfoDrawerStateAction,
|
||||
ToggleInfoDrawerAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { getAppSelection, SetInfoDrawerStateAction, ToggleInfoDrawerAction } from '@alfresco/aca-shared/store';
|
||||
import { AppExtensionService } from '../../services/app.extension.service';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
@ -69,11 +54,7 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this.close();
|
||||
}
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
private contentApi: ContentApiService,
|
||||
private extensions: AppExtensionService
|
||||
) {}
|
||||
constructor(private store: Store<any>, private contentApi: ContentApiService, private extensions: AppExtensionService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.tabs = this.extensions.getSidebarTabs();
|
||||
@ -117,7 +98,7 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this.isLoading = true;
|
||||
|
||||
this.contentApi.getNodeInfo(nodeId).subscribe(
|
||||
entity => {
|
||||
(entity) => {
|
||||
this.setDisplayNode(entity);
|
||||
this.isLoading = false;
|
||||
},
|
||||
|
@ -32,14 +32,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { SharedToolbarModule } from '../tool-bar/shared-toolbar.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
InfoDrawerModule,
|
||||
MatProgressBarModule,
|
||||
ExtensionsModule,
|
||||
ToolbarModule,
|
||||
SharedToolbarModule
|
||||
],
|
||||
imports: [CommonModule, InfoDrawerModule, MatProgressBarModule, ExtensionsModule, ToolbarModule, SharedToolbarModule],
|
||||
declarations: [InfoDrawerComponent],
|
||||
exports: [InfoDrawerComponent]
|
||||
})
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user