diff --git a/.prettierignore b/.prettierignore
index 6a43710f0..279e3a547 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,5 +1,4 @@
node_modules
src/assets/i18n
-e2e
/angular.json
docs/**/*.md
diff --git a/.prettierrc b/.prettierrc
index 544138be4..35275aa1f 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,3 +1,5 @@
{
- "singleQuote": true
+ "singleQuote": true,
+ "trailingComma": "none",
+ "printWidth": 150
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index e1bb8415a..a143f058a 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -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
},
diff --git a/e2e/suites/actions-available/files-folders/favorites.ts b/e2e/suites/actions-available/files-folders/favorites.ts
index 43c93a1bd..4066ed99c 100755
--- a/e2e/suites/actions-available/files-folders/favorites.ts
+++ b/e2e/suites/actions-available/files-folders/favorites.ts
@@ -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
+ );
});
});
});
diff --git a/e2e/suites/actions-available/files-folders/files-folders-actions.test.ts b/e2e/suites/actions-available/files-folders/files-folders-actions.test.ts
index 629b217a6..4ef677ea6 100644
--- a/e2e/suites/actions-available/files-folders/files-folders-actions.test.ts
+++ b/e2e/suites/actions-available/files-folders/files-folders-actions.test.ts
@@ -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();
});
-
});
diff --git a/e2e/suites/actions-available/files-folders/personal-files.ts b/e2e/suites/actions-available/files-folders/personal-files.ts
index ce11d1ae6..c39359e6a 100755
--- a/e2e/suites/actions-available/files-folders/personal-files.ts
+++ b/e2e/suites/actions-available/files-folders/personal-files.ts
@@ -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
+ );
});
});
});
diff --git a/e2e/suites/actions-available/files-folders/recent-files.ts b/e2e/suites/actions-available/files-folders/recent-files.ts
index 5ac9c9f02..72d98e9d4 100755
--- a/e2e/suites/actions-available/files-folders/recent-files.ts
+++ b/e2e/suites/actions-available/files-folders/recent-files.ts
@@ -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
+ );
});
});
-
});
}
diff --git a/e2e/suites/actions-available/files-folders/search-results.ts b/e2e/suites/actions-available/files-folders/search-results.ts
index 2b27fd8ba..1ce4fde00 100755
--- a/e2e/suites/actions-available/files-folders/search-results.ts
+++ b/e2e/suites/actions-available/files-folders/search-results.ts
@@ -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
+ );
});
});
});
diff --git a/e2e/suites/actions-available/files-folders/shared-files.ts b/e2e/suites/actions-available/files-folders/shared-files.ts
index 13ee5f49a..0a800f51b 100755
--- a/e2e/suites/actions-available/files-folders/shared-files.ts
+++ b/e2e/suites/actions-available/files-folders/shared-files.ts
@@ -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
+ );
});
});
-
});
}
diff --git a/e2e/suites/actions-available/files-folders/test-data.ts b/e2e/suites/actions-available/files-folders/test-data.ts
index f0ceb2261..69a04f44e 100644
--- a/e2e/suites/actions-available/files-folders/test-data.ts
+++ b/e2e/suites/actions-available/files-folders/test-data.ts
@@ -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
-}
+};
diff --git a/e2e/suites/actions-available/files-folders/trash.ts b/e2e/suites/actions-available/files-folders/trash.ts
index bc58bb405..c7efda6ce 100755
--- a/e2e/suites/actions-available/files-folders/trash.ts
+++ b/e2e/suites/actions-available/files-folders/trash.ts
@@ -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);
});
-
});
}
diff --git a/e2e/suites/actions-available/files-folders/viewer.ts b/e2e/suites/actions-available/files-folders/viewer.ts
index 254ee7826..8a4d96fc4 100755
--- a/e2e/suites/actions-available/files-folders/viewer.ts
+++ b/e2e/suites/actions-available/files-folders/viewer.ts
@@ -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
+ );
});
});
-
});
}
diff --git a/e2e/suites/actions-available/generic.test.ts b/e2e/suites/actions-available/generic.test.ts
index 138c65924..8e4429d1c 100755
--- a/e2e/suites/actions-available/generic.test.ts
+++ b/e2e/suites/actions-available/generic.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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}`);
diff --git a/e2e/suites/actions-available/libraries/library.test.ts b/e2e/suites/actions-available/libraries/library.test.ts
index 9e1831d4a..25201540b 100755
--- a/e2e/suites/actions-available/libraries/library.test.ts
+++ b/e2e/suites/actions-available/libraries/library.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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);
});
});
});
diff --git a/e2e/suites/actions-available/libraries/test-data-libraries.ts b/e2e/suites/actions-available/libraries/test-data-libraries.ts
index ef864eba9..9d0ca3073 100644
--- a/e2e/suites/actions-available/libraries/test-data-libraries.ts
+++ b/e2e/suites/actions-available/libraries/test-data-libraries.ts
@@ -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
};
-
diff --git a/e2e/suites/actions-available/special-permissions/favorites.ts b/e2e/suites/actions-available/special-permissions/favorites.ts
index be37a1b3b..90d289828 100755
--- a/e2e/suites/actions-available/special-permissions/favorites.ts
+++ b/e2e/suites/actions-available/special-permissions/favorites.ts
@@ -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
+ );
});
-
});
-
});
}
diff --git a/e2e/suites/actions-available/special-permissions/my-libraries.ts b/e2e/suites/actions-available/special-permissions/my-libraries.ts
index 094caa4aa..9f5c64326 100755
--- a/e2e/suites/actions-available/special-permissions/my-libraries.ts
+++ b/e2e/suites/actions-available/special-permissions/my-libraries.ts
@@ -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
+ );
});
-
});
});
}
diff --git a/e2e/suites/actions-available/special-permissions/other-permissions.ts b/e2e/suites/actions-available/special-permissions/other-permissions.ts
index d5344a4c2..b1e0ce28d 100755
--- a/e2e/suites/actions-available/special-permissions/other-permissions.ts
+++ b/e2e/suites/actions-available/special-permissions/other-permissions.ts
@@ -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);
});
diff --git a/e2e/suites/actions-available/special-permissions/search-results.ts b/e2e/suites/actions-available/special-permissions/search-results.ts
index 46f44be76..0230b7178 100755
--- a/e2e/suites/actions-available/special-permissions/search-results.ts
+++ b/e2e/suites/actions-available/special-permissions/search-results.ts
@@ -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
+ );
});
-
});
});
}
diff --git a/e2e/suites/actions-available/special-permissions/shared-files.ts b/e2e/suites/actions-available/special-permissions/shared-files.ts
index 026aa7bf4..258e2011a 100755
--- a/e2e/suites/actions-available/special-permissions/shared-files.ts
+++ b/e2e/suites/actions-available/special-permissions/shared-files.ts
@@ -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
+ );
});
-
});
-
});
}
diff --git a/e2e/suites/actions-available/special-permissions/special-permissions-actions.test.ts b/e2e/suites/actions-available/special-permissions/special-permissions-actions.test.ts
index 09e5295c4..42abef042 100644
--- a/e2e/suites/actions-available/special-permissions/special-permissions-actions.test.ts
+++ b/e2e/suites/actions-available/special-permissions/special-permissions-actions.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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);
});
diff --git a/e2e/suites/actions-available/special-permissions/test-data-permissions.ts b/e2e/suites/actions-available/special-permissions/test-data-permissions.ts
index 418505c85..aba2673c0 100644
--- a/e2e/suites/actions-available/special-permissions/test-data-permissions.ts
+++ b/e2e/suites/actions-available/special-permissions/test-data-permissions.ts
@@ -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
-}
+};
diff --git a/e2e/suites/actions-available/special-permissions/viewer.ts b/e2e/suites/actions-available/special-permissions/viewer.ts
index 32438f757..5269fc9a7 100755
--- a/e2e/suites/actions-available/special-permissions/viewer.ts
+++ b/e2e/suites/actions-available/special-permissions/viewer.ts
@@ -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
+ );
});
-
});
});
}
diff --git a/e2e/suites/actions-available/test-util.ts b/e2e/suites/actions-available/test-util.ts
index 306f5e094..0521848e0 100644
--- a/e2e/suites/actions-available/test-util.ts
+++ b/e2e/suites/actions-available/test-util.ts
@@ -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 {
+export async function checkMultipleSelToolbarActions(
+ items: string[],
+ expectedToolbarPrimary: string[],
+ expectedToolbarMore: string[]
+): Promise {
await dataTable.selectMultipleItems(items);
const actualPrimaryActions = await toolbar.getButtons();
diff --git a/e2e/suites/actions/copy-move/copy.test.ts b/e2e/suites/actions/copy-move/copy.test.ts
index 671d157a3..2b83baec1 100755
--- a/e2e/suites/actions/copy-move/copy.test.ts
+++ b/e2e/suites/actions/copy-move/copy.test.ts
@@ -23,51 +23,68 @@
* along with Alfresco. If not, see .
*/
-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');
}
-
});
diff --git a/e2e/suites/actions/copy-move/destination-picker-dialog.test.ts b/e2e/suites/actions/copy-move/destination-picker-dialog.test.ts
index 1dbc64c0b..c4ef197c7 100755
--- a/e2e/suites/actions/copy-move/destination-picker-dialog.test.ts
+++ b/e2e/suites/actions/copy-move/destination-picker-dialog.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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);
diff --git a/e2e/suites/actions/copy-move/move.test.ts b/e2e/suites/actions/copy-move/move.test.ts
index 4e25f8e83..b8e80fb33 100755
--- a/e2e/suites/actions/copy-move/move.test.ts
+++ b/e2e/suites/actions/copy-move/move.test.ts
@@ -23,28 +23,30 @@
* along with Alfresco. If not, see .
*/
-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`);
});
});
-
});
diff --git a/e2e/suites/actions/create-file-from-template.test.ts b/e2e/suites/actions/create-file-from-template.test.ts
index 8d5fee5ed..00335dcd5 100755
--- a/e2e/suites/actions/create-file-from-template.test.ts
+++ b/e2e/suites/actions/create-file-from-template.test.ts
@@ -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', 'aa', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
+ const namesWithSpecialChars = ['a*a', 'a"a', 'aa', `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', () => {
});
});
});
-
});
diff --git a/e2e/suites/actions/create-folder-from-template.test.ts b/e2e/suites/actions/create-folder-from-template.test.ts
index 1bde7cb4c..8c7f88307 100755
--- a/e2e/suites/actions/create-folder-from-template.test.ts
+++ b/e2e/suites/actions/create-folder-from-template.test.ts
@@ -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', 'aa', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
+ const namesWithSpecialChars = ['a*a', 'a"a', 'aa', `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');
});
});
-
});
diff --git a/e2e/suites/actions/create-folder.test.ts b/e2e/suites/actions/create-folder.test.ts
index 0251866a4..024593144 100755
--- a/e2e/suites/actions/create-folder.test.ts
+++ b/e2e/suites/actions/create-folder.test.ts
@@ -23,19 +23,13 @@
* along with Alfresco. If not, see .
*/
-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', 'aa', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
+ const namesWithSpecialChars = ['a*a', 'a"a', 'aa', `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');
});
});
-
});
diff --git a/e2e/suites/actions/create-library.test.ts b/e2e/suites/actions/create-library.test.ts
index e719f4f79..d55909ec3 100755
--- a/e2e/suites/actions/create-library.test.ts
+++ b/e2e/suites/actions/create-library.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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', 'aa', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
+ const idWithSpecialChars = ['a*a', 'a"a', 'aa', `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);
});
-
});
diff --git a/e2e/suites/actions/delete-undo-delete.test.ts b/e2e/suites/actions/delete-undo-delete.test.ts
index b9976392c..a51aa4978 100755
--- a/e2e/suites/actions/delete-undo-delete.test.ts
+++ b/e2e/suites/actions/delete-undo-delete.test.ts
@@ -23,12 +23,7 @@
* along with Alfresco. If not, see .
*/
-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`;
diff --git a/e2e/suites/actions/download.test.ts b/e2e/suites/actions/download.test.ts
index e7a19e815..e6fb7a310 100755
--- a/e2e/suites/actions/download.test.ts
+++ b/e2e/suites/actions/download.test.ts
@@ -23,18 +23,13 @@
* along with Alfresco. If not, see .
*/
-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}`
+ );
});
-
});
-
});
diff --git a/e2e/suites/actions/edit-folder.test.ts b/e2e/suites/actions/edit-folder.test.ts
index 792dc54c4..0e3f1092b 100755
--- a/e2e/suites/actions/edit-folder.test.ts
+++ b/e2e/suites/actions/edit-folder.test.ts
@@ -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 = {
diff --git a/e2e/suites/actions/edit-offline.test.ts b/e2e/suites/actions/edit-offline.test.ts
index 64fa4ab45..923fb3a07 100755
--- a/e2e/suites/actions/edit-offline.test.ts
+++ b/e2e/suites/actions/edit-offline.test.ts
@@ -23,30 +23,35 @@
* along with Alfresco. If not, see .
*/
-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(),
diff --git a/e2e/suites/actions/library-actions.test.ts b/e2e/suites/actions/library-actions.test.ts
index 9b546d245..7eb580da3 100755
--- a/e2e/suites/actions/library-actions.test.ts
+++ b/e2e/suites/actions/library-actions.test.ts
@@ -23,15 +23,7 @@
* along with Alfresco. If not, see .
*/
-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`);
});
});
-
});
diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts
index 2ccc4759f..a7a1ad3a3 100644
--- a/e2e/suites/actions/mark-favorite.test.ts
+++ b/e2e/suites/actions/mark-favorite.test.ts
@@ -23,17 +23,10 @@
* along with Alfresco. If not, see .
*/
-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');
diff --git a/e2e/suites/actions/new-menu.test.ts b/e2e/suites/actions/new-menu.test.ts
index c10c419f9..05b66b27b 100755
--- a/e2e/suites/actions/new-menu.test.ts
+++ b/e2e/suites/actions/new-menu.test.ts
@@ -23,13 +23,7 @@
* along with Alfresco. If not, see .
*/
-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');
});
-
});
diff --git a/e2e/suites/actions/permanently-delete.test.ts b/e2e/suites/actions/permanently-delete.test.ts
index c03f44fdd..d4cff410f 100755
--- a/e2e/suites/actions/permanently-delete.test.ts
+++ b/e2e/suites/actions/permanently-delete.test.ts
@@ -23,126 +23,120 @@
* along with Alfresco. If not, see .
*/
-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');
+ });
});
diff --git a/e2e/suites/actions/restore.test.ts b/e2e/suites/actions/restore.test.ts
index 2fb9e1bd8..93d5148dd 100755
--- a/e2e/suites/actions/restore.test.ts
+++ b/e2e/suites/actions/restore.test.ts
@@ -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;
diff --git a/e2e/suites/actions/share-file.test.ts b/e2e/suites/actions/share-file.test.ts
index ffe078494..263712296 100755
--- a/e2e/suites/actions/share-file.test.ts
+++ b/e2e/suites/actions/share-file.test.ts
@@ -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);
});
});
- })
+ });
});
diff --git a/e2e/suites/actions/unshare-file-search-results.test.ts b/e2e/suites/actions/unshare-file-search-results.test.ts
index 4e25a52a6..4a97e95e8 100755
--- a/e2e/suites/actions/unshare-file-search-results.test.ts
+++ b/e2e/suites/actions/unshare-file-search-results.test.ts
@@ -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`);
});
-
});
diff --git a/e2e/suites/actions/unshare-file.test.ts b/e2e/suites/actions/unshare-file.test.ts
index 67da5bbeb..374fbbb9f 100755
--- a/e2e/suites/actions/unshare-file.test.ts
+++ b/e2e/suites/actions/unshare-file.test.ts
@@ -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`);
});
});
-
});
diff --git a/e2e/suites/actions/upload-file.test.ts b/e2e/suites/actions/upload-file.test.ts
index 444b2d076..579001226 100755
--- a/e2e/suites/actions/upload-file.test.ts
+++ b/e2e/suites/actions/upload-file.test.ts
@@ -23,18 +23,13 @@
* along with Alfresco. If not, see .
*/
-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(),
diff --git a/e2e/suites/actions/upload-new-version.test.ts b/e2e/suites/actions/upload-new-version.test.ts
index 494f35acb..ef1b48d1a 100755
--- a/e2e/suites/actions/upload-new-version.test.ts
+++ b/e2e/suites/actions/upload-new-version.test.ts
@@ -23,41 +23,52 @@
* along with Alfresco. If not, see .
*/
-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`);
});
});
-
});
diff --git a/e2e/suites/application/general.test.ts b/e2e/suites/application/general.test.ts
index d3af42f40..5d45b9959 100644
--- a/e2e/suites/application/general.test.ts
+++ b/e2e/suites/application/general.test.ts
@@ -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) => {
diff --git a/e2e/suites/application/page-titles.test.ts b/e2e/suites/application/page-titles.test.ts
index b4a03df78..d28d9735d 100755
--- a/e2e/suites/application/page-titles.test.ts
+++ b/e2e/suites/application/page-titles.test.ts
@@ -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', () => {
diff --git a/e2e/suites/authentication/login.test.ts b/e2e/suites/authentication/login.test.ts
index 48a19dd4c..b58a4760e 100755
--- a/e2e/suites/authentication/login.test.ts
+++ b/e2e/suites/authentication/login.test.ts
@@ -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'
};
diff --git a/e2e/suites/authentication/logout.test.ts b/e2e/suites/authentication/logout.test.ts
index 26099fe69..0fae22fef 100755
--- a/e2e/suites/authentication/logout.test.ts
+++ b/e2e/suites/authentication/logout.test.ts
@@ -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();
diff --git a/e2e/suites/extensions/ext-context-submenus.test.ts b/e2e/suites/extensions/ext-context-submenus.test.ts
index 79a7222db..bd752a455 100644
--- a/e2e/suites/extensions/ext-context-submenus.test.ts
+++ b/e2e/suites/extensions/ext-context-submenus.test.ts
@@ -23,30 +23,24 @@
* along with Alfresco. If not, see .
*/
-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 () => {
diff --git a/e2e/suites/extensions/ext-document-list.test.ts b/e2e/suites/extensions/ext-document-list.test.ts
index f4983e468..70513c3f9 100644
--- a/e2e/suites/extensions/ext-document-list.test.ts
+++ b/e2e/suites/extensions/ext-document-list.test.ts
@@ -23,18 +23,12 @@
* along with Alfresco. If not, see .
*/
-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`);
diff --git a/e2e/suites/extensions/ext-header.test.ts b/e2e/suites/extensions/ext-header.test.ts
index 32a2dca65..df9c0a6a3 100755
--- a/e2e/suites/extensions/ext-header.test.ts
+++ b/e2e/suites/extensions/ext-header.test.ts
@@ -23,65 +23,57 @@
* along with Alfresco. If not, see .
*/
-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`);
+ });
});
diff --git a/e2e/suites/extensions/ext-info-drawer.test.ts b/e2e/suites/extensions/ext-info-drawer.test.ts
index 5eda201f2..e4aa92270 100755
--- a/e2e/suites/extensions/ext-info-drawer.test.ts
+++ b/e2e/suites/extensions/ext-info-drawer.test.ts
@@ -23,140 +23,133 @@
* along with Alfresco. If not, see .
*/
-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');
+ });
+ });
});
diff --git a/e2e/suites/extensions/ext-metadata.test.ts b/e2e/suites/extensions/ext-metadata.test.ts
index 2d67cf665..bf7c7f151 100644
--- a/e2e/suites/extensions/ext-metadata.test.ts
+++ b/e2e/suites/extensions/ext-metadata.test.ts
@@ -23,22 +23,14 @@
* along with Alfresco. If not, see .
*/
-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();
});
diff --git a/e2e/suites/extensions/ext-viewer.test.ts b/e2e/suites/extensions/ext-viewer.test.ts
index 08ca3844c..c667f6ca0 100755
--- a/e2e/suites/extensions/ext-viewer.test.ts
+++ b/e2e/suites/extensions/ext-viewer.test.ts
@@ -23,155 +23,147 @@
* along with Alfresco. If not, see .
*/
-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');
});
+ });
});
diff --git a/e2e/suites/info-drawer/comments.test.ts b/e2e/suites/info-drawer/comments.test.ts
index 7a0f83b20..a813e6f5f 100755
--- a/e2e/suites/info-drawer/comments.test.ts
+++ b/e2e/suites/info-drawer/comments.test.ts
@@ -23,35 +23,35 @@
* along with Alfresco. If not, see .
*/
-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');
});
-
});
-
});
diff --git a/e2e/suites/info-drawer/file-folder-properties.test.ts b/e2e/suites/info-drawer/file-folder-properties.test.ts
index 55a60f481..64e6bdac4 100755
--- a/e2e/suites/info-drawer/file-folder-properties.test.ts
+++ b/e2e/suites/info-drawer/file-folder-properties.test.ts
@@ -23,23 +23,15 @@
* along with Alfresco. If not, see .
*/
-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');
});
});
-
});
diff --git a/e2e/suites/info-drawer/general.test.ts b/e2e/suites/info-drawer/general.test.ts
index 653897aee..dd50e4892 100755
--- a/e2e/suites/info-drawer/general.test.ts
+++ b/e2e/suites/info-drawer/general.test.ts
@@ -23,18 +23,13 @@
* along with Alfresco. If not, see .
*/
-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');
});
-
});
diff --git a/e2e/suites/info-drawer/library-properties.test.ts b/e2e/suites/info-drawer/library-properties.test.ts
index 8552dac0e..05a732fb3 100755
--- a/e2e/suites/info-drawer/library-properties.test.ts
+++ b/e2e/suites/info-drawer/library-properties.test.ts
@@ -23,15 +23,7 @@
* along with Alfresco. If not, see .
*/
-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');
});
});
-
});
diff --git a/e2e/suites/list-views/empty-list.test.ts b/e2e/suites/list-views/empty-list.test.ts
index 4fb5ce844..3270982be 100755
--- a/e2e/suites/list-views/empty-list.test.ts
+++ b/e2e/suites/list-views/empty-list.test.ts
@@ -23,13 +23,7 @@
* along with Alfresco. If not, see .
*/
-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()}`;
diff --git a/e2e/suites/list-views/favorites.test.ts b/e2e/suites/list-views/favorites.test.ts
index 6f6d69315..10c73cc09 100755
--- a/e2e/suites/list-views/favorites.test.ts
+++ b/e2e/suites/list-views/favorites.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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 () => {
diff --git a/e2e/suites/list-views/file-libraries.test.ts b/e2e/suites/list-views/file-libraries.test.ts
index bc2989fe9..47bda919e 100755
--- a/e2e/suites/list-views/file-libraries.test.ts
+++ b/e2e/suites/list-views/file-libraries.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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());
});
diff --git a/e2e/suites/list-views/generic-errors.test.ts b/e2e/suites/list-views/generic-errors.test.ts
index 79b713de1..7cd39bcf6 100755
--- a/e2e/suites/list-views/generic-errors.test.ts
+++ b/e2e/suites/list-views/generic-errors.test.ts
@@ -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 () => {
diff --git a/e2e/suites/list-views/permissions.test.ts b/e2e/suites/list-views/permissions.test.ts
index e75c1cafc..7fcdd5fef 100755
--- a/e2e/suites/list-views/permissions.test.ts
+++ b/e2e/suites/list-views/permissions.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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()}`;
diff --git a/e2e/suites/list-views/personal-files.test.ts b/e2e/suites/list-views/personal-files.test.ts
index db71d4ff3..ac1243937 100755
--- a/e2e/suites/list-views/personal-files.test.ts
+++ b/e2e/suites/list-views/personal-files.test.ts
@@ -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');
diff --git a/e2e/suites/list-views/recent-files.test.ts b/e2e/suites/list-views/recent-files.test.ts
index 8099b2d0c..dab99a457 100755
--- a/e2e/suites/list-views/recent-files.test.ts
+++ b/e2e/suites/list-views/recent-files.test.ts
@@ -23,24 +23,21 @@
* along with Alfresco. If not, see .
*/
-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]);
});
});
diff --git a/e2e/suites/list-views/shared-files.test.ts b/e2e/suites/list-views/shared-files.test.ts
index 229075dd9..128c6fc3e 100755
--- a/e2e/suites/list-views/shared-files.test.ts
+++ b/e2e/suites/list-views/shared-files.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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 () => {
diff --git a/e2e/suites/list-views/tooltips.test.ts b/e2e/suites/list-views/tooltips.test.ts
index 2962f1e66..b98bed392 100755
--- a/e2e/suites/list-views/tooltips.test.ts
+++ b/e2e/suites/list-views/tooltips.test.ts
@@ -23,12 +23,7 @@
* along with Alfresco. If not, see .
*/
-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();
});
diff --git a/e2e/suites/list-views/trash.test.ts b/e2e/suites/list-views/trash.test.ts
index 275185d5e..c1210d9d9 100755
--- a/e2e/suites/list-views/trash.test.ts
+++ b/e2e/suites/list-views/trash.test.ts
@@ -23,32 +23,34 @@
* along with Alfresco. If not, see .
*/
-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]);
});
});
});
diff --git a/e2e/suites/navigation/breadcrumb.test.ts b/e2e/suites/navigation/breadcrumb.test.ts
index c512f3660..57879873d 100755
--- a/e2e/suites/navigation/breadcrumb.test.ts
+++ b/e2e/suites/navigation/breadcrumb.test.ts
@@ -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]);
});
});
});
diff --git a/e2e/suites/navigation/sidebar.test.ts b/e2e/suites/navigation/sidebar.test.ts
index 6e892c43e..c7f7e3d04 100755
--- a/e2e/suites/navigation/sidebar.test.ts
+++ b/e2e/suites/navigation/sidebar.test.ts
@@ -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();
diff --git a/e2e/suites/navigation/single-click.test.ts b/e2e/suites/navigation/single-click.test.ts
index 862fb0081..c695e9c0f 100755
--- a/e2e/suites/navigation/single-click.test.ts
+++ b/e2e/suites/navigation/single-click.test.ts
@@ -23,22 +23,20 @@
* along with Alfresco. If not, see .
*/
-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);
});
});
-
});
diff --git a/e2e/suites/pagination/favorites.ts b/e2e/suites/pagination/favorites.ts
index 87f9a0ee3..0deaeb84b 100755
--- a/e2e/suites/pagination/favorites.ts
+++ b/e2e/suites/pagination/favorites.ts
@@ -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');
diff --git a/e2e/suites/pagination/multiple-pages-files.test.ts b/e2e/suites/pagination/multiple-pages-files.test.ts
index a056a8647..0230eb378 100644
--- a/e2e/suites/pagination/multiple-pages-files.test.ts
+++ b/e2e/suites/pagination/multiple-pages-files.test.ts
@@ -23,12 +23,7 @@
* along with Alfresco. If not, see .
*/
-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();
});
-
});
diff --git a/e2e/suites/pagination/multiple-pages-libraries.test.ts b/e2e/suites/pagination/multiple-pages-libraries.test.ts
index 5e15f714a..d7012b366 100755
--- a/e2e/suites/pagination/multiple-pages-libraries.test.ts
+++ b/e2e/suites/pagination/multiple-pages-libraries.test.ts
@@ -23,13 +23,7 @@
* along with Alfresco. If not, see .
*/
-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');
});
});
-
});
diff --git a/e2e/suites/pagination/multiple-pages-trash.test.ts b/e2e/suites/pagination/multiple-pages-trash.test.ts
index a053ebf55..a32771464 100755
--- a/e2e/suites/pagination/multiple-pages-trash.test.ts
+++ b/e2e/suites/pagination/multiple-pages-trash.test.ts
@@ -23,13 +23,7 @@
* along with Alfresco. If not, see .
*/
-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();
diff --git a/e2e/suites/pagination/personal-files.ts b/e2e/suites/pagination/personal-files.ts
index 52a53585e..f4b1fab7c 100755
--- a/e2e/suites/pagination/personal-files.ts
+++ b/e2e/suites/pagination/personal-files.ts
@@ -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);
diff --git a/e2e/suites/pagination/recent-files.ts b/e2e/suites/pagination/recent-files.ts
index 77be62e8b..5c4d1a545 100755
--- a/e2e/suites/pagination/recent-files.ts
+++ b/e2e/suites/pagination/recent-files.ts
@@ -30,7 +30,6 @@ export function recentFilesTests() {
const { dataTable, pagination } = page;
describe('Pagination controls : ', () => {
-
beforeAll(async () => {
await page.clickRecentFilesAndWait();
});
diff --git a/e2e/suites/pagination/search-results.ts b/e2e/suites/pagination/search-results.ts
index 0622fefa1..09bfc6b5b 100755
--- a/e2e/suites/pagination/search-results.ts
+++ b/e2e/suites/pagination/search-results.ts
@@ -31,7 +31,6 @@ export function searchResultsTests() {
const { searchInput } = page.header;
describe('Pagination controls : ', () => {
-
beforeAll(async () => {
await searchInput.clickSearchButton();
await searchInput.searchFor('my-file-');
diff --git a/e2e/suites/pagination/shared-files.ts b/e2e/suites/pagination/shared-files.ts
index 11de1a93e..f53d59498 100755
--- a/e2e/suites/pagination/shared-files.ts
+++ b/e2e/suites/pagination/shared-files.ts
@@ -30,7 +30,6 @@ export function sharedFilesTests() {
const { dataTable, pagination } = page;
describe('Pagination controls : ', () => {
-
beforeAll(async () => {
await page.clickSharedFilesAndWait();
});
diff --git a/e2e/suites/pagination/single-page.test.ts b/e2e/suites/pagination/single-page.test.ts
index 6f84665a5..30dad7753 100755
--- a/e2e/suites/pagination/single-page.test.ts
+++ b/e2e/suites/pagination/single-page.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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');
});
-
});
diff --git a/e2e/suites/search/search-filters.test.ts b/e2e/suites/search/search-filters.test.ts
index c3bc30f2f..7edcd5b69 100644
--- a/e2e/suites/search/search-filters.test.ts
+++ b/e2e/suites/search/search-filters.test.ts
@@ -23,17 +23,9 @@
* along with Alfresco. If not, see .
*/
-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'
+ );
});
});
diff --git a/e2e/suites/search/search-results-files-folders.test.ts b/e2e/suites/search/search-results-files-folders.test.ts
index aa52dccbd..b96d84cd3 100644
--- a/e2e/suites/search/search-results-files-folders.test.ts
+++ b/e2e/suites/search/search-results-files-folders.test.ts
@@ -23,29 +23,23 @@
* along with Alfresco. If not, see .
*/
-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),
diff --git a/e2e/suites/search/search-results-general.test.ts b/e2e/suites/search/search-results-general.test.ts
index c6f568fc3..2e78fff3a 100644
--- a/e2e/suites/search/search-results-general.test.ts
+++ b/e2e/suites/search/search-results-general.test.ts
@@ -23,20 +23,16 @@
* along with Alfresco. If not, see .
*/
-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`);
});
-
});
diff --git a/e2e/suites/search/search-results-libraries.test.ts b/e2e/suites/search/search-results-libraries.test.ts
index ad3bae632..fc54ff1cb 100644
--- a/e2e/suites/search/search-results-libraries.test.ts
+++ b/e2e/suites/search/search-results-libraries.test.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-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`);
});
-
});
diff --git a/e2e/suites/search/search-sorting.test.ts b/e2e/suites/search/search-sorting.test.ts
index 1f365869e..36d44cd72 100644
--- a/e2e/suites/search/search-sorting.test.ts
+++ b/e2e/suites/search/search-sorting.test.ts
@@ -23,13 +23,7 @@
* along with Alfresco. If not, see .
*/
-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');
});
diff --git a/e2e/suites/viewer/viewer-actions.test.ts b/e2e/suites/viewer/viewer-actions.test.ts
index 4218419ba..719904fb7 100755
--- a/e2e/suites/viewer/viewer-actions.test.ts
+++ b/e2e/suites/viewer/viewer-actions.test.ts
@@ -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();
diff --git a/e2e/suites/viewer/viewer-general.test.ts b/e2e/suites/viewer/viewer-general.test.ts
index aab57b986..bb16672af 100755
--- a/e2e/suites/viewer/viewer-general.test.ts
+++ b/e2e/suites/viewer/viewer-general.test.ts
@@ -23,175 +23,172 @@
* along with Alfresco. If not, see .
*/
-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');
+ });
});
diff --git a/e2e/suites/viewer/viewer-protected-file.test.ts b/e2e/suites/viewer/viewer-protected-file.test.ts
index c9e327d20..1dab326c9 100755
--- a/e2e/suites/viewer/viewer-protected-file.test.ts
+++ b/e2e/suites/viewer/viewer-protected-file.test.ts
@@ -23,20 +23,13 @@
* along with Alfresco. If not, see .
*/
-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;
diff --git a/e2e/tsconfig.e2e.typecheck.json b/e2e/tsconfig.e2e.typecheck.json
index 6e22a100d..16ba2db36 100644
--- a/e2e/tsconfig.e2e.typecheck.json
+++ b/e2e/tsconfig.e2e.typecheck.json
@@ -2,6 +2,10 @@
"extends": "./tsconfig.e2e.json",
"compilerOptions": {
"noEmit": true,
- "noUnusedLocals": true
+ "noUnusedLocals": true,
+ "noImplicitAny": true,
+ "esModuleInterop": true,
+ "allowJs": true,
+ "allowSyntheticDefaultImports": true
}
}
diff --git a/package-lock.json b/package-lock.json
index 66b51fb84..3e202f1c9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -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": {
diff --git a/package.json b/package.json
index fdf3b37b9..86a736283 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/projects/aca-shared/rules/src/app.rules.ts b/projects/aca-shared/rules/src/app.rules.ts
index 652ebe8f6..0468070aa 100644
--- a/projects/aca-shared/rules/src/app.rules.ts
+++ b/projects/aca-shared/rules/src/app.rules.ts
@@ -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';
}
diff --git a/projects/aca-shared/rules/src/navigation.rules.ts b/projects/aca-shared/rules/src/navigation.rules.ts
index 27885fa12..9ebad9a86 100644
--- a/projects/aca-shared/rules/src/navigation.rules.ts
+++ b/projects/aca-shared/rules/src/navigation.rules.ts
@@ -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')));
}
/**
diff --git a/projects/aca-shared/src/lib/adf-extensions/extensions-data-loader.guard.spec.ts b/projects/aca-shared/src/lib/adf-extensions/extensions-data-loader.guard.spec.ts
index 3a9c22e17..bcfb4c64d 100644
--- a/projects/aca-shared/src/lib/adf-extensions/extensions-data-loader.guard.spec.ts
+++ b/projects/aca-shared/src/lib/adf-extensions/extensions-data-loader.guard.spec.ts
@@ -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();
- 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();
const subject2 = new Subject();
- 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();
const subject2 = new Subject();
- 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();
- 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();
const extensionLoaders = {
- fct1: function() {
+ fct1: function () {
return subject1.asObservable();
}
};
diff --git a/projects/aca-shared/src/lib/adf-extensions/extensions-data-loader.guard.ts b/projects/aca-shared/src/lib/adf-extensions/extensions-data-loader.guard.ts
index 9097925a4..cf842aae8 100644
--- a/projects/aca-shared/src/lib/adf-extensions/extensions-data-loader.guard.ts
+++ b/projects/aca-shared/src/lib/adf-extensions/extensions-data-loader.guard.ts
@@ -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;
+export type ExtensionLoaderCallback = (route: ActivatedRouteSnapshot) => Observable;
export function DefaultExtensionLoaderFactory() {
return [];
}
-export const EXTENSION_DATA_LOADERS = new InjectionToken<
- ExtensionLoaderCallback[]
->('EXTENSION_DATA_LOADERS', {
+export const EXTENSION_DATA_LOADERS = new InjectionToken('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);
diff --git a/projects/aca-shared/src/lib/components/generic-error/generic-error.component.ts b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.ts
index 2b396d4b3..a2dd88781 100644
--- a/projects/aca-shared/src/lib/components/generic-error/generic-error.component.ts
+++ b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.ts
@@ -23,12 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- Component,
- ViewEncapsulation,
- ChangeDetectionStrategy,
- Input
-} from '@angular/core';
+import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
@Component({
selector: 'aca-generic-error',
diff --git a/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.spec.ts b/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.spec.ts
index 4de63a174..97e95e817 100644
--- a/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.spec.ts
+++ b/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.spec.ts
@@ -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', () => {
diff --git a/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.ts b/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.ts
index e71f897a4..18e5351b3 100644
--- a/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.ts
+++ b/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.ts
@@ -23,26 +23,11 @@
* along with Alfresco. If not, see .
*/
-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,
- private contentApi: ContentApiService,
- private extensions: AppExtensionService
- ) {}
+ constructor(private store: Store, 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;
},
diff --git a/projects/aca-shared/src/lib/components/info-drawer/shared-info-drawer.module.ts b/projects/aca-shared/src/lib/components/info-drawer/shared-info-drawer.module.ts
index 4c756e9a1..c47857c19 100644
--- a/projects/aca-shared/src/lib/components/info-drawer/shared-info-drawer.module.ts
+++ b/projects/aca-shared/src/lib/components/info-drawer/shared-info-drawer.module.ts
@@ -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]
})
diff --git a/projects/aca-shared/src/lib/components/locked-by/locked-by.component.ts b/projects/aca-shared/src/lib/components/locked-by/locked-by.component.ts
index 664dea37c..e12ee05fa 100644
--- a/projects/aca-shared/src/lib/components/locked-by/locked-by.component.ts
+++ b/projects/aca-shared/src/lib/components/locked-by/locked-by.component.ts
@@ -23,13 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- Component,
- Input,
- OnInit,
- ChangeDetectionStrategy,
- ViewEncapsulation
-} from '@angular/core';
+import { Component, Input, OnInit, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
import { NodeEntry } from '@alfresco/js-api';
@@ -60,10 +54,7 @@ export class LockedByComponent implements OnInit {
writeLockedBy() {
return (
- this.node &&
- this.node.entry.properties &&
- this.node.entry.properties['cm:lockOwner'] &&
- this.node.entry.properties['cm:lockOwner'].displayName
+ this.node && this.node.entry.properties && this.node.entry.properties['cm:lockOwner'] && this.node.entry.properties['cm:lockOwner'].displayName
);
}
}
diff --git a/projects/aca-shared/src/lib/components/page-layout/page-layout-content.component.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout-content.component.ts
index f38f0c753..4a52c5896 100644
--- a/projects/aca-shared/src/lib/components/page-layout/page-layout-content.component.ts
+++ b/projects/aca-shared/src/lib/components/page-layout/page-layout-content.component.ts
@@ -23,19 +23,11 @@
* along with Alfresco. If not, see .
*/
-import {
- Component,
- ViewEncapsulation,
- ChangeDetectionStrategy,
- Input,
- HostBinding
-} from '@angular/core';
+import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, HostBinding } from '@angular/core';
@Component({
selector: 'aca-page-layout-content',
- template: `
-
- `,
+ template: ``,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'aca-page-layout-content' }
diff --git a/projects/aca-shared/src/lib/components/page-layout/page-layout-error.component.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout-error.component.ts
index 43f278964..9d1052adb 100644
--- a/projects/aca-shared/src/lib/components/page-layout/page-layout-error.component.ts
+++ b/projects/aca-shared/src/lib/components/page-layout/page-layout-error.component.ts
@@ -23,17 +23,11 @@
* along with Alfresco. If not, see .
*/
-import {
- Component,
- ViewEncapsulation,
- ChangeDetectionStrategy
-} from '@angular/core';
+import { Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'aca-page-layout-error',
- template: `
-
- `,
+ template: ``,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'aca-page-layout-error' }
diff --git a/projects/aca-shared/src/lib/components/page-layout/page-layout-header.component.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout-header.component.ts
index 1b5431d15..f471a5e8f 100644
--- a/projects/aca-shared/src/lib/components/page-layout/page-layout-header.component.ts
+++ b/projects/aca-shared/src/lib/components/page-layout/page-layout-header.component.ts
@@ -23,11 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- Component,
- ViewEncapsulation,
- ChangeDetectionStrategy
-} from '@angular/core';
+import { Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'aca-page-layout-header',
diff --git a/projects/aca-shared/src/lib/components/page-layout/page-layout.component.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout.component.ts
index 10fdce346..250f210ec 100644
--- a/projects/aca-shared/src/lib/components/page-layout/page-layout.component.ts
+++ b/projects/aca-shared/src/lib/components/page-layout/page-layout.component.ts
@@ -23,12 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- Component,
- ViewEncapsulation,
- ChangeDetectionStrategy,
- Input
-} from '@angular/core';
+import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
@Component({
selector: 'aca-page-layout',
diff --git a/projects/aca-shared/src/lib/components/page-layout/page-layout.module.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout.module.ts
index f86a22a1b..7ee0ae329 100644
--- a/projects/aca-shared/src/lib/components/page-layout/page-layout.module.ts
+++ b/projects/aca-shared/src/lib/components/page-layout/page-layout.module.ts
@@ -32,17 +32,7 @@ import { CommonModule } from '@angular/common';
@NgModule({
imports: [CommonModule],
- declarations: [
- PageLayoutContentComponent,
- PageLayoutErrorComponent,
- PageLayoutHeaderComponent,
- PageLayoutComponent
- ],
- exports: [
- PageLayoutContentComponent,
- PageLayoutErrorComponent,
- PageLayoutHeaderComponent,
- PageLayoutComponent
- ]
+ declarations: [PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutComponent],
+ exports: [PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutComponent]
})
export class PageLayoutModule {}
diff --git a/projects/aca-shared/src/lib/components/tool-bar/shared-toolbar.module.ts b/projects/aca-shared/src/lib/components/tool-bar/shared-toolbar.module.ts
index e671da95b..eedb1eaf9 100644
--- a/projects/aca-shared/src/lib/components/tool-bar/shared-toolbar.module.ts
+++ b/projects/aca-shared/src/lib/components/tool-bar/shared-toolbar.module.ts
@@ -34,17 +34,7 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
@NgModule({
imports: [CommonModule, CoreModule, ExtensionsModule],
- declarations: [
- ToolbarButtonComponent,
- ToolbarActionComponent,
- ToolbarMenuItemComponent,
- ToolbarMenuComponent
- ],
- exports: [
- ToolbarButtonComponent,
- ToolbarActionComponent,
- ToolbarMenuItemComponent,
- ToolbarMenuComponent
- ]
+ declarations: [ToolbarButtonComponent, ToolbarActionComponent, ToolbarMenuItemComponent, ToolbarMenuComponent],
+ exports: [ToolbarButtonComponent, ToolbarActionComponent, ToolbarMenuItemComponent, ToolbarMenuComponent]
})
export class SharedToolbarModule {}
diff --git a/projects/aca-shared/src/lib/components/tool-bar/toolbar-action/toolbar-action.component.ts b/projects/aca-shared/src/lib/components/tool-bar/toolbar-action/toolbar-action.component.ts
index 5df7da924..e42dd9081 100644
--- a/projects/aca-shared/src/lib/components/tool-bar/toolbar-action/toolbar-action.component.ts
+++ b/projects/aca-shared/src/lib/components/tool-bar/toolbar-action/toolbar-action.component.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- Component,
- ViewEncapsulation,
- ChangeDetectionStrategy,
- Input,
- DoCheck,
- ChangeDetectorRef
-} from '@angular/core';
+import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, DoCheck, ChangeDetectorRef } from '@angular/core';
import { ContentActionRef } from '@alfresco/adf-extensions';
@Component({
diff --git a/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.ts b/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.ts
index 936dd7681..4e78b1e07 100644
--- a/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.ts
+++ b/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.ts
@@ -40,11 +40,7 @@ export class ToolbarMenuComponent {
color = '';
get hasChildren(): boolean {
- return (
- this.actionRef &&
- this.actionRef.children &&
- this.actionRef.children.length > 0
- );
+ return this.actionRef && this.actionRef.children && this.actionRef.children.length > 0;
}
trackById(_: number, obj: { id: string }) {
diff --git a/projects/aca-shared/src/lib/directives/contextmenu/contextmenu.directive.spec.ts b/projects/aca-shared/src/lib/directives/contextmenu/contextmenu.directive.spec.ts
index 97d7862d0..b3076806f 100644
--- a/projects/aca-shared/src/lib/directives/contextmenu/contextmenu.directive.spec.ts
+++ b/projects/aca-shared/src/lib/directives/contextmenu/contextmenu.directive.spec.ts
@@ -48,8 +48,7 @@ describe('ContextActionsDirective', () => {
it('should call service to render context menu', fakeAsync(() => {
const el = document.createElement('div');
- el.className =
- 'adf-datatable-cell adf-datatable-cell--text adf-datatable-row';
+ el.className = 'adf-datatable-cell adf-datatable-cell--text adf-datatable-row';
const fragment = document.createDocumentFragment();
fragment.appendChild(el);
@@ -62,8 +61,6 @@ describe('ContextActionsDirective', () => {
tick(500);
- expect(storeMock.dispatch).toHaveBeenCalledWith(
- new ContextMenu(mouseEventMock)
- );
+ expect(storeMock.dispatch).toHaveBeenCalledWith(new ContextMenu(mouseEventMock));
}));
});
diff --git a/projects/aca-shared/src/lib/directives/contextmenu/contextmenu.directive.ts b/projects/aca-shared/src/lib/directives/contextmenu/contextmenu.directive.ts
index 0ef651b2c..09a820356 100644
--- a/projects/aca-shared/src/lib/directives/contextmenu/contextmenu.directive.ts
+++ b/projects/aca-shared/src/lib/directives/contextmenu/contextmenu.directive.ts
@@ -23,13 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- Directive,
- HostListener,
- Input,
- OnInit,
- OnDestroy
-} from '@angular/core';
+import { Directive, HostListener, Input, OnInit, OnDestroy } from '@angular/core';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { Store } from '@ngrx/store';
@@ -64,11 +58,9 @@ export class ContextActionsDirective implements OnInit, OnDestroy {
constructor(private store: Store) {}
ngOnInit() {
- this.execute$
- .pipe(debounceTime(300), takeUntil(this.onDestroy$))
- .subscribe((event: MouseEvent) => {
- this.store.dispatch(new ContextMenu(event));
- });
+ this.execute$.pipe(debounceTime(300), takeUntil(this.onDestroy$)).subscribe((event: MouseEvent) => {
+ this.store.dispatch(new ContextMenu(event));
+ });
}
ngOnDestroy() {
@@ -94,9 +86,7 @@ export class ContextActionsDirective implements OnInit, OnDestroy {
return false;
}
- return this.findAncestor(target, 'adf-datatable-row').classList.contains(
- 'adf-is-selected'
- );
+ return this.findAncestor(target, 'adf-datatable-row').classList.contains('adf-is-selected');
}
private findAncestor(el: Element, className: string): Element {
diff --git a/projects/aca-shared/src/lib/directives/pagination.directive.spec.ts b/projects/aca-shared/src/lib/directives/pagination.directive.spec.ts
index 24b596573..3c8fff711 100644
--- a/projects/aca-shared/src/lib/directives/pagination.directive.spec.ts
+++ b/projects/aca-shared/src/lib/directives/pagination.directive.spec.ts
@@ -47,15 +47,8 @@ describe('PaginationDirective', () => {
beforeEach(() => {
TestBed.configureTestingModule({
- imports: [
- TranslateModule.forRoot(),
- LibTestingModule,
- SharedDirectivesModule,
- CoreTestingModule
- ],
- providers: [
- { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
- ]
+ imports: [TranslateModule.forRoot(), LibTestingModule, SharedDirectivesModule, CoreTestingModule],
+ providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
});
preferences = TestBed.inject(UserPreferencesService);
diff --git a/projects/aca-shared/src/lib/directives/pagination.directive.ts b/projects/aca-shared/src/lib/directives/pagination.directive.ts
index e8cafb0f2..f57188689 100644
--- a/projects/aca-shared/src/lib/directives/pagination.directive.ts
+++ b/projects/aca-shared/src/lib/directives/pagination.directive.ts
@@ -24,12 +24,7 @@
*/
import { Directive, OnInit, OnDestroy } from '@angular/core';
-import {
- PaginationComponent,
- UserPreferencesService,
- PaginationModel,
- AppConfigService
-} from '@alfresco/adf-core';
+import { PaginationComponent, UserPreferencesService, PaginationModel, AppConfigService } from '@alfresco/adf-core';
import { Subscription } from 'rxjs';
@Directive({
@@ -38,16 +33,10 @@ import { Subscription } from 'rxjs';
export class PaginationDirective implements OnInit, OnDestroy {
private subscriptions: Subscription[] = [];
- constructor(
- private pagination: PaginationComponent,
- private preferences: UserPreferencesService,
- private config: AppConfigService
- ) {}
+ constructor(private pagination: PaginationComponent, private preferences: UserPreferencesService, private config: AppConfigService) {}
ngOnInit() {
- this.pagination.supportedPageSizes = this.config.get(
- 'pagination.supportedPageSizes'
- );
+ this.pagination.supportedPageSizes = this.config.get('pagination.supportedPageSizes');
this.subscriptions.push(
this.pagination.changePageSize.subscribe((event: PaginationModel) => {
@@ -57,7 +46,7 @@ export class PaginationDirective implements OnInit, OnDestroy {
}
ngOnDestroy() {
- this.subscriptions.forEach(subscription => subscription.unsubscribe());
+ this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}
}
diff --git a/projects/aca-shared/src/lib/routing/app.routes.strategy.ts b/projects/aca-shared/src/lib/routing/app.routes.strategy.ts
index 4bb4ff5b0..eca5e4172 100644
--- a/projects/aca-shared/src/lib/routing/app.routes.strategy.ts
+++ b/projects/aca-shared/src/lib/routing/app.routes.strategy.ts
@@ -23,11 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- RouteReuseStrategy,
- DetachedRouteHandle,
- ActivatedRouteSnapshot
-} from '@angular/router';
+import { RouteReuseStrategy, DetachedRouteHandle, ActivatedRouteSnapshot } from '@angular/router';
import { ComponentRef, Injectable } from '@angular/core';
interface RouteData {
@@ -44,7 +40,7 @@ export class AppRouteReuseStrategy implements RouteReuseStrategy {
private routeCache = new Map();
resetCache() {
- this.routeCache.forEach(value => {
+ this.routeCache.forEach((value) => {
this.deactivateComponent(value.handle);
});
this.routeCache.clear();
@@ -60,10 +56,7 @@ export class AppRouteReuseStrategy implements RouteReuseStrategy {
}
}
- shouldReuseRoute(
- future: ActivatedRouteSnapshot,
- curr: ActivatedRouteSnapshot
- ): boolean {
+ shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {
const ret = future.routeConfig === curr.routeConfig;
if (ret) {
this.addRedirectsRecursively(future); // update redirects
@@ -91,9 +84,7 @@ export class AppRouteReuseStrategy implements RouteReuseStrategy {
retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle {
const url = this.getFullRouteUrl(route);
const data = this.getRouteData(route);
- return data && data.reuse && this.routeCache.has(url)
- ? this.routeCache.get(url).handle
- : null;
+ return data && data.reuse && this.routeCache.has(url) ? this.routeCache.get(url).handle : null;
}
private addRedirectsRecursively(route: ActivatedRouteSnapshot): void {
@@ -101,40 +92,30 @@ export class AppRouteReuseStrategy implements RouteReuseStrategy {
if (config) {
if (!config.loadChildren) {
const routeFirstChild = route.firstChild;
- const routeFirstChildUrl = routeFirstChild
- ? this.getRouteUrlPaths(routeFirstChild).join('/')
- : '';
+ const routeFirstChildUrl = routeFirstChild ? this.getRouteUrlPaths(routeFirstChild).join('/') : '';
const childConfigs = config.children;
if (childConfigs) {
- const childConfigWithRedirect = childConfigs.find(
- c => c.path === '' && !!c.redirectTo
- );
+ const childConfigWithRedirect = childConfigs.find((c) => c.path === '' && !!c.redirectTo);
if (childConfigWithRedirect) {
childConfigWithRedirect.redirectTo = routeFirstChildUrl;
}
}
}
- route.children.forEach(childRoute =>
- this.addRedirectsRecursively(childRoute)
- );
+ route.children.forEach((childRoute) => this.addRedirectsRecursively(childRoute));
}
}
private getFullRouteUrl(route: ActivatedRouteSnapshot): string {
- return this.getFullRouteUrlPaths(route)
- .filter(Boolean)
- .join('/');
+ return this.getFullRouteUrlPaths(route).filter(Boolean).join('/');
}
private getFullRouteUrlPaths(route: ActivatedRouteSnapshot): string[] {
const paths = this.getRouteUrlPaths(route);
- return route.parent
- ? [...this.getFullRouteUrlPaths(route.parent), ...paths]
- : paths;
+ return route.parent ? [...this.getFullRouteUrlPaths(route.parent), ...paths] : paths;
}
private getRouteUrlPaths(route: ActivatedRouteSnapshot): string[] {
- return route.url.map(urlSegment => urlSegment.path);
+ return route.url.map((urlSegment) => urlSegment.path);
}
private getRouteData(route: ActivatedRouteSnapshot): RouteData {
diff --git a/projects/aca-shared/src/lib/routing/shared.guard.ts b/projects/aca-shared/src/lib/routing/shared.guard.ts
index ea9b93e32..f5be306c1 100644
--- a/projects/aca-shared/src/lib/routing/shared.guard.ts
+++ b/projects/aca-shared/src/lib/routing/shared.guard.ts
@@ -39,15 +39,11 @@ export class AppSharedRuleGuard implements CanActivate {
this.isQuickShareEnabled$ = store.select(isQuickShareEnabled);
}
- canActivate(
- _: ActivatedRouteSnapshot
- ): Observable | Promise | boolean {
+ canActivate(_: ActivatedRouteSnapshot): Observable | Promise | boolean {
return this.isQuickShareEnabled$;
}
- canActivateChild(
- route: ActivatedRouteSnapshot
- ): Observable | Promise | boolean {
+ canActivateChild(route: ActivatedRouteSnapshot): Observable | Promise | boolean {
return this.canActivate(route);
}
}
diff --git a/projects/aca-shared/src/lib/services/app.extension.service.spec.ts b/projects/aca-shared/src/lib/services/app.extension.service.spec.ts
index 064b73557..14c149d80 100644
--- a/projects/aca-shared/src/lib/services/app.extension.service.spec.ts
+++ b/projects/aca-shared/src/lib/services/app.extension.service.spec.ts
@@ -567,9 +567,7 @@ describe('AppExtensionService', () => {
});
it('should use implicit order', () => {
- const sorted = [{ id: '3' }, { id: '2' }, { id: '1', order: 1 }].sort(
- sortByOrder
- );
+ const sorted = [{ id: '3' }, { id: '2' }, { id: '1', order: 1 }].sort(sortByOrder);
expect(sorted[0].id).toBe('1');
expect(sorted[1].id).toBe('3');
@@ -579,11 +577,7 @@ describe('AppExtensionService', () => {
describe('filtering', () => {
it('should filter out disabled items', () => {
- const items = [
- { id: 1, disabled: true },
- { id: 2 },
- { id: 3, disabled: true }
- ].filter(filterEnabled);
+ const items = [{ id: 1, disabled: true }, { id: 2 }, { id: 3, disabled: true }].filter(filterEnabled);
expect(items.length).toBe(1);
expect(items[0].id).toBe(2);
@@ -594,11 +588,7 @@ describe('AppExtensionService', () => {
{ id: '1', disabled: true },
{
id: '2',
- someItems: [
- { id: '21', disabled: true },
- { id: '22', disabled: false },
- { id: '23' }
- ],
+ someItems: [{ id: '21', disabled: true }, { id: '22', disabled: false }, { id: '23' }],
someObjectProp: {
innerItems: [{ id: '24' }, { id: '25', disabled: true }]
}
@@ -700,10 +690,7 @@ describe('AppExtensionService', () => {
{ items: [{ children: [{ route: 'route3', disabled: true }] }] }
]);
- expect(navigation).toEqual([
- { items: [{ route: 'route1', url: '/route1' }] },
- { items: [{ children: [] }] }
- ] as NavBarGroupRef[]);
+ expect(navigation).toEqual([{ items: [{ route: 'route1', url: '/route1' }] }, { items: [{ children: [] }] }] as NavBarGroupRef[]);
});
it('should filter out items based on rule', () => {
diff --git a/projects/aca-shared/src/lib/services/app.extension.service.ts b/projects/aca-shared/src/lib/services/app.extension.service.ts
index 6b69b22ce..bfd769f7b 100644
--- a/projects/aca-shared/src/lib/services/app.extension.service.ts
+++ b/projects/aca-shared/src/lib/services/app.extension.service.ts
@@ -27,11 +27,7 @@ import { Injectable, Type } from '@angular/core';
import { Store } from '@ngrx/store';
import { MatIconRegistry } from '@angular/material/icon';
import { DomSanitizer } from '@angular/platform-browser';
-import {
- AppStore,
- getRuleContext,
- getLanguagePickerState
-} from '@alfresco/aca-shared/store';
+import { AppStore, getRuleContext, getLanguagePickerState } from '@alfresco/aca-shared/store';
import {
SelectionState,
NavigationState,
@@ -53,11 +49,7 @@ import {
DocumentListPresetRef,
IconRef
} from '@alfresco/adf-extensions';
-import {
- AppConfigService,
- AuthenticationService,
- LogService
-} from '@alfresco/adf-core';
+import { AppConfigService, AuthenticationService, LogService } from '@alfresco/adf-core';
import { BehaviorSubject, Observable } from 'rxjs';
import { RepositoryInfo, NodeEntry } from '@alfresco/js-api';
import { ViewerRules } from '../models/viewer.rules';
@@ -132,14 +124,14 @@ export class AppExtensionService implements RuleContext {
) {
this.references$ = this._references.asObservable();
- this.store.select(getRuleContext).subscribe(result => {
+ this.store.select(getRuleContext).subscribe((result) => {
this.selection = result.selection;
this.navigation = result.navigation;
this.profile = result.profile;
this.repository = result.repository;
});
- this.store.select(getLanguagePickerState).subscribe(result => {
+ this.store.select(getLanguagePickerState).subscribe((result) => {
this.languagePicker = result;
});
}
@@ -155,62 +147,26 @@ export class AppExtensionService implements RuleContext {
return;
}
- this.settingGroups = this.loader.getElements(
- config,
- 'settings'
- );
+ this.settingGroups = this.loader.getElements(config, 'settings');
- this.headerActions = this.loader.getContentActions(
- config,
- 'features.header'
- );
- this.sidebarActions = this.loader.getContentActions(
- config,
- 'features.sidebar.toolbar'
- );
- this.toolbarActions = this.loader.getContentActions(
- config,
- 'features.toolbar'
- );
- this.viewerToolbarActions = this.loader.getContentActions(
- config,
- 'features.viewer.toolbarActions'
- );
- this.sharedLinkViewerToolbarActions = this.loader.getContentActions(
- config,
- 'features.viewer.shared.toolbarActions'
- );
+ this.headerActions = this.loader.getContentActions(config, 'features.header');
+ this.sidebarActions = this.loader.getContentActions(config, 'features.sidebar.toolbar');
+ this.toolbarActions = this.loader.getContentActions(config, 'features.toolbar');
+ this.viewerToolbarActions = this.loader.getContentActions(config, 'features.viewer.toolbarActions');
+ this.sharedLinkViewerToolbarActions = this.loader.getContentActions(config, 'features.viewer.shared.toolbarActions');
- this.contextMenuActions = this.loader.getContentActions(
- config,
- 'features.contextMenu'
- );
- this.openWithActions = this.loader.getContentActions(
- config,
- 'features.viewer.openWith'
- );
- this.createActions = this.loader.getElements(
- config,
- 'features.create'
- );
+ this.contextMenuActions = this.loader.getContentActions(config, 'features.contextMenu');
+ this.openWithActions = this.loader.getContentActions(config, 'features.viewer.openWith');
+ this.createActions = this.loader.getElements(config, 'features.create');
this.navbar = this.loadNavBar(config);
- this.sidebarTabs = this.loader.getElements(
- config,
- 'features.sidebar.tabs'
- );
- this.userActions = this.loader.getContentActions(
- config,
- 'features.userActions'
- );
+ this.sidebarTabs = this.loader.getElements(config, 'features.sidebar.tabs');
+ this.userActions = this.loader.getContentActions(config, 'features.userActions');
this.contentMetadata = this.loadContentMetadata(config);
this.documentListPresets = {
files: this.getDocumentListPreset(config, 'files'),
libraries: this.getDocumentListPreset(config, 'libraries'),
- favoriteLibraries: this.getDocumentListPreset(
- config,
- 'favoriteLibraries'
- ),
+ favoriteLibraries: this.getDocumentListPreset(config, 'favoriteLibraries'),
shared: this.getDocumentListPreset(config, 'shared'),
recent: this.getDocumentListPreset(config, 'recent'),
favorites: this.getDocumentListPreset(config, 'favorites'),
@@ -218,10 +174,7 @@ export class AppExtensionService implements RuleContext {
searchLibraries: this.getDocumentListPreset(config, 'search-libraries')
};
- this.withCredentials = this.appConfig.get(
- 'auth.withCredentials',
- false
- );
+ this.withCredentials = this.appConfig.get('auth.withCredentials', false);
if (config.features && config.features.viewer) {
this.viewerRules = (config.features.viewer['rules'] as ViewerRules) || {};
@@ -229,16 +182,12 @@ export class AppExtensionService implements RuleContext {
this.registerIcons(config);
- const references = (config.$references || [])
- .filter(entry => typeof entry === 'object')
- .map(entry => entry as ExtensionRef);
+ const references = (config.$references || []).filter((entry) => typeof entry === 'object').map((entry) => entry as ExtensionRef);
this._references.next(references);
}
protected registerIcons(config: ExtensionConfig) {
- const icons: Array = this.loader
- .getElements(config, 'features.icons')
- .filter(entry => !entry.disabled);
+ const icons: Array = this.loader.getElements(config, 'features.icons').filter((entry) => !entry.disabled);
for (const icon of icons) {
const [ns, id] = icon.id.split(':');
@@ -249,11 +198,7 @@ export class AppExtensionService implements RuleContext {
} else if (!ns || !id) {
console.warn(`Incorrect icon id format: "${icon.id}".`);
} else {
- this.matIconRegistry.addSvgIconInNamespace(
- ns,
- id,
- this.sanitizer.bypassSecurityTrustResourceUrl(value)
- );
+ this.matIconRegistry.addSvgIconInNamespace(ns, id, this.sanitizer.bypassSecurityTrustResourceUrl(value));
}
}
}
@@ -263,31 +208,26 @@ export class AppExtensionService implements RuleContext {
}
protected getDocumentListPreset(config: ExtensionConfig, key: string) {
- return this.loader
- .getElements(
- config,
- `features.documentList.${key}`
- )
- .filter(entry => !entry.disabled);
+ return this.loader.getElements(config, `features.documentList.${key}`).filter((entry) => !entry.disabled);
}
getApplicationNavigation(elements): Array {
return elements
- .filter(group => this.filterVisible(group))
- .map(group => {
+ .filter((group) => this.filterVisible(group))
+ .map((group) => {
return {
...group,
items: (group.items || [])
- .filter(entry => !entry.disabled)
- .filter(item => this.filterVisible(item))
+ .filter((entry) => !entry.disabled)
+ .filter((item) => this.filterVisible(item))
.sort(sortByOrder)
- .map(item => {
+ .map((item) => {
if (item.children && item.children.length > 0) {
item.children = item.children
- .filter(entry => !entry.disabled)
- .filter(child => this.filterVisible(child))
+ .filter((entry) => !entry.disabled)
+ .filter((child) => this.filterVisible(child))
.sort(sortByOrder)
- .map(child => {
+ .map((child) => {
if (child.component) {
return {
...child
@@ -295,12 +235,8 @@ export class AppExtensionService implements RuleContext {
}
if (!child.click) {
- const childRouteRef = this.extensions.getRouteById(
- child.route
- );
- const childUrl = `/${
- childRouteRef ? childRouteRef.path : child.route
- }`;
+ const childRouteRef = this.extensions.getRouteById(child.route);
+ const childUrl = `/${childRouteRef ? childRouteRef.path : child.route}`;
return {
...child,
url: childUrl
@@ -342,10 +278,7 @@ export class AppExtensionService implements RuleContext {
}
loadContentMetadata(config: ExtensionConfig): any {
- const elements = this.loader.getElements(
- config,
- 'features.content-metadata-presets'
- );
+ const elements = this.loader.getElements(config, 'features.content-metadata-presets');
if (!elements.length) {
return null;
}
@@ -356,10 +289,7 @@ export class AppExtensionService implements RuleContext {
try {
this.appConfig.config['content-metadata'] = { presets };
} catch (error) {
- this.logger.error(
- error,
- '- could not change content-metadata from app.config -'
- );
+ this.logger.error(error, '- could not change content-metadata from app.config -');
}
return { presets };
@@ -367,12 +297,10 @@ export class AppExtensionService implements RuleContext {
filterDisabled(object: Array<{ disabled: boolean }> | { disabled: boolean }) {
if (Array.isArray(object)) {
- return object
- .filter(item => !item.disabled)
- .map(item => this.filterDisabled(item));
+ return object.filter((item) => !item.disabled).map((item) => this.filterDisabled(item));
} else if (typeof object === 'object') {
if (!object.disabled) {
- Object.keys(object).forEach(prop => {
+ Object.keys(object).forEach((prop) => {
object[prop] = this.filterDisabled(object[prop]);
});
return object;
@@ -387,7 +315,7 @@ export class AppExtensionService implements RuleContext {
}
getSidebarTabs(): Array {
- return this.sidebarTabs.filter(action => this.filterVisible(action));
+ return this.sidebarTabs.filter((action) => this.filterVisible(action));
}
getComponentById(id: string): Type<{}> {
@@ -395,10 +323,8 @@ export class AppExtensionService implements RuleContext {
}
getApplicationRoutes(): Array {
- return this.extensions.routes.map(route => {
- const guards = this.extensions.getAuthGuards(
- route.auth && route.auth.length > 0 ? route.auth : this.defaults.auth
- );
+ return this.extensions.routes.map((route) => {
+ const guards = this.extensions.getAuthGuards(route.auth && route.auth.length > 0 ? route.auth : this.defaults.auth);
return {
path: route.path,
@@ -419,10 +345,10 @@ export class AppExtensionService implements RuleContext {
getCreateActions(): Array {
return this.createActions
- .filter(action => this.filterVisible(action))
- .map(action => this.copyAction(action))
- .map(action => this.buildMenu(action))
- .map(action => {
+ .filter((action) => this.filterVisible(action))
+ .map((action) => this.copyAction(action))
+ .map((action) => this.buildMenu(action))
+ .map((action) => {
let disabled = false;
if (action.rules && action.rules.enabled) {
@@ -437,24 +363,15 @@ export class AppExtensionService implements RuleContext {
}
private buildMenu(actionRef: ContentActionRef): ContentActionRef {
- if (
- actionRef.type === ContentActionType.menu &&
- actionRef.children &&
- actionRef.children.length > 0
- ) {
- const children = actionRef.children
- .filter(action => this.filterVisible(action))
- .map(action => this.buildMenu(action));
+ if (actionRef.type === ContentActionType.menu && actionRef.children && actionRef.children.length > 0) {
+ const children = actionRef.children.filter((action) => this.filterVisible(action)).map((action) => this.buildMenu(action));
actionRef.children = children
- .map(action => {
+ .map((action) => {
let disabled = false;
if (action.rules && action.rules.enabled) {
- disabled = !this.extensions.evaluateRule(
- action.rules.enabled,
- this
- );
+ disabled = !this.extensions.evaluateRule(action.rules.enabled, this);
}
return {
@@ -472,14 +389,14 @@ export class AppExtensionService implements RuleContext {
private getAllowedActions(actions: ContentActionRef[]): ContentActionRef[] {
return (actions || [])
- .filter(action => this.filterVisible(action))
- .map(action => {
+ .filter((action) => this.filterVisible(action))
+ .map((action) => {
if (action.type === ContentActionType.menu) {
const copy = this.copyAction(action);
if (copy.children && copy.children.length > 0) {
copy.children = copy.children
- .filter(entry => !entry.disabled)
- .filter(childAction => this.filterVisible(childAction))
+ .filter((entry) => !entry.disabled)
+ .filter((childAction) => this.filterVisible(childAction))
.sort(sortByOrder)
.reduce(reduceSeparators, []);
}
@@ -509,13 +426,13 @@ export class AppExtensionService implements RuleContext {
getHeaderActions(): Array {
return this.headerActions
- .filter(action => this.filterVisible(action))
- .map(action => {
+ .filter((action) => this.filterVisible(action))
+ .map((action) => {
if (action.type === ContentActionType.menu) {
const copy = this.copyAction(action);
if (copy.children && copy.children.length > 0) {
copy.children = copy.children
- .filter(childAction => this.filterVisible(childAction))
+ .filter((childAction) => this.filterVisible(childAction))
.sort(sortByOrder)
.reduce(reduceEmptyMenus, [])
.reduce(reduceSeparators, []);
@@ -535,25 +452,21 @@ export class AppExtensionService implements RuleContext {
}
getUserActions(): Array {
- return this.userActions
- .filter(action => this.filterVisible(action))
- .sort(sortByOrder);
+ return this.userActions.filter((action) => this.filterVisible(action)).sort(sortByOrder);
}
getSettingsGroups(): Array {
- return this.settingGroups.filter(group => this.filterVisible(group));
+ return this.settingGroups.filter((group) => this.filterVisible(group));
}
copyAction(action: ContentActionRef): ContentActionRef {
return {
...action,
- children: (action.children || []).map(child => this.copyAction(child))
+ children: (action.children || []).map((child) => this.copyAction(child))
};
}
- filterVisible(
- action: ContentActionRef | SettingsGroupRef | SidebarTabRef
- ): boolean {
+ filterVisible(action: ContentActionRef | SettingsGroupRef | SidebarTabRef): boolean {
if (action && action.rules && action.rules.visible) {
return this.extensions.evaluateRule(action.rules.visible, this);
}
diff --git a/projects/aca-shared/src/lib/services/app.service.spec.ts b/projects/aca-shared/src/lib/services/app.service.spec.ts
index fe7c6cfea..87f5c3747 100644
--- a/projects/aca-shared/src/lib/services/app.service.spec.ts
+++ b/projects/aca-shared/src/lib/services/app.service.spec.ts
@@ -61,27 +61,17 @@ describe('AppService', () => {
spyOn(routeReuse, 'resetCache').and.stub();
- service = new AppService(
- auth,
- appConfig,
- searchQueryBuilderService,
- routeReuse
- );
+ service = new AppService(auth, appConfig, searchQueryBuilderService, routeReuse);
});
- it('should be ready if [withCredentials] mode is used', done => {
+ it('should be ready if [withCredentials] mode is used', (done) => {
appConfig.config = {
auth: {
withCredentials: true
}
};
- const instance = new AppService(
- auth,
- appConfig,
- searchQueryBuilderService,
- routeReuse
- );
+ const instance = new AppService(auth, appConfig, searchQueryBuilderService, routeReuse);
expect(instance.withCredentials).toBeTruthy();
instance.ready$.subscribe(() => {
@@ -101,7 +91,7 @@ describe('AppService', () => {
it('should be ready after login', async () => {
let isReady = false;
- service.ready$.subscribe(value => {
+ service.ready$.subscribe((value) => {
isReady = value;
});
auth.onLogin.next();
diff --git a/projects/aca-shared/src/lib/services/content-api.service.ts b/projects/aca-shared/src/lib/services/content-api.service.ts
index 74a8fd63b..56459c06f 100644
--- a/projects/aca-shared/src/lib/services/content-api.service.ts
+++ b/projects/aca-shared/src/lib/services/content-api.service.ts
@@ -49,10 +49,7 @@ import { map } from 'rxjs/operators';
providedIn: 'root'
})
export class ContentApiService {
- constructor(
- private api: AlfrescoApiService,
- private preferences: UserPreferencesService
- ) {}
+ constructor(private api: AlfrescoApiService, private preferences: UserPreferencesService) {}
/**
* Moves a node to the trashcan.
@@ -60,10 +57,7 @@ export class ContentApiService {
* @param options Optional parameters supported by JS-API
* @returns Empty result that notifies when the deletion is complete
*/
- deleteNode(
- nodeId: string,
- options: { permanent?: boolean } = {}
- ): Observable {
+ deleteNode(nodeId: string, options: { permanent?: boolean } = {}): Observable {
return from(this.api.nodesApi.deleteNode(nodeId, options));
}
@@ -101,13 +95,7 @@ export class ContentApiService {
const defaults = {
maxItems: this.preferences.paginationSize,
skipCount: 0,
- include: [
- 'isLocked',
- 'path',
- 'properties',
- 'allowableOperations',
- 'permissions'
- ]
+ include: ['isLocked', 'path', 'properties', 'allowableOperations', 'permissions']
};
const queryOptions = Object.assign(defaults, options);
@@ -140,10 +128,7 @@ export class ContentApiService {
* @param personId ID of the target user
* @returns User information
*/
- getPerson(
- personId: string,
- options?: { fields?: Array }
- ): Observable {
+ getPerson(personId: string, options?: { fields?: Array }): Observable {
return from(this.api.peopleApi.getPerson(personId, options));
}
@@ -154,15 +139,8 @@ export class ContentApiService {
* @param targetParentId The id of the folder-node where the node have to be copied to
* @param name The new name for the copy that would be added on the destination folder
*/
- copyNode(
- nodeId: string,
- targetParentId: string,
- name?: string,
- opts?: { include?: Array; fields?: Array }
- ): Observable {
- return from(
- this.api.nodesApi.copyNode(nodeId, { targetParentId, name }, opts)
- );
+ copyNode(nodeId: string, targetParentId: string, name?: string, opts?: { include?: Array; fields?: Array }): Observable {
+ return from(this.api.nodesApi.copyNode(nodeId, { targetParentId, name }, opts));
}
/**
@@ -170,9 +148,7 @@ export class ContentApiService {
* @returns ProductVersionModel containing product details
*/
getRepositoryInformation(): Observable {
- return from(
- this.api.getInstance().discovery.discoveryApi.getRepositoryInformation()
- );
+ return from(this.api.getInstance().discovery.discoveryApi.getRepositoryInformation());
}
getFavorites(
@@ -187,10 +163,7 @@ export class ContentApiService {
return from(this.api.favoritesApi.getFavorites(personId, opts));
}
- getFavoriteLibraries(
- personId: string = '-me-',
- opts?: any
- ): Observable {
+ getFavoriteLibraries(personId: string = '-me-', opts?: any): Observable {
return this.getFavorites(personId, {
...opts,
where: '(EXISTS(target/site))'
@@ -246,10 +219,7 @@ export class ContentApiService {
return from(this.api.sitesApi.createSite(siteBody, opts));
}
- getSite(
- siteId?: string,
- opts?: { relations?: Array; fields?: Array }
- ): Observable {
+ getSite(siteId?: string, opts?: { relations?: Array; fields?: Array }): Observable {
return from(this.api.sitesApi.getSite(siteId, opts));
}
@@ -258,7 +228,7 @@ export class ContentApiService {
}
addFavorite(nodes: Array): Observable {
- const payload: FavoriteBody[] = nodes.map(node => {
+ const payload: FavoriteBody[] = nodes.map((node) => {
const { isFolder, nodeId, id } = node.entry as any;
const siteId = node.entry['guid'];
const type = siteId ? 'site' : isFolder ? 'folder' : 'file';
diff --git a/projects/aca-shared/src/lib/services/node-permission.service.spec.ts b/projects/aca-shared/src/lib/services/node-permission.service.spec.ts
index 694d5cd91..a6592fb20 100644
--- a/projects/aca-shared/src/lib/services/node-permission.service.spec.ts
+++ b/projects/aca-shared/src/lib/services/node-permission.service.spec.ts
@@ -112,9 +112,7 @@ describe('NodePermissionService', () => {
}
];
- expect(
- permission.check(source, ['update', 'other'], { operation: 'AND' })
- ).toBe(true);
+ expect(permission.check(source, ['update', 'other'], { operation: 'AND' })).toBe(true);
});
it('should return false when source has no `AND` allowableOperations permission', () => {
@@ -128,27 +126,17 @@ describe('NodePermissionService', () => {
}
];
- expect(
- permission.check(source, ['update', 'bogus'], { operation: 'AND' })
- ).toBe(false);
+ expect(permission.check(source, ['update', 'bogus'], { operation: 'AND' })).toBe(false);
});
it('should return false when source has no allowableOperations', () => {
- const source = [
- { entry: { allowableOperations: [] } },
- { entry: { allowableOperations: [] } },
- { entry: { allowableOperations: ['update'] } }
- ];
+ const source = [{ entry: { allowableOperations: [] } }, { entry: { allowableOperations: [] } }, { entry: { allowableOperations: ['update'] } }];
expect(permission.check(source, ['update'])).toBe(false);
});
it('should return false when source has no allowableOperations property', () => {
- const source = [
- { entry: {} },
- { entry: {} },
- { entry: { allowableOperations: ['update'] } }
- ];
+ const source = [{ entry: {} }, { entry: {} }, { entry: { allowableOperations: ['update'] } }];
expect(permission.check(source, ['update'])).toBe(false);
});
@@ -196,9 +184,7 @@ describe('NodePermissionService', () => {
it('should return true when source has `AND` allowableOperations permission', () => {
const source = { entry: { allowableOperations: ['update', 'other'] } };
- expect(
- permission.check(source, ['update', 'other'], { operation: 'AND' })
- ).toBe(true);
+ expect(permission.check(source, ['update', 'other'], { operation: 'AND' })).toBe(true);
});
it('should return false when source has no `AND` allowableOperations permission', () => {
@@ -206,9 +192,7 @@ describe('NodePermissionService', () => {
entry: { allowableOperations: ['update', 'updatePermissions', 'other'] }
};
- expect(
- permission.check(source, ['update', 'bogus'], { operation: 'AND' })
- ).toBe(false);
+ expect(permission.check(source, ['update', 'bogus'], { operation: 'AND' })).toBe(false);
});
it('should return false when source has no allowableOperations', () => {
diff --git a/projects/aca-shared/src/lib/services/node-permission.service.ts b/projects/aca-shared/src/lib/services/node-permission.service.ts
index e20333b60..5c00e5c40 100644
--- a/projects/aca-shared/src/lib/services/node-permission.service.ts
+++ b/projects/aca-shared/src/lib/services/node-permission.service.ts
@@ -45,11 +45,7 @@ export class NodePermissionService implements NodePermissions {
target: null
};
- check(
- source: PermissionSource | PermissionSource[],
- permissions: string[],
- options?: PermissionOptions
- ): boolean {
+ check(source: PermissionSource | PermissionSource[], permissions: string[], options?: PermissionOptions): boolean {
const opts = Object.assign({}, this.defaultOptions, options || {});
if (!source) {
@@ -57,12 +53,10 @@ export class NodePermissionService implements NodePermissions {
}
if (Array.isArray(source)) {
- source = source.filter(item => item);
+ source = source.filter((item) => item);
if (source.length > 0) {
- return source.every(node =>
- this.isOperationAllowed(node, permissions, opts)
- );
+ return source.every((node) => this.isOperationAllowed(node, permissions, opts));
}
return false;
} else {
@@ -70,35 +64,21 @@ export class NodePermissionService implements NodePermissions {
}
}
- private isOperationAllowed(
- node: PermissionSource,
- permissions: string[],
- options: PermissionOptions
- ): boolean {
- const allowableOperations = this.getAllowableOperations(
- node,
- options.target
- );
+ private isOperationAllowed(node: PermissionSource, permissions: string[], options: PermissionOptions): boolean {
+ const allowableOperations = this.getAllowableOperations(node, options.target);
if (allowableOperations.length) {
if (options.operation === NodePermissionService.DEFAULT_OPERATION) {
- return permissions.some(permission =>
- allowableOperations.includes(permission)
- );
+ return permissions.some((permission) => allowableOperations.includes(permission));
} else {
- return permissions.every(permission =>
- allowableOperations.includes(permission)
- );
+ return permissions.every((permission) => allowableOperations.includes(permission));
}
}
return false;
}
- private getAllowableOperations(
- node: PermissionSource,
- property?: string
- ): string[] {
+ private getAllowableOperations(node: PermissionSource, property?: string): string[] {
let entry: Node | SharedLink;
if ('entry' in node) {
diff --git a/projects/aca-shared/src/lib/utils/node.utils.ts b/projects/aca-shared/src/lib/utils/node.utils.ts
index 0a473016c..41ce3cd0a 100644
--- a/projects/aca-shared/src/lib/utils/node.utils.ts
+++ b/projects/aca-shared/src/lib/utils/node.utils.ts
@@ -30,21 +30,12 @@ export function isLocked(node: { entry: Node }): boolean {
return (
(entry && entry.isLocked) ||
- (entry.properties &&
- (entry.properties['cm:lockType'] === 'READ_ONLY_LOCK' ||
- entry.properties['cm:lockType'] === 'WRITE_LOCK'))
+ (entry.properties && (entry.properties['cm:lockType'] === 'READ_ONLY_LOCK' || entry.properties['cm:lockType'] === 'WRITE_LOCK'))
);
}
export function isLibrary(node: { entry: Node | any }): boolean {
const { entry } = node;
- return (
- (entry.guid &&
- entry.id &&
- entry.preset &&
- entry.title &&
- entry.visibility) ||
- entry.nodeType === 'st:site'
- );
+ return (entry.guid && entry.id && entry.preset && entry.title && entry.visibility) || entry.nodeType === 'st:site';
}
diff --git a/projects/aca-shared/store/src/actions/metadata-aspect.actions.ts b/projects/aca-shared/store/src/actions/metadata-aspect.actions.ts
index 03c1d5934..60346340b 100644
--- a/projects/aca-shared/store/src/actions/metadata-aspect.actions.ts
+++ b/projects/aca-shared/store/src/actions/metadata-aspect.actions.ts
@@ -25,8 +25,7 @@
import { Action } from '@ngrx/store';
-export const SET_INFO_DRAWER_METADATA_ASPECT =
- 'SET_INFO_DRAWER_METADATA_ASPECT';
+export const SET_INFO_DRAWER_METADATA_ASPECT = 'SET_INFO_DRAWER_METADATA_ASPECT';
export class SetInfoDrawerMetadataAspectAction implements Action {
readonly type = SET_INFO_DRAWER_METADATA_ASPECT;
diff --git a/projects/aca-shared/store/src/actions/search.actions.ts b/projects/aca-shared/store/src/actions/search.actions.ts
index 19449af0e..2495340b9 100644
--- a/projects/aca-shared/store/src/actions/search.actions.ts
+++ b/projects/aca-shared/store/src/actions/search.actions.ts
@@ -35,10 +35,7 @@ export enum SearchActionTypes {
export class SearchByTermAction implements Action {
readonly type = SearchActionTypes.SearchByTerm;
- constructor(
- public payload: string,
- public searchOptions?: SearchOptionModel[]
- ) {}
+ constructor(public payload: string, public searchOptions?: SearchOptionModel[]) {}
}
export class ToggleSearchFilterAction implements Action {
diff --git a/projects/aca-shared/store/src/effects/dialog.effects.ts b/projects/aca-shared/store/src/effects/dialog.effects.ts
index f3c5ba48a..929d7884f 100644
--- a/projects/aca-shared/store/src/effects/dialog.effects.ts
+++ b/projects/aca-shared/store/src/effects/dialog.effects.ts
@@ -27,10 +27,7 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators';
import { MatDialog } from '@angular/material/dialog';
-import {
- CloseModalDialogsAction,
- AppActionTypes
-} from '../actions/app.actions';
+import { CloseModalDialogsAction, AppActionTypes } from '../actions/app.actions';
@Injectable()
export class DialogEffects {
diff --git a/projects/aca-shared/store/src/effects/router.effects.ts b/projects/aca-shared/store/src/effects/router.effects.ts
index b9c4a8da2..f654626d8 100644
--- a/projects/aca-shared/store/src/effects/router.effects.ts
+++ b/projects/aca-shared/store/src/effects/router.effects.ts
@@ -30,27 +30,17 @@ import { MinimalNodeEntryEntity, PathInfoEntity } from '@alfresco/js-api';
import { map } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { AppStore } from '../states/app.state';
-import {
- NavigateUrlAction,
- RouterActionTypes,
- NavigateRouteAction,
- NavigateToFolder,
- NavigateToParentFolder
-} from '../actions/router.actions';
+import { NavigateUrlAction, RouterActionTypes, NavigateRouteAction, NavigateToFolder, NavigateToParentFolder } from '../actions/router.actions';
import { SnackbarErrorAction } from '../actions/snackbar.actions';
@Injectable()
export class RouterEffects {
- constructor(
- private store: Store,
- private actions$: Actions,
- private router: Router
- ) {}
+ constructor(private store: Store, private actions$: Actions, private router: Router) {}
@Effect({ dispatch: false })
navigateUrl$ = this.actions$.pipe(
ofType(RouterActionTypes.NavigateUrl),
- map(action => {
+ map((action) => {
if (action.payload) {
this.router.navigateByUrl(action.payload);
}
@@ -60,7 +50,7 @@ export class RouterEffects {
@Effect({ dispatch: false })
navigateRoute$ = this.actions$.pipe(
ofType(RouterActionTypes.NavigateRoute),
- map(action => {
+ map((action) => {
this.router.navigate(action.payload);
})
);
@@ -68,7 +58,7 @@ export class RouterEffects {
@Effect({ dispatch: false })
navigateToFolder$ = this.actions$.pipe(
ofType(RouterActionTypes.NavigateFolder),
- map(action => {
+ map((action) => {
if (action.payload && action.payload.entry) {
this.navigateToFolder(action.payload.entry);
}
@@ -78,7 +68,7 @@ export class RouterEffects {
@Effect({ dispatch: false })
navigateToParentFolder$ = this.actions$.pipe(
ofType(RouterActionTypes.NavigateParentFolder),
- map(action => {
+ map((action) => {
if (action.payload && action.payload.entry) {
this.navigateToParentFolder(action.payload.entry);
}
@@ -131,18 +121,12 @@ export class RouterEffects {
this.router.navigate(link);
}, 10);
} else {
- this.store.dispatch(
- new SnackbarErrorAction('APP.MESSAGES.ERRORS.CANNOT_NAVIGATE_LOCATION')
- );
+ this.store.dispatch(new SnackbarErrorAction('APP.MESSAGES.ERRORS.CANNOT_NAVIGATE_LOCATION'));
}
}
private isLibraryContent(path: PathInfoEntity): boolean {
- if (
- path &&
- path.elements.length >= 2 &&
- path.elements[1].name === 'Sites'
- ) {
+ if (path && path.elements.length >= 2 && path.elements[1].name === 'Sites') {
return true;
}
diff --git a/projects/aca-shared/store/src/effects/snackbar.effects.ts b/projects/aca-shared/store/src/effects/snackbar.effects.ts
index 7e7c66144..4b3d1efee 100644
--- a/projects/aca-shared/store/src/effects/snackbar.effects.ts
+++ b/projects/aca-shared/store/src/effects/snackbar.effects.ts
@@ -30,13 +30,7 @@ import { Actions, Effect, ofType } from '@ngrx/effects';
import { Store } from '@ngrx/store';
import { map } from 'rxjs/operators';
import { AppStore } from '../states/app.state';
-import {
- SnackbarInfoAction,
- SnackbarActionTypes,
- SnackbarWarningAction,
- SnackbarErrorAction,
- SnackbarAction
-} from '../actions/snackbar.actions';
+import { SnackbarInfoAction, SnackbarActionTypes, SnackbarWarningAction, SnackbarErrorAction, SnackbarAction } from '../actions/snackbar.actions';
@Injectable()
export class SnackbarEffects {
diff --git a/projects/aca-shared/store/src/selectors/app.selectors.ts b/projects/aca-shared/store/src/selectors/app.selectors.ts
index cc080cab6..43e2d1ef8 100644
--- a/projects/aca-shared/store/src/selectors/app.selectors.ts
+++ b/projects/aca-shared/store/src/selectors/app.selectors.ts
@@ -28,80 +28,29 @@ import { createSelector } from '@ngrx/store';
export const selectApp = (state: AppStore) => state.app;
-export const getHeaderColor = createSelector(
- selectApp,
- state => state.headerColor
-);
+export const getHeaderColor = createSelector(selectApp, (state) => state.headerColor);
+export const getAppName = createSelector(selectApp, (state) => state.appName);
+export const getLogoPath = createSelector(selectApp, (state) => state.logoPath);
+export const getHeaderImagePath = createSelector(selectApp, (state) => state.headerImagePath);
+export const getLanguagePickerState = createSelector(selectApp, (state) => state.languagePicker);
+export const getUserProfile = createSelector(selectApp, (state) => state.user);
+export const getCurrentFolder = createSelector(selectApp, (state) => state.navigation.currentFolder);
+export const getAppSelection = createSelector(selectApp, (state) => state.selection);
+export const getSharedUrl = createSelector(selectApp, (state) => state.sharedUrl);
+export const getNavigationState = createSelector(selectApp, (state) => state.navigation);
+export const isInfoDrawerOpened = createSelector(selectApp, (state) => state.infoDrawerOpened);
+export const showFacetFilter = createSelector(selectApp, (state) => state.showFacetFilter);
+export const getDocumentDisplayMode = createSelector(selectApp, (state) => state.documentDisplayMode);
+export const getRepositoryStatus = createSelector(selectApp, (state) => state.repository);
+export const isQuickShareEnabled = createSelector(getRepositoryStatus, (info) => info.status.isQuickShareEnabled);
+export const isAdmin = createSelector(selectApp, (state) => state.user.isAdmin);
-export const getAppName = createSelector(selectApp, state => state.appName);
-export const getLogoPath = createSelector(selectApp, state => state.logoPath);
-
-export const getHeaderImagePath = createSelector(
- selectApp,
- state => state.headerImagePath
-);
-
-export const getLanguagePickerState = createSelector(
- selectApp,
- state => state.languagePicker
-);
-
-export const getUserProfile = createSelector(selectApp, state => state.user);
-
-export const getCurrentFolder = createSelector(
- selectApp,
- state => state.navigation.currentFolder
-);
-
-export const getAppSelection = createSelector(
- selectApp,
- state => state.selection
-);
-
-export const getSharedUrl = createSelector(selectApp, state => state.sharedUrl);
-
-export const getNavigationState = createSelector(
- selectApp,
- state => state.navigation
-);
-
-export const isInfoDrawerOpened = createSelector(
- selectApp,
- state => state.infoDrawerOpened
-);
-
-export const showFacetFilter = createSelector(
- selectApp,
- state => state.showFacetFilter
-);
-
-export const getDocumentDisplayMode = createSelector(
- selectApp,
- state => state.documentDisplayMode
-);
-
-export const getRepositoryStatus = createSelector(
- selectApp,
- state => state.repository
-);
-
-export const isQuickShareEnabled = createSelector(
- getRepositoryStatus,
- info => info.status.isQuickShareEnabled
-);
-
-export const isAdmin = createSelector(selectApp, state => state.user.isAdmin);
-
-export const getSideNavState = createSelector(
- getAppSelection,
- getNavigationState,
- (selection, navigation) => {
- return {
- selection,
- navigation
- };
- }
-);
+export const getSideNavState = createSelector(getAppSelection, getNavigationState, (selection, navigation) => {
+ return {
+ selection,
+ navigation
+ };
+});
export const getRuleContext = createSelector(
getAppSelection,
@@ -118,7 +67,4 @@ export const getRuleContext = createSelector(
}
);
-export const infoDrawerMetadataAspect = createSelector(
- selectApp,
- state => state.infoDrawerMetadataAspect
-);
+export const infoDrawerMetadataAspect = createSelector(selectApp, (state) => state.infoDrawerMetadataAspect);
diff --git a/projects/aca-shared/store/src/states/app.state.ts b/projects/aca-shared/store/src/states/app.state.ts
index 4579a9a2d..b90144ee0 100644
--- a/projects/aca-shared/store/src/states/app.state.ts
+++ b/projects/aca-shared/store/src/states/app.state.ts
@@ -23,11 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- SelectionState,
- ProfileState,
- NavigationState
-} from '@alfresco/adf-extensions';
+import { SelectionState, ProfileState, NavigationState } from '@alfresco/adf-extensions';
import { RepositoryInfo } from '@alfresco/js-api';
export interface AppState {
diff --git a/projects/aca-shared/store/src/store.module.ts b/projects/aca-shared/store/src/store.module.ts
index aabdac4e0..4d47baa44 100644
--- a/projects/aca-shared/store/src/store.module.ts
+++ b/projects/aca-shared/store/src/store.module.ts
@@ -30,8 +30,6 @@ import { DialogEffects } from './effects/dialog.effects';
import { RouterEffects } from './effects/router.effects';
@NgModule({
- imports: [
- EffectsModule.forFeature([SnackbarEffects, DialogEffects, RouterEffects])
- ]
+ imports: [EffectsModule.forFeature([SnackbarEffects, DialogEffects, RouterEffects])]
})
export class SharedStoreModule {}
diff --git a/projects/aca-shared/test.ts b/projects/aca-shared/test.ts
index bdee7e324..1b4b59913 100644
--- a/projects/aca-shared/test.ts
+++ b/projects/aca-shared/test.ts
@@ -28,18 +28,12 @@
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
-import {
- BrowserDynamicTestingModule,
- platformBrowserDynamicTesting
-} from '@angular/platform-browser-dynamic/testing';
+import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(
- BrowserDynamicTestingModule,
- platformBrowserDynamicTesting()
-);
+getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
diff --git a/projects/aca-testing-shared/src/components/breadcrumb/breadcrumb.ts b/projects/aca-testing-shared/src/components/breadcrumb/breadcrumb.ts
index 543f7a978..7d8f337b5 100755
--- a/projects/aca-testing-shared/src/components/breadcrumb/breadcrumb.ts
+++ b/projects/aca-testing-shared/src/components/breadcrumb/breadcrumb.ts
@@ -34,7 +34,7 @@ export class Breadcrumb extends Component {
}
async getAllItems(): Promise {
- const items: string[] = await this.items.map(async elem => {
+ const items: string[] = await this.items.map(async (elem) => {
const str = await elem.getText();
return str.split('\nchevron_right')[0];
});
diff --git a/projects/aca-testing-shared/src/components/breadcrumb/dropdown-breadcrumb.ts b/projects/aca-testing-shared/src/components/breadcrumb/dropdown-breadcrumb.ts
index a31740814..7b6fe15cd 100755
--- a/projects/aca-testing-shared/src/components/breadcrumb/dropdown-breadcrumb.ts
+++ b/projects/aca-testing-shared/src/components/breadcrumb/dropdown-breadcrumb.ts
@@ -39,17 +39,11 @@ export class DropDownBreadcrumb extends Component {
}
async waitForPathListDropdownToOpen(): Promise {
- return waitForPresence(
- this.pathItemsContainer,
- 'Timeout waiting for breadcrumb dropdown to open'
- );
+ return waitForPresence(this.pathItemsContainer, 'Timeout waiting for breadcrumb dropdown to open');
}
async waitForPathListDropdownToClose(): Promise {
- return waitForStaleness(
- browser.$(this.pathOptionCss),
- 'Timeout waiting for breadcrumb dropdown to close'
- );
+ return waitForStaleness(browser.$(this.pathOptionCss), 'Timeout waiting for breadcrumb dropdown to close');
}
async openPath(): Promise {
@@ -58,14 +52,12 @@ export class DropDownBreadcrumb extends Component {
}
async clickPathItem(name: string): Promise {
- const elem = browser.element(
- by.cssContainingText(this.pathOptionCss, name)
- );
+ const elem = browser.element(by.cssContainingText(this.pathOptionCss, name));
await elem.click();
}
async getPathItems(): Promise {
- const items: string[] = await this.pathItems.map(async elem => {
+ const items: string[] = await this.pathItems.map(async (elem) => {
return elem.getText();
});
return items;
diff --git a/projects/aca-testing-shared/src/components/component.ts b/projects/aca-testing-shared/src/components/component.ts
index 05727340a..8d803a94f 100755
--- a/projects/aca-testing-shared/src/components/component.ts
+++ b/projects/aca-testing-shared/src/components/component.ts
@@ -23,57 +23,32 @@
* along with Alfresco. If not, see .
*/
-import {
- ElementFinder,
- browser,
- by,
- ElementArrayFinder,
- ProtractorBrowser
-} from 'protractor';
+import { ElementFinder, browser, by, ElementArrayFinder, ProtractorBrowser } from 'protractor';
import { waitForPresence } from '../utilities/utils';
export abstract class Component {
component: ElementFinder;
- protected byCss(
- css: string,
- root: ElementFinder | ProtractorBrowser = this.component
- ): ElementFinder {
+ protected byCss(css: string, root: ElementFinder | ProtractorBrowser = this.component): ElementFinder {
return root.element(by.css(css));
}
- protected byCssText(
- css: string,
- text: string,
- root: ElementFinder | ProtractorBrowser = this.component
- ): ElementFinder {
+ protected byCssText(css: string, text: string, root: ElementFinder | ProtractorBrowser = this.component): ElementFinder {
return root.element(by.cssContainingText(css, text));
}
- protected byId(
- css: string,
- root: ElementFinder | ProtractorBrowser = this.component
- ): ElementFinder {
+ protected byId(css: string, root: ElementFinder | ProtractorBrowser = this.component): ElementFinder {
return root.element(by.id(css));
}
- protected allByCss(
- css: string,
- root: ElementFinder | ProtractorBrowser = this.component
- ): ElementArrayFinder {
+ protected allByCss(css: string, root: ElementFinder | ProtractorBrowser = this.component): ElementArrayFinder {
return root.all(by.css(css));
}
constructor(selector: string, ancestor?: string) {
const locator = selector;
- this.component = ancestor
- ? browser
- .$$(ancestor)
- .first()
- .$$(locator)
- .first()
- : browser.$$(locator).first();
+ this.component = ancestor ? browser.$$(ancestor).first().$$(locator).first() : browser.$$(locator).first();
}
async wait() {
diff --git a/projects/aca-testing-shared/src/components/data-table/data-table.ts b/projects/aca-testing-shared/src/components/data-table/data-table.ts
index f427da562..e44d8dbed 100755
--- a/projects/aca-testing-shared/src/components/data-table/data-table.ts
+++ b/projects/aca-testing-shared/src/components/data-table/data-table.ts
@@ -23,27 +23,16 @@
* along with Alfresco. If not, see .
*/
-import {
- ElementFinder,
- ElementArrayFinder,
- by,
- browser,
- protractor
-} from 'protractor';
+import { ElementFinder, ElementArrayFinder, by, browser, protractor } from 'protractor';
import { Logger } from '@alfresco/adf-testing';
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
import { Component } from '../component';
import { Menu } from '../menu/menu';
-import {
- Utils,
- waitForPresence,
- waitForClickable
-} from '../../utilities/utils';
+import { Utils, waitForPresence, waitForClickable } from '../../utilities/utils';
export class DataTable extends Component {
private static selectors = {
- columnHeader:
- '.adf-datatable-row .adf-datatable-cell-header .adf-datatable-cell-value',
+ columnHeader: '.adf-datatable-row .adf-datatable-cell-header .adf-datatable-cell-value',
sortedColumnHeader: `
.adf-datatable__header--sorted-asc .adf-datatable-cell-value,
.adf-datatable__header--sorted-desc .adf-datatable-cell-value
@@ -58,9 +47,7 @@ export class DataTable extends Component {
head = this.byCss('.adf-datatable-header');
body = this.byCss('.adf-datatable-body');
emptyList = this.byCss('div.adf-no-content-container');
- emptyFolderDragAndDrop = this.byCss(
- '.adf-empty-list_template .adf-empty-folder'
- );
+ emptyFolderDragAndDrop = this.byCss('.adf-empty-list_template .adf-empty-folder');
emptyListTitle = this.byCss('.adf-empty-content__title');
emptyListSubtitle = this.byCss('.adf-empty-content__subtitle');
emptySearchText = this.byCss('.empty-search__text');
@@ -94,10 +81,7 @@ export class DataTable extends Component {
}
getColumnHeaderByLabel(label: string): ElementFinder {
- const locator = by.cssContainingText(
- DataTable.selectors.columnHeader,
- label
- );
+ const locator = by.cssContainingText(DataTable.selectors.columnHeader, label);
return this.head.element(locator);
}
@@ -111,9 +95,7 @@ export class DataTable extends Component {
}
async getSortingOrder(): Promise {
- const str = await this.getSortedColumnHeader()
- .element(by.xpath('..'))
- .getAttribute('class');
+ const str = await this.getSortedColumnHeader().element(by.xpath('..')).getAttribute('class');
if (str.includes('asc')) {
return 'asc';
}
@@ -138,7 +120,7 @@ export class DataTable extends Component {
}
async getSelectedRowsNames(): Promise {
- const rowsText: string[] = await this.getSelectedRows().map(row => {
+ const rowsText: string[] = await this.getSelectedRows().map((row) => {
return row.element(by.css('.adf-datatable-cell[title="Name"]')).getText();
});
return rowsText;
@@ -152,24 +134,14 @@ export class DataTable extends Component {
if (location) {
return this.body
.all(by.cssContainingText(DataTable.selectors.row, name))
- .filter(async elem =>
- browser.isElementPresent(
- elem.element(
- by.cssContainingText(DataTable.selectors.cell, location)
- )
- )
- )
+ .filter(async (elem) => browser.isElementPresent(elem.element(by.cssContainingText(DataTable.selectors.cell, location))))
.first();
}
- return this.body.element(
- by.cssContainingText(DataTable.selectors.row, name)
- );
+ return this.body.element(by.cssContainingText(DataTable.selectors.row, name));
}
getRowCells(name: string, location: string = ''): ElementArrayFinder {
- return this.getRowByName(name, location).all(
- by.css(DataTable.selectors.cell)
- );
+ return this.getRowByName(name, location).all(by.css(DataTable.selectors.cell));
}
async getRowCellsCount(itemName: string): Promise {
@@ -184,24 +156,15 @@ export class DataTable extends Component {
return this.getRowCells(name, location).get(1);
}
- private getRowNameCellSpan(
- name: string,
- location: string = ''
- ): ElementFinder {
+ private getRowNameCellSpan(name: string, location: string = ''): ElementFinder {
return this.getRowNameCell(name, location).$('span');
}
- async getItemNameTooltip(
- name: string,
- location: string = ''
- ): Promise {
+ async getItemNameTooltip(name: string, location: string = ''): Promise {
return this.getRowNameCellSpan(name, location).getAttribute('title');
}
- async hasCheckMarkIcon(
- itemName: string,
- location: string = ''
- ): Promise {
+ async hasCheckMarkIcon(itemName: string, location: string = ''): Promise {
const row = this.getRowByName(itemName, location);
return row.element(by.css('.mat-icon[class*="selected"]')).isPresent();
}
@@ -211,10 +174,7 @@ export class DataTable extends Component {
return row.element(by.css('img[src*="lock"]')).isPresent();
}
- private async hasLockOwnerInfo(
- itemName: string,
- location: string = ''
- ): Promise {
+ private async hasLockOwnerInfo(itemName: string, location: string = ''): Promise {
const row = this.getRowByName(itemName, location);
return row.element(by.css(DataTable.selectors.lockOwner)).isPresent();
}
@@ -222,10 +182,7 @@ export class DataTable extends Component {
async getLockOwner(itemName: string, location: string = ''): Promise {
if (await this.hasLockOwnerInfo(itemName, location)) {
const row = this.getRowByName(itemName, location);
- return row
- .$(DataTable.selectors.lockOwner)
- .$('.locked_by--name')
- .getText();
+ return row.$(DataTable.selectors.lockOwner).$('.locked_by--name').getText();
}
return '';
}
@@ -238,21 +195,12 @@ export class DataTable extends Component {
return this.getNameLink(itemName).isPresent();
}
- async doubleClickOnRowByName(
- name: string,
- location: string = ''
- ): Promise {
+ async doubleClickOnRowByName(name: string, location: string = ''): Promise {
try {
const item = this.getRowFirstCell(name, location);
await waitForClickable(item);
- await browser
- .actions()
- .mouseMove(item)
- .perform();
- await browser
- .actions()
- .doubleClick()
- .perform();
+ await browser.actions().mouseMove(item).perform();
+ await browser.actions().doubleClick().perform();
} catch (error) {
Logger.error('--- catch: doubleClickOnRowByName', error);
}
@@ -291,10 +239,7 @@ export class DataTable extends Component {
await this.getNameLink(itemName).click();
}
- async selectMultipleItems(
- names: string[],
- location: string = ''
- ): Promise {
+ async selectMultipleItems(names: string[], location: string = ''): Promise {
await this.clearSelection();
await Utils.pressCmd();
for (const name of names) {
@@ -317,26 +262,14 @@ export class DataTable extends Component {
async rightClickOnItem(itemName: string): Promise {
const item = this.getRowFirstCell(itemName);
- await browser
- .actions()
- .mouseMove(item)
- .perform();
- await browser
- .actions()
- .click(protractor.Button.RIGHT)
- .perform();
+ await browser.actions().mouseMove(item).perform();
+ await browser.actions().click(protractor.Button.RIGHT).perform();
}
async rightClickOnMultipleSelection(): Promise {
const itemFromSelection = this.getSelectedRows().get(0);
- await browser
- .actions()
- .mouseMove(itemFromSelection)
- .perform();
- await browser
- .actions()
- .click(protractor.Button.RIGHT)
- .perform();
+ await browser.actions().mouseMove(itemFromSelection).perform();
+ await browser.actions().click(protractor.Button.RIGHT).perform();
}
private getItemLocationEl(name: string): ElementFinder {
@@ -349,13 +282,9 @@ export class DataTable extends Component {
async getItemLocationTooltip(name: string): Promise {
const location = this.getItemLocationEl(name).$('a');
- const condition = () =>
- location.getAttribute('title').then(value => value && value.length > 0);
+ const condition = () => location.getAttribute('title').then((value) => value && value.length > 0);
- await browser
- .actions()
- .mouseMove(location)
- .perform();
+ await browser.actions().mouseMove(location).perform();
await browser.wait(condition, BROWSER_WAIT_TIMEOUT);
return location.getAttribute('title');
@@ -402,10 +331,8 @@ export class DataTable extends Component {
}
async getCellsContainingName(name: string): Promise {
- const rows = this.getRows().all(
- by.cssContainingText(DataTable.selectors.cell, name)
- );
- const cellsText: string[] = await rows.map(async cell => {
+ const rows = this.getRows().all(by.cssContainingText(DataTable.selectors.cell, name));
+ const cellsText: string[] = await rows.map(async (cell) => {
return cell.getText();
});
return cellsText;
@@ -417,9 +344,7 @@ export class DataTable extends Component {
}
async getLibraryRole(name: string): Promise {
- return this.getRowByName(name)
- .element(by.css('adf-library-role-column'))
- .getText();
+ return this.getRowByName(name).element(by.css('adf-library-role-column')).getText();
}
async isItemPresent(name: string, location?: string): Promise {
@@ -427,25 +352,25 @@ export class DataTable extends Component {
}
private async getEntireDataTableText(): Promise {
- const text: string[] = await this.getRows().map(row => {
- return row.all(by.css(DataTable.selectors.cell)).map(async cell => {
+ const text: string[] = await this.getRows().map((row) => {
+ return row.all(by.css(DataTable.selectors.cell)).map(async (cell) => {
return cell.getText();
});
});
return text;
}
- async getSitesNameAndVisibility(): Promise<{}> {
- const data = await this.getEntireDataTableText();
- return data.reduce((acc, cell) => {
+ async getSitesNameAndVisibility(): Promise {
+ const data: string[] = await this.getEntireDataTableText();
+ return data.reduce((acc: any, cell) => {
acc[cell[1]] = cell[4].toUpperCase();
return acc;
}, {});
}
- async getSitesNameAndRole(): Promise<{}> {
- const data = await this.getEntireDataTableText();
- return data.reduce((acc, cell) => {
+ async getSitesNameAndRole(): Promise {
+ const data: string[] = await this.getEntireDataTableText();
+ return data.reduce((acc: any, cell) => {
acc[cell[1]] = cell[3];
return acc;
}, {});
@@ -459,100 +384,53 @@ export class DataTable extends Component {
return this.getSearchResultsRows().get(nth - 1);
}
- private getSearchResultsRowByName(
- name: string,
- location: string = ''
- ): ElementFinder {
+ private getSearchResultsRowByName(name: string, location: string = ''): ElementFinder {
if (location) {
return this.body
.all(by.cssContainingText(DataTable.selectors.searchResultsRow, name))
- .filter(async elem =>
- browser.isElementPresent(
- elem.element(
- by.cssContainingText(
- DataTable.selectors.searchResultsRowLine,
- location
- )
- )
- )
- )
+ .filter(async (elem) => browser.isElementPresent(elem.element(by.cssContainingText(DataTable.selectors.searchResultsRowLine, location))))
.first();
}
- return this.body.element(
- by.cssContainingText(DataTable.selectors.searchResultsRow, name)
- );
+ return this.body.element(by.cssContainingText(DataTable.selectors.searchResultsRow, name));
}
- private getSearchResultRowLines(
- name: string,
- location: string = ''
- ): ElementArrayFinder {
- return this.getSearchResultsRowByName(name, location).all(
- by.css(DataTable.selectors.searchResultsRowLine)
- );
+ private getSearchResultRowLines(name: string, location: string = ''): ElementArrayFinder {
+ return this.getSearchResultsRowByName(name, location).all(by.css(DataTable.selectors.searchResultsRowLine));
}
- async getSearchResultLinesCount(
- name: string,
- location: string = ''
- ): Promise {
+ async getSearchResultLinesCount(name: string, location: string = ''): Promise {
return this.getSearchResultRowLines(name, location).count();
}
- private getSearchResultNthLine(
- name: string,
- location: string = '',
- index: number
- ): ElementFinder {
+ private getSearchResultNthLine(name: string, location: string = '', index: number): ElementFinder {
return this.getSearchResultRowLines(name, location).get(index);
}
- async getSearchResultNameAndTitle(
- name: string,
- location: string = ''
- ): Promise {
+ async getSearchResultNameAndTitle(name: string, location: string = ''): Promise {
return this.getSearchResultNthLine(name, location, 0).getText();
}
- async getSearchResultDescription(
- name: string,
- location: string = ''
- ): Promise {
+ async getSearchResultDescription(name: string, location: string = ''): Promise {
return this.getSearchResultNthLine(name, location, 1).getText();
}
- async getSearchResultModified(
- name: string,
- location: string = ''
- ): Promise {
+ async getSearchResultModified(name: string, location: string = ''): Promise {
return this.getSearchResultNthLine(name, location, 2).getText();
}
- async getSearchResultLocation(
- name: string,
- location: string = ''
- ): Promise {
+ async getSearchResultLocation(name: string, location: string = ''): Promise {
return this.getSearchResultNthLine(name, location, 3).getText();
}
- private getSearchResultNameLink(
- itemName: string,
- location: string = ''
- ): ElementFinder {
+ private getSearchResultNameLink(itemName: string, location: string = ''): ElementFinder {
return this.getSearchResultsRowByName(itemName, location).$('.link');
}
- async hasLinkOnSearchResultName(
- itemName: string,
- location: string = ''
- ): Promise {
+ async hasLinkOnSearchResultName(itemName: string, location: string = ''): Promise {
return this.getSearchResultNameLink(itemName, location).isPresent();
}
- async clickSearchResultNameLink(
- itemName: string,
- location: string = ''
- ): Promise {
+ async clickSearchResultNameLink(itemName: string, location: string = ''): Promise {
await this.getSearchResultNameLink(itemName, location).click();
}
}
diff --git a/projects/aca-testing-shared/src/components/datetime-picker/datetime-picker.ts b/projects/aca-testing-shared/src/components/datetime-picker/datetime-picker.ts
index 6f7b68400..a4d9ac2c0 100755
--- a/projects/aca-testing-shared/src/components/datetime-picker/datetime-picker.ts
+++ b/projects/aca-testing-shared/src/components/datetime-picker/datetime-picker.ts
@@ -25,8 +25,8 @@
import { by, browser } from 'protractor';
import { Component } from '../component';
-import * as moment from 'moment';
import { isPresentAndDisplayed, waitForStaleness } from '../../utilities/utils';
+const moment = require('moment');
export class DateTimePicker extends Component {
calendar = this.byCss('.mat-datetimepicker-popup', browser);
@@ -55,11 +55,8 @@ export class DateTimePicker extends Component {
const dayOfTomorrow = tomorrow.date();
const date = await this.headerDate.getText();
const year = await this.headerYear.getText();
- const firstActiveDay =
- '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content';
- const elem = this.dayPicker.element(
- by.cssContainingText(firstActiveDay, `${dayOfTomorrow}`)
- );
+ const firstActiveDay = '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content';
+ const elem = this.dayPicker.element(by.cssContainingText(firstActiveDay, `${dayOfTomorrow}`));
await elem.click();
return `${date} ${year}`;
}
diff --git a/projects/aca-testing-shared/src/components/dialog/content-node-selector-dialog.ts b/projects/aca-testing-shared/src/components/dialog/content-node-selector-dialog.ts
index 535fe04b7..8da8982f7 100755
--- a/projects/aca-testing-shared/src/components/dialog/content-node-selector-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/content-node-selector-dialog.ts
@@ -25,41 +25,18 @@
import { by, browser, protractor } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog';
-import {
- Utils,
- isPresentAndDisplayed,
- waitForStaleness,
- waitForPresence,
- isPresentAndEnabled,
- waitForClickable
-} from '../../utilities/utils';
+import { Utils, isPresentAndDisplayed, waitForStaleness, waitForPresence, isPresentAndEnabled, waitForClickable } from '../../utilities/utils';
import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb';
import { DataTable } from '../data-table/data-table';
export class ContentNodeSelectorDialog extends GenericDialog {
- cancelButton = this.childElement(
- by.css('[data-automation-id="content-node-selector-actions-cancel"]')
- );
- copyButton = this.childElement(
- by.cssContainingText(
- '[data-automation-id="content-node-selector-actions-choose"]',
- 'Copy'
- )
- );
- moveButton = this.childElement(
- by.cssContainingText(
- '[data-automation-id="content-node-selector-actions-choose"]',
- 'Move'
- )
- );
+ cancelButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-cancel"]'));
+ copyButton = this.childElement(by.cssContainingText('[data-automation-id="content-node-selector-actions-choose"]', 'Copy'));
+ moveButton = this.childElement(by.cssContainingText('[data-automation-id="content-node-selector-actions-choose"]', 'Move'));
locationDropDown = this.rootElem.element(by.id('site-dropdown-container'));
- locationPersonalFiles = browser.element(
- by.cssContainingText('.mat-option .mat-option-text', 'Personal Files')
- );
- locationFileLibraries = browser.element(
- by.cssContainingText('.mat-option .mat-option-text', 'My Libraries')
- );
+ locationPersonalFiles = browser.element(by.cssContainingText('.mat-option .mat-option-text', 'Personal Files'));
+ locationFileLibraries = browser.element(by.cssContainingText('.mat-option .mat-option-text', 'My Libraries'));
searchInput = this.rootElem.element(by.css('#searchInput'));
toolbarTitle = this.rootElem.element(by.css('.adf-toolbar-title'));
diff --git a/projects/aca-testing-shared/src/components/dialog/create-edit-folder-dialog.ts b/projects/aca-testing-shared/src/components/dialog/create-edit-folder-dialog.ts
index 32cab4b6f..cb381472c 100755
--- a/projects/aca-testing-shared/src/components/dialog/create-edit-folder-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/create-edit-folder-dialog.ts
@@ -25,26 +25,15 @@
import { by } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog';
-import {
- isPresentAndDisplayed,
- waitForClickable,
- isPresentAndEnabled,
- typeText
-} from '../../utilities/utils';
+import { isPresentAndDisplayed, waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils';
export class CreateOrEditFolderDialog extends GenericDialog {
- createButton = this.childElement(
- by.cssContainingText('.mat-dialog-actions button', 'Create')
- );
+ createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
cancelButton = this.childElement(by.id('adf-folder-cancel-button'));
- updateButton = this.childElement(
- by.cssContainingText('.mat-dialog-actions button', 'Update')
- );
+ updateButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Update'));
nameInput = this.rootElem.element(by.css('input[placeholder="Name" i]'));
- descriptionTextArea = this.rootElem.element(
- by.css('textarea[placeholder="Description" i]')
- );
+ descriptionTextArea = this.rootElem.element(by.css('textarea[placeholder="Description" i]'));
validationMessage = this.rootElem.element(by.css('.mat-hint span'));
constructor() {
diff --git a/projects/aca-testing-shared/src/components/dialog/create-from-template-dialog.ts b/projects/aca-testing-shared/src/components/dialog/create-from-template-dialog.ts
index 1b7a6f2e6..ca838c669 100755
--- a/projects/aca-testing-shared/src/components/dialog/create-from-template-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/create-from-template-dialog.ts
@@ -25,25 +25,15 @@
import { by } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog';
-import {
- isPresentAndDisplayed,
- isPresentAndEnabled,
- typeText
-} from '../../utilities/utils';
+import { isPresentAndDisplayed, isPresentAndEnabled, typeText } from '../../utilities/utils';
export class CreateFromTemplateDialog extends GenericDialog {
- createButton = this.childElement(
- by.cssContainingText('.mat-dialog-actions button', 'Create')
- );
- cancelButton = this.childElement(
- by.cssContainingText('.mat-dialog-actions button', 'CANCEL')
- );
+ createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
+ cancelButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'CANCEL'));
nameInput = this.childElement(by.css('input[placeholder="Name" i]'));
titleInput = this.childElement(by.css('input[placeholder="Title" i]'));
- descriptionTextArea = this.childElement(
- by.css('textarea[placeholder="Description" i]')
- );
+ descriptionTextArea = this.childElement(by.css('textarea[placeholder="Description" i]'));
validationMessage = this.childElement(by.css('.mat-error'));
constructor() {
diff --git a/projects/aca-testing-shared/src/components/dialog/create-library-dialog.ts b/projects/aca-testing-shared/src/components/dialog/create-library-dialog.ts
index 8b9e5c77b..4a235759a 100755
--- a/projects/aca-testing-shared/src/components/dialog/create-library-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/create-library-dialog.ts
@@ -25,36 +25,18 @@
import { by, ElementFinder } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog';
-import {
- waitForClickable,
- isPresentAndEnabled,
- typeText
-} from '../../utilities/utils';
+import { waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils';
export class CreateLibraryDialog extends GenericDialog {
- createButton = this.childElement(
- by.cssContainingText('.mat-dialog-actions button', 'Create')
- );
- cancelButton = this.childElement(
- by.cssContainingText('.mat-dialog-actions button', 'Cancel')
- );
+ createButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Create'));
+ cancelButton = this.childElement(by.cssContainingText('.mat-dialog-actions button', 'Cancel'));
nameInput = this.rootElem.element(by.css('input[placeholder="Name" i]'));
- libraryIdInput = this.rootElem.element(
- by.css('input[placeholder="Library ID" i]')
- );
- descriptionTextArea = this.rootElem.element(
- by.css('textarea[placeholder="Description" i]')
- );
- visibilityPublic = this.rootElem.element(
- by.cssContainingText('.mat-radio-label', 'Public')
- );
- visibilityModerated = this.rootElem.element(
- by.cssContainingText('.mat-radio-label', 'Moderated')
- );
- visibilityPrivate = this.rootElem.element(
- by.cssContainingText('.mat-radio-label', 'Private')
- );
+ libraryIdInput = this.rootElem.element(by.css('input[placeholder="Library ID" i]'));
+ descriptionTextArea = this.rootElem.element(by.css('textarea[placeholder="Description" i]'));
+ visibilityPublic = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Public'));
+ visibilityModerated = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Moderated'));
+ visibilityPrivate = this.rootElem.element(by.cssContainingText('.mat-radio-label', 'Private'));
errorMessage = this.rootElem.element(by.css('.mat-error'));
@@ -100,9 +82,7 @@ export class CreateLibraryDialog extends GenericDialog {
}
private async isChecked(target: ElementFinder): Promise {
- const elemClass = await target
- .element(by.xpath('..'))
- .getAttribute('class');
+ const elemClass = await target.element(by.xpath('..')).getAttribute('class');
return elemClass.includes('mat-radio-checked');
}
diff --git a/projects/aca-testing-shared/src/components/dialog/generic-dialog.ts b/projects/aca-testing-shared/src/components/dialog/generic-dialog.ts
index 65d0c9579..ed2f8151a 100644
--- a/projects/aca-testing-shared/src/components/dialog/generic-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/generic-dialog.ts
@@ -24,12 +24,7 @@
*/
import { ElementFinder, by, browser, Locator } from 'protractor';
-import {
- isPresentAndDisplayed,
- waitForPresence,
- waitForVisibility,
- waitForStaleness
-} from '../../utilities/utils';
+import { isPresentAndDisplayed, waitForPresence, waitForVisibility, waitForStaleness } from '../../utilities/utils';
export abstract class GenericDialog {
constructor(private rootCssSelector?: string) {}
diff --git a/projects/aca-testing-shared/src/components/dialog/password-dialog.ts b/projects/aca-testing-shared/src/components/dialog/password-dialog.ts
index b06c81cc1..f776c8546 100755
--- a/projects/aca-testing-shared/src/components/dialog/password-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/password-dialog.ts
@@ -25,19 +25,11 @@
import { by, browser } from 'protractor';
import { GenericDialog } from '../dialog/generic-dialog';
-import {
- waitForClickable,
- isPresentAndEnabled,
- typeText
-} from '../../utilities/utils';
+import { waitForClickable, isPresentAndEnabled, typeText } from '../../utilities/utils';
export class PasswordDialog extends GenericDialog {
- closeButton = this.childElement(
- by.css('[data-automation-id="adf-password-dialog-close"]')
- );
- submitButton = this.childElement(
- by.css('[data-automation-id="adf-password-dialog-submit"]')
- );
+ closeButton = this.childElement(by.css('[data-automation-id="adf-password-dialog-close"]'));
+ submitButton = this.childElement(by.css('[data-automation-id="adf-password-dialog-submit"]'));
passwordInput = this.childElement(by.css('input[type="Password"]'));
errorMessage = this.childElement(by.css('.mat-error'));
@@ -79,10 +71,7 @@ export class PasswordDialog extends GenericDialog {
async isErrorDisplayed(): Promise {
try {
await this.waitForDialogToOpen();
- return (
- (await this.errorMessage.isPresent()) &&
- (await this.errorMessage.isDisplayed())
- );
+ return (await this.errorMessage.isPresent()) && (await this.errorMessage.isDisplayed());
} catch (error) {
return false;
}
diff --git a/projects/aca-testing-shared/src/components/dialog/select-template-dialog.ts b/projects/aca-testing-shared/src/components/dialog/select-template-dialog.ts
index 2a3628e7c..ddf6f6d91 100755
--- a/projects/aca-testing-shared/src/components/dialog/select-template-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/select-template-dialog.ts
@@ -30,13 +30,8 @@ import { DataTable } from '../data-table/data-table';
import { isPresentAndEnabled } from '../../utilities/utils';
export class SelectTemplateDialog extends GenericDialog {
- nextButton = this.childElement(
- by.css('[data-automation-id="content-node-selector-actions-choose"]')
- );
-
- cancelButton = this.childElement(
- by.css('[data-automation-id="content-node-selector-actions-cancel"]')
- );
+ nextButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-choose"]'));
+ cancelButton = this.childElement(by.css('[data-automation-id="content-node-selector-actions-cancel"]'));
breadcrumb = new DropDownBreadcrumb();
dataTable = new DataTable('.aca-template-node-selector-dialog');
diff --git a/projects/aca-testing-shared/src/components/dialog/share-dialog.ts b/projects/aca-testing-shared/src/components/dialog/share-dialog.ts
index 69057b5cb..f438b02ab 100755
--- a/projects/aca-testing-shared/src/components/dialog/share-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/share-dialog.ts
@@ -31,27 +31,17 @@ import { isPresentAndEnabled } from '../../utilities/utils';
export class ShareDialog extends GenericDialog {
dateTimePicker = new DateTimePicker();
- dialogTitle = this.childElement(
- by.css(`[data-automation-id='adf-share-dialog-title']`)
- );
+ dialogTitle = this.childElement(by.css(`[data-automation-id='adf-share-dialog-title']`));
infoText = this.childElement(by.css('.adf-share-link__info'));
labels = this.rootElem.all(by.css('.adf-share-link__label'));
- shareToggle = this.childElement(
- by.css(`[data-automation-id='adf-share-toggle']`)
- );
+ shareToggle = this.childElement(by.css(`[data-automation-id='adf-share-toggle']`));
url = this.childElement(by.css(`[data-automation-id='adf-share-link']`));
urlAction = this.childElement(by.css('.adf-input-action'));
- expireToggle = this.childElement(
- by.css(`[data-automation-id='adf-expire-toggle']`)
- );
+ expireToggle = this.childElement(by.css(`[data-automation-id='adf-expire-toggle']`));
expireInput = this.childElement(by.css('input[formcontrolname="time"]'));
- datetimePickerButton = this.childElement(
- by.css('.mat-datetimepicker-toggle')
- );
+ datetimePickerButton = this.childElement(by.css('.mat-datetimepicker-toggle'));
- closeButton = this.childElement(
- by.css(`[data-automation-id='adf-share-dialog-close']`)
- );
+ closeButton = this.childElement(by.css(`[data-automation-id='adf-share-dialog-close']`));
constructor() {
super('.adf-share-dialog');
diff --git a/projects/aca-testing-shared/src/components/dialog/upload-new-version-dialog.ts b/projects/aca-testing-shared/src/components/dialog/upload-new-version-dialog.ts
index 966ed7eea..bbe9cf206 100755
--- a/projects/aca-testing-shared/src/components/dialog/upload-new-version-dialog.ts
+++ b/projects/aca-testing-shared/src/components/dialog/upload-new-version-dialog.ts
@@ -28,18 +28,10 @@ import { GenericDialog } from '../dialog/generic-dialog';
import { isPresentAndEnabled, typeText } from '../../utilities/utils';
export class UploadNewVersionDialog extends GenericDialog {
- cancelButton = this.childElement(
- by.cssContainingText('.mat-button-wrapper', 'Cancel')
- );
- uploadButton = this.childElement(
- by.cssContainingText('.mat-button-wrapper', 'Upload')
- );
- majorOption = this.childElement(
- by.cssContainingText(`.mat-radio-label`, 'major')
- );
- minorOption = this.childElement(
- by.cssContainingText(`.mat-radio-label`, 'minor')
- );
+ cancelButton = this.childElement(by.cssContainingText('.mat-button-wrapper', 'Cancel'));
+ uploadButton = this.childElement(by.cssContainingText('.mat-button-wrapper', 'Upload'));
+ majorOption = this.childElement(by.cssContainingText(`.mat-radio-label`, 'major'));
+ minorOption = this.childElement(by.cssContainingText(`.mat-radio-label`, 'minor'));
description = this.childElement(by.css('textarea'));
constructor() {
diff --git a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-comments-tab.ts b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-comments-tab.ts
index 3b2175c77..77de76631 100755
--- a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-comments-tab.ts
+++ b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-comments-tab.ts
@@ -64,18 +64,12 @@ export class CommentsTab extends Component {
}
private async getCommentListItem() {
- return browser.wait(
- until.elementLocated(this.commentListItem),
- BROWSER_WAIT_TIMEOUT / 2
- );
+ return browser.wait(until.elementLocated(this.commentListItem), BROWSER_WAIT_TIMEOUT / 2);
}
async getCommentById(commentId?: string) {
if (commentId) {
- return browser.wait(
- until.elementLocated(by.id(`adf-comment-${commentId}`)),
- BROWSER_WAIT_TIMEOUT / 2
- );
+ return browser.wait(until.elementLocated(by.id(`adf-comment-${commentId}`)), BROWSER_WAIT_TIMEOUT / 2);
}
return this.getCommentListItem();
}
@@ -86,9 +80,7 @@ export class CommentsTab extends Component {
async isCommentUserAvatarDisplayed(commentId?: string) {
const commentElement = await this.getCommentById(commentId);
- return browser.isElementPresent(
- commentElement.findElement(this.commentUserAvatar)
- );
+ return browser.isElementPresent(commentElement.findElement(this.commentUserAvatar));
}
async getCommentText(commentId?: string) {
diff --git a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts
index cec131238..ba7279647 100755
--- a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts
+++ b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts
@@ -25,11 +25,7 @@
import { by, browser, ElementFinder } from 'protractor';
import { Component } from '../component';
-import {
- isPresentAndEnabled,
- isPresentAndDisplayed,
- waitForVisibility
-} from '../../utilities/utils';
+import { isPresentAndEnabled, isPresentAndDisplayed, waitForVisibility } from '../../utilities/utils';
export class ContentMetadata extends Component {
expandedPanel = this.byCss('.mat-expansion-panel.mat-expanded');
@@ -37,20 +33,10 @@ export class ContentMetadata extends Component {
propertyListElements = this.allByCss('.adf-property');
propertyValue = this.byCss('.adf-property-value');
editPropertiesButton = this.byCss(`button[title='Edit']`);
- lessInfoButton = this.byCssText(
- `[data-automation-id='meta-data-card-toggle-expand']`,
- 'Less information'
- );
- moreInfoButton = this.byCssText(
- `[data-automation-id='meta-data-card-toggle-expand']`,
- 'More information'
- );
- imagePropertiesPanel = this.byCss(
- `[data-automation-id='adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE']`
- );
- expandedImagePropertiesPanel = this.byCss(
- `[data-automation-id='adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE'].mat-expanded`
- );
+ lessInfoButton = this.byCssText(`[data-automation-id='meta-data-card-toggle-expand']`, 'Less information');
+ moreInfoButton = this.byCssText(`[data-automation-id='meta-data-card-toggle-expand']`, 'More information');
+ imagePropertiesPanel = this.byCss(`[data-automation-id='adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE']`);
+ expandedImagePropertiesPanel = this.byCss(`[data-automation-id='adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE'].mat-expanded`);
constructor(ancestor?: string) {
super('adf-content-metadata-card', ancestor);
@@ -66,14 +52,14 @@ export class ContentMetadata extends Component {
async getVisiblePropertiesLabels(): Promise {
return this.allByCss('.adf-property-label')
- .filter(async elem => elem.isDisplayed())
- .map(async elem => elem.getText());
+ .filter(async (elem) => elem.isDisplayed())
+ .map(async (elem) => elem.getText());
}
async getVisiblePropertiesValues() {
return this.allByCss('.adf-property-value')
- .filter(async elem => elem.isDisplayed())
- .map(async elem => {
+ .filter(async (elem) => elem.isDisplayed())
+ .map(async (elem) => {
if (await elem.isElementPresent(by.css('.mat-checkbox'))) {
if (await elem.isElementPresent(by.css('.mat-checkbox-checked'))) {
return true;
diff --git a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-library.ts b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-library.ts
index c0fb3a1d8..5661ef3e4 100755
--- a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-library.ts
+++ b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-library.ts
@@ -26,11 +26,7 @@
import { by, browser } from 'protractor';
import { Logger } from '@alfresco/adf-testing';
import { Component } from '../component';
-import {
- waitForPresence,
- waitForStaleness,
- typeText
-} from '../../utilities/utils';
+import { waitForPresence, waitForStaleness, typeText } from '../../utilities/utils';
export class LibraryMetadata extends Component {
metadataTabContent = this.byCss('.mat-card-content');
@@ -38,21 +34,9 @@ export class LibraryMetadata extends Component {
fieldLabelWrapper = this.byCss('.mat-form-field-label-wrapper');
fieldInput = this.byCss('.mat-input-element');
visibilityDropDown = this.component.element(by.css('.mat-select'));
- visibilityPublic = this.byCssText(
- '.mat-option .mat-option-text',
- 'Public',
- browser
- );
- visibilityPrivate = this.byCssText(
- '.mat-option .mat-option-text',
- 'Private',
- browser
- );
- visibilityModerated = this.byCssText(
- '.mat-option .mat-option-text',
- 'Moderated',
- browser
- );
+ visibilityPublic = this.byCssText('.mat-option .mat-option-text', 'Public', browser);
+ visibilityPrivate = this.byCssText('.mat-option .mat-option-text', 'Private', browser);
+ visibilityModerated = this.byCssText('.mat-option .mat-option-text', 'Moderated', browser);
hint = this.byCss('.mat-hint');
error = this.byCss('.mat-error');
@@ -66,9 +50,7 @@ export class LibraryMetadata extends Component {
private getFieldByName(fieldName: string) {
const wrapper = this.getLabelWrapper(fieldName);
- return wrapper
- .element(by.xpath('..'))
- .element(by.css('.mat-input-element'));
+ return wrapper.element(by.xpath('..')).element(by.css('.mat-input-element'));
}
private async isFieldDisplayed(fieldName: string) {
@@ -158,9 +140,7 @@ export class LibraryMetadata extends Component {
async isVisibilityEnabled() {
const wrapper = this.getLabelWrapper('Visibility');
- const field = wrapper
- .element(by.xpath('..'))
- .element(by.css('.mat-select'));
+ const field = wrapper.element(by.xpath('..')).element(by.css('.mat-select'));
return field.isEnabled();
}
diff --git a/projects/aca-testing-shared/src/components/info-drawer/info-drawer.ts b/projects/aca-testing-shared/src/components/info-drawer/info-drawer.ts
index 1fcef4f61..139ce1265 100755
--- a/projects/aca-testing-shared/src/components/info-drawer/info-drawer.ts
+++ b/projects/aca-testing-shared/src/components/info-drawer/info-drawer.ts
@@ -29,11 +29,7 @@ import { Component } from '../component';
import { CommentsTab } from './info-drawer-comments-tab';
import { LibraryMetadata } from './info-drawer-metadata-library';
import { ContentMetadata } from './info-drawer-metadata-content';
-import {
- waitForVisibility,
- waitForInvisibility,
- waitForPresence
-} from '../../utilities/utils';
+import { waitForVisibility, waitForInvisibility, waitForPresence } from '../../utilities/utils';
export class InfoDrawer extends Component {
commentsTab = new CommentsTab('adf-info-drawer');
@@ -44,15 +40,9 @@ export class InfoDrawer extends Component {
tabLabel = this.byCss('.mat-tab-label-content');
tabLabelsList = this.allByCss('.mat-tab-label-content');
tabActiveLabel = this.byCss('.mat-tab-label-active');
- tabActiveContent = this.byCss(
- '.mat-tab-body-active .mat-tab-body-content adf-dynamic-tab'
- );
- nextButton = this.byCss(
- '.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron'
- );
- previousButton = this.byCss(
- '.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron'
- );
+ tabActiveContent = this.byCss('.mat-tab-body-active .mat-tab-body-content adf-dynamic-tab');
+ nextButton = this.byCss('.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron');
+ previousButton = this.byCss('.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron');
constructor(ancestor?: string) {
super('adf-info-drawer', ancestor);
@@ -130,10 +120,7 @@ export class InfoDrawer extends Component {
try {
await this.getTabByTitle('Comments').click();
await this.commentsTab.waitForCommentsContainer();
- await Promise.all([
- waitForVisibility(this.commentsTab.component),
- waitForInvisibility(this.propertiesTab.component)
- ]);
+ await Promise.all([waitForVisibility(this.commentsTab.component), waitForInvisibility(this.propertiesTab.component)]);
} catch (error) {
Logger.error('--- info-drawer clickCommentsTab catch error: ', error);
}
diff --git a/projects/aca-testing-shared/src/components/menu/menu.ts b/projects/aca-testing-shared/src/components/menu/menu.ts
index 6902bd722..3a497d263 100755
--- a/projects/aca-testing-shared/src/components/menu/menu.ts
+++ b/projects/aca-testing-shared/src/components/menu/menu.ts
@@ -26,23 +26,14 @@
import { ElementFinder, by, browser } from 'protractor';
import { Logger } from '@alfresco/adf-testing';
import { Component } from '../component';
-import {
- Utils,
- isPresentAndEnabled,
- waitForPresence,
- waitForVisibility,
- waitForStaleness,
- waitForClickable
-} from '../../utilities/utils';
+import { Utils, isPresentAndEnabled, waitForPresence, waitForVisibility, waitForStaleness, waitForClickable } from '../../utilities/utils';
export class Menu extends Component {
items = this.allByCss('.mat-menu-item');
backdrop = this.byCss('.cdk-overlay-backdrop', browser);
uploadFilesInput = this.byId('app-upload-files', browser);
- submenus = browser.element.all(
- by.css('app-context-menu-item .mat-menu-item')
- );
+ submenus = browser.element.all(by.css('app-context-menu-item .mat-menu-item'));
uploadFileAction = this.byId('app.create.uploadFile');
uploadFolderAction = this.byId('app.create.uploadFolder');
@@ -61,23 +52,14 @@ export class Menu extends Component {
favoriteAction = this.byCss(`.mat-menu-item[id$='favorite.add']`);
removeFavoriteAction = this.byCss(`.mat-menu-item[id$='favorite.remove']`);
toggleFavoriteAction = this.byCssText('.mat-menu-item', 'Favorite');
- toggleRemoveFavoriteAction = this.byCssText(
- '.mat-menu-item',
- 'Remove Favorite'
- );
+ toggleRemoveFavoriteAction = this.byCssText('.mat-menu-item', 'Remove Favorite');
joinAction = this.byCssText('.mat-menu-item', 'Join');
leaveAction = this.byCssText('.mat-menu-item', 'Leave');
managePermissionsAction = this.byCssText('.mat-menu-item', 'Permissions');
manageVersionsAction = this.byCssText('.mat-menu-item', 'Manage Versions');
- uploadNewVersionAction = this.byCssText(
- '.mat-menu-item',
- 'Upload New Version'
- );
+ uploadNewVersionAction = this.byCssText('.mat-menu-item', 'Upload New Version');
moveAction = this.byCssText('.mat-menu-item', 'Move');
- permanentDeleteAction = this.byCssText(
- '.mat-menu-item',
- 'Permanently Delete'
- );
+ permanentDeleteAction = this.byCssText('.mat-menu-item', 'Permanently Delete');
restoreAction = this.byCssText('.mat-menu-item', 'Restore');
shareAction = this.byCssText('.mat-menu-item', 'Share');
shareEditAction = this.byCssText('.mat-menu-item', 'Shared Link Settings');
@@ -89,16 +71,12 @@ export class Menu extends Component {
}
async waitForMenuToOpen(): Promise {
- await waitForPresence(
- browser.element(by.css('.cdk-overlay-container .mat-menu-panel'))
- );
+ await waitForPresence(browser.element(by.css('.cdk-overlay-container .mat-menu-panel')));
await waitForVisibility(this.items.get(0));
}
async waitForMenuToClose(): Promise {
- await waitForStaleness(
- browser.element(by.css('.cdk-overlay-container .mat-menu-panel'))
- );
+ await waitForStaleness(browser.element(by.css('.cdk-overlay-container .mat-menu-panel')));
}
async closeMenu(): Promise {
@@ -127,9 +105,7 @@ export class Menu extends Component {
}
async getItemIconText(menuItem: string): Promise {
- return this.getItemByLabel(menuItem)
- .element(by.css('.mat-icon'))
- .getText();
+ return this.getItemByLabel(menuItem).element(by.css('.mat-icon')).getText();
}
async getItemIdAttribute(menuItem: string): Promise {
@@ -141,7 +117,7 @@ export class Menu extends Component {
}
async getMenuItems(): Promise {
- const items: string[] = await this.items.map(async elem => {
+ const items: string[] = await this.items.map(async (elem) => {
const span = elem.element(by.css('span'));
return span.getText();
});
@@ -152,14 +128,8 @@ export class Menu extends Component {
try {
const elem = this.getNthItem(nth);
await waitForClickable(elem);
- await browser
- .actions()
- .mouseMove(elem)
- .perform();
- await browser
- .actions()
- .click()
- .perform();
+ await browser.actions().mouseMove(elem).perform();
+ await browser.actions().click().perform();
await this.waitForMenuToClose();
} catch (e) {
Logger.error('____ click nth menu item catch ___', e);
@@ -180,10 +150,7 @@ export class Menu extends Component {
try {
const elem = this.getItemByLabel(menuItem);
await waitForClickable(elem);
- await browser
- .actions()
- .mouseMove(elem)
- .perform();
+ await browser.actions().mouseMove(elem).perform();
await browser.sleep(500);
} catch (error) {
Logger.error('----- mouse over error: ', error);
@@ -213,17 +180,11 @@ export class Menu extends Component {
}
async isMenuItemPresent(title: string): Promise {
- return browser
- .element(by.cssContainingText('.mat-menu-item', title))
- .isPresent();
+ return browser.element(by.cssContainingText('.mat-menu-item', title)).isPresent();
}
async isSubMenuItemPresent(title: string): Promise {
- return browser
- .element(
- by.cssContainingText('app-context-menu-item .mat-menu-item', title)
- )
- .isPresent();
+ return browser.element(by.cssContainingText('app-context-menu-item .mat-menu-item', title)).isPresent();
}
async getSubmenuItemsCount(): Promise {
diff --git a/projects/aca-testing-shared/src/components/metadata-card/metadata-card.ts b/projects/aca-testing-shared/src/components/metadata-card/metadata-card.ts
index ac568e20c..8e947df23 100644
--- a/projects/aca-testing-shared/src/components/metadata-card/metadata-card.ts
+++ b/projects/aca-testing-shared/src/components/metadata-card/metadata-card.ts
@@ -28,12 +28,8 @@ import { waitForPresence } from '../../utilities/utils';
export class MetadataCard extends Component {
footer = this.byCss('.adf-content-metadata-card-footer');
- expandButton = this.byCss(
- '[data-automation-id="meta-data-card-toggle-expand"]'
- );
- expansionPanels = this.allByCss(
- '.adf-metadata-grouped-properties-container mat-expansion-panel'
- );
+ expandButton = this.byCss('[data-automation-id="meta-data-card-toggle-expand"]');
+ expansionPanels = this.allByCss('.adf-metadata-grouped-properties-container mat-expansion-panel');
constructor(ancestor?: string) {
super('adf-content-metadata-card', ancestor);
diff --git a/projects/aca-testing-shared/src/components/pagination/pagination.ts b/projects/aca-testing-shared/src/components/pagination/pagination.ts
index 931c9713e..fb98f2fea 100755
--- a/projects/aca-testing-shared/src/components/pagination/pagination.ts
+++ b/projects/aca-testing-shared/src/components/pagination/pagination.ts
@@ -36,12 +36,8 @@ export class Pagination extends Component {
totalPages = this.byCss('.adf-pagination__total-pages');
previousButton = this.byCss('.adf-pagination__previous-button');
nextButton = this.byCss('.adf-pagination__next-button');
- maxItemsButton = this.byCss(
- '.adf-pagination__max-items + button[mat-icon-button]'
- );
- pagesButton = this.byCss(
- '.adf-pagination__current-page + button[mat-icon-button]'
- );
+ maxItemsButton = this.byCss('.adf-pagination__max-items + button[mat-icon-button]');
+ pagesButton = this.byCss('.adf-pagination__current-page + button[mat-icon-button]');
menu: Menu = new Menu();
@@ -51,10 +47,7 @@ export class Pagination extends Component {
async openMaxItemsMenu() {
try {
- await waitForClickable(
- this.maxItemsButton,
- 'timeout waiting for maxItemsButton to be clickable'
- );
+ await waitForClickable(this.maxItemsButton, 'timeout waiting for maxItemsButton to be clickable');
await this.maxItemsButton.click();
await this.menu.waitForMenuToOpen();
} catch (error) {
@@ -64,10 +57,7 @@ export class Pagination extends Component {
async openCurrentPageMenu() {
try {
- await waitForClickable(
- this.pagesButton,
- 'timeout waiting for pagesButton to be clickable'
- );
+ await waitForClickable(this.pagesButton, 'timeout waiting for pagesButton to be clickable');
await this.pagesButton.click();
await this.menu.waitForMenuToOpen();
} catch (error) {
diff --git a/projects/aca-testing-shared/src/components/search/filters/created-date-filter.ts b/projects/aca-testing-shared/src/components/search/filters/created-date-filter.ts
index 6a9b2ddf9..ef98340f0 100755
--- a/projects/aca-testing-shared/src/components/search/filters/created-date-filter.ts
+++ b/projects/aca-testing-shared/src/components/search/filters/created-date-filter.ts
@@ -32,30 +32,14 @@ export class CreatedDateFilter extends GenericFilterPanel {
super('Created date');
}
- fromField: ElementFinder = this.panelExpanded.element(
- by.cssContainingText('.adf-search-date-range .mat-form-field', 'From')
- );
- fromInput: ElementFinder = this.fromField.element(
- by.css(`[data-automation-id='date-range-from-input']`)
- );
- fromFieldError: ElementFinder = this.fromField.element(
- by.css(`[data-automation-id='date-range-from-error']`)
- );
- toField: ElementFinder = this.panelExpanded.element(
- by.cssContainingText('.adf-search-date-range .mat-form-field', 'To')
- );
- toInput: ElementFinder = this.toField.element(
- by.css(`[data-automation-id='date-range-to-input']`)
- );
- toFieldError: ElementFinder = this.toField.element(
- by.css(`[data-automation-id='date-range-to-error']`)
- );
- clearButton: ElementFinder = this.panel.element(
- by.css('.adf-facet-buttons [data-automation-id="date-range-clear-btn"]')
- );
- applyButton: ElementFinder = this.panel.element(
- by.css('.adf-facet-buttons [data-automation-id="date-range-apply-btn"]')
- );
+ fromField: ElementFinder = this.panelExpanded.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'From'));
+ fromInput: ElementFinder = this.fromField.element(by.css(`[data-automation-id='date-range-from-input']`));
+ fromFieldError: ElementFinder = this.fromField.element(by.css(`[data-automation-id='date-range-from-error']`));
+ toField: ElementFinder = this.panelExpanded.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'To'));
+ toInput: ElementFinder = this.toField.element(by.css(`[data-automation-id='date-range-to-input']`));
+ toFieldError: ElementFinder = this.toField.element(by.css(`[data-automation-id='date-range-to-error']`));
+ clearButton: ElementFinder = this.panel.element(by.css('.adf-facet-buttons [data-automation-id="date-range-clear-btn"]'));
+ applyButton: ElementFinder = this.panel.element(by.css('.adf-facet-buttons [data-automation-id="date-range-apply-btn"]'));
async isFromFieldDisplayed(): Promise {
return isPresentAndDisplayed(this.fromField);
diff --git a/projects/aca-testing-shared/src/components/search/filters/facet-filter.ts b/projects/aca-testing-shared/src/components/search/filters/facet-filter.ts
index ebd2d6c9f..47b13f915 100755
--- a/projects/aca-testing-shared/src/components/search/filters/facet-filter.ts
+++ b/projects/aca-testing-shared/src/components/search/filters/facet-filter.ts
@@ -42,9 +42,7 @@ export class FacetFilter extends GenericFilterPanel {
return this.panel.all(by.css(this.locators.checkboxChecked));
}
get clearButton(): ElementFinder {
- return this.panel.element(
- by.cssContainingText(this.locators.button, 'Clear all')
- );
+ return this.panel.element(by.cssContainingText(this.locators.button, 'Clear all'));
}
get facetsFilter(): ElementFinder {
return this.panelExpanded.element(by.css(this.locators.facetsFilter));
@@ -54,14 +52,14 @@ export class FacetFilter extends GenericFilterPanel {
}
async getFiltersValues(): Promise {
- const list: string[] = await this.facets.map(option => {
+ const list: string[] = await this.facets.map((option) => {
return option.getText();
});
return list;
}
async getFiltersCheckedValues(): Promise {
- const list: string[] = await this.selectedFacets.map(option => {
+ const list: string[] = await this.selectedFacets.map((option) => {
return option.getText();
});
return list;
@@ -70,7 +68,7 @@ export class FacetFilter extends GenericFilterPanel {
async resetPanel(): Promise {
if ((await this.selectedFacets.count()) > 0) {
await this.expandPanel();
- await this.selectedFacets.each(async elem => {
+ await this.selectedFacets.each(async (elem) => {
await elem.click();
});
}
@@ -96,18 +94,10 @@ export class FacetFilter extends GenericFilterPanel {
}
async checkCategory(name: string): Promise {
- const option = this.facets
- .filter(async elem => (await elem.getText()).includes(name))
- .first();
+ const option = this.facets.filter(async (elem) => (await elem.getText()).includes(name)).first();
await browser.executeScript(`arguments[0].scrollIntoView();`, option);
- await browser
- .actions()
- .mouseMove(option)
- .perform();
- await browser
- .actions()
- .click()
- .perform();
+ await browser.actions().mouseMove(option).perform();
+ await browser.actions().click().perform();
}
async filterCategoriesBy(name: string): Promise {
diff --git a/projects/aca-testing-shared/src/components/search/filters/generic-filter-panel.ts b/projects/aca-testing-shared/src/components/search/filters/generic-filter-panel.ts
index 0e2113ae9..798d70a82 100755
--- a/projects/aca-testing-shared/src/components/search/filters/generic-filter-panel.ts
+++ b/projects/aca-testing-shared/src/components/search/filters/generic-filter-panel.ts
@@ -42,14 +42,10 @@ export class GenericFilterPanel {
};
get panel(): ElementFinder {
- return browser.element(
- by.cssContainingText(this.selectors.panel, this.filterName)
- );
+ return browser.element(by.cssContainingText(this.selectors.panel, this.filterName));
}
get panelExpanded(): ElementFinder {
- return browser.element(
- by.cssContainingText(this.selectors.panelExpanded, this.filterName)
- );
+ return browser.element(by.cssContainingText(this.selectors.panelExpanded, this.filterName));
}
get panelHeader(): ElementFinder {
return this.panel.element(by.css(this.selectors.panelHeader));
diff --git a/projects/aca-testing-shared/src/components/search/filters/size-filter.ts b/projects/aca-testing-shared/src/components/search/filters/size-filter.ts
index 57828f3c3..ea13918ac 100755
--- a/projects/aca-testing-shared/src/components/search/filters/size-filter.ts
+++ b/projects/aca-testing-shared/src/components/search/filters/size-filter.ts
@@ -32,22 +32,18 @@ export class SizeFilter extends GenericFilterPanel {
}
facets: ElementArrayFinder = this.panelExpanded.all(by.css('.mat-checkbox'));
- selectedFacets: ElementArrayFinder = this.panel.all(
- by.css('.mat-checkbox.mat-checkbox-checked')
- );
- clearButton: ElementFinder = this.panel.element(
- by.cssContainingText('.adf-facet-buttons button', 'Clear all')
- );
+ selectedFacets: ElementArrayFinder = this.panel.all(by.css('.mat-checkbox.mat-checkbox-checked'));
+ clearButton: ElementFinder = this.panel.element(by.cssContainingText('.adf-facet-buttons button', 'Clear all'));
async getFiltersValues(): Promise {
- const list: string[] = await this.facets.map(option => {
+ const list: string[] = await this.facets.map((option) => {
return option.getText();
});
return list;
}
async getFiltersCheckedValues(): Promise {
- const list: string[] = await this.selectedFacets.map(option => {
+ const list: string[] = await this.selectedFacets.map((option) => {
return option.getText();
});
return list;
@@ -56,7 +52,7 @@ export class SizeFilter extends GenericFilterPanel {
async resetPanel(): Promise {
if ((await this.selectedFacets.count()) > 0) {
await this.expandPanel();
- await this.selectedFacets.each(async elem => {
+ await this.selectedFacets.each(async (elem) => {
await elem.click();
});
}
@@ -74,30 +70,22 @@ export class SizeFilter extends GenericFilterPanel {
}
async checkSizeSmall(): Promise {
- const small = this.facets
- .filter(async elem => (await elem.getText()) === 'Small')
- .first();
+ const small = this.facets.filter(async (elem) => (await elem.getText()) === 'Small').first();
await small.click();
}
async checkSizeMedium(): Promise {
- const medium = this.facets
- .filter(async elem => (await elem.getText()) === 'Medium')
- .first();
+ const medium = this.facets.filter(async (elem) => (await elem.getText()) === 'Medium').first();
await medium.click();
}
async checkSizeLarge(): Promise {
- const large = this.facets
- .filter(async elem => (await elem.getText()) === 'Large')
- .first();
+ const large = this.facets.filter(async (elem) => (await elem.getText()) === 'Large').first();
await large.click();
}
async checkSizeHuge(): Promise {
- const huge = this.facets
- .filter(async elem => (await elem.getText()) === 'Huge')
- .first();
+ const huge = this.facets.filter(async (elem) => (await elem.getText()) === 'Huge').first();
await huge.click();
}
}
diff --git a/projects/aca-testing-shared/src/components/search/search-input.ts b/projects/aca-testing-shared/src/components/search/search-input.ts
index 9a7d89bf3..7ce179ad7 100755
--- a/projects/aca-testing-shared/src/components/search/search-input.ts
+++ b/projects/aca-testing-shared/src/components/search/search-input.ts
@@ -25,12 +25,7 @@
import { browser, by, protractor } from 'protractor';
import { Component } from '../component';
-import {
- Utils,
- waitForPresence,
- waitForClickable,
- waitElement
-} from '../../utilities/utils';
+import { Utils, waitForPresence, waitForClickable, waitElement } from '../../utilities/utils';
export class SearchInput extends Component {
searchButton = this.component.element(by.css('.app-search-button'));
@@ -38,15 +33,9 @@ export class SearchInput extends Component {
searchControl = browser.element(by.css('.app-search-control'));
searchInput = browser.element(by.css(`input[id='app-control-input']`));
searchOptionsArea = browser.element(by.id('search-options'));
- searchFilesOption = this.searchOptionsArea.element(
- by.cssContainingText('.mat-checkbox', 'Files')
- );
- searchFoldersOption = this.searchOptionsArea.element(
- by.cssContainingText('.mat-checkbox', 'Folders')
- );
- searchLibrariesOption = this.searchOptionsArea.element(
- by.cssContainingText('.mat-checkbox', 'Libraries')
- );
+ searchFilesOption = this.searchOptionsArea.element(by.cssContainingText('.mat-checkbox', 'Files'));
+ searchFoldersOption = this.searchOptionsArea.element(by.cssContainingText('.mat-checkbox', 'Folders'));
+ searchLibrariesOption = this.searchOptionsArea.element(by.cssContainingText('.mat-checkbox', 'Libraries'));
clearSearchButton = this.searchContainer.$('.app-clear-icon');
constructor(ancestor?: string) {
diff --git a/projects/aca-testing-shared/src/components/search/search-sorting-picker.ts b/projects/aca-testing-shared/src/components/search/search-sorting-picker.ts
index bb56f4f8c..44804a8a2 100755
--- a/projects/aca-testing-shared/src/components/search/search-sorting-picker.ts
+++ b/projects/aca-testing-shared/src/components/search/search-sorting-picker.ts
@@ -25,40 +25,23 @@
import { by, browser } from 'protractor';
import { Component } from '../component';
-import {
- isPresentAndDisplayed,
- waitForVisibility
-} from '../../utilities/utils';
-
-export type SortByType =
- | 'Relevance'
- | 'Title'
- | 'Filename'
- | 'Modified date'
- | 'Modifier'
- | 'Created date'
- | 'Size'
- | 'Type';
+import { isPresentAndDisplayed, waitForVisibility } from '../../utilities/utils';
+export type SortByType = 'Relevance' | 'Title' | 'Filename' | 'Modified date' | 'Modifier' | 'Created date' | 'Size' | 'Type';
export type SortOrderType = 'ASC' | 'DESC' | '';
export class SearchSortingPicker extends Component {
sortOrderButton = this.byCss('button[mat-icon-button]');
sortByDropdownCollapsed = this.byCss('.mat-select');
sortByDropdownExpanded = browser.element(by.css('.mat-select-panel'));
- sortByList = this.sortByDropdownExpanded.all(
- by.css('.mat-option .mat-option-text')
- );
+ sortByList = this.sortByDropdownExpanded.all(by.css('.mat-option .mat-option-text'));
constructor(ancestor?: string) {
super('adf-search-sorting-picker', ancestor);
}
async waitForSortByDropdownToExpand(): Promise {
- await waitForVisibility(
- this.sortByDropdownExpanded,
- 'Timeout waiting for sortBy dropdown to expand'
- );
+ await waitForVisibility(this.sortByDropdownExpanded, 'Timeout waiting for sortBy dropdown to expand');
}
async isSortOrderButtonDisplayed(): Promise {
@@ -95,7 +78,7 @@ export class SearchSortingPicker extends Component {
}
async getSortByOptionsList(): Promise {
- const list: string[] = await this.sortByList.map(async option => {
+ const list: string[] = await this.sortByList.map(async (option) => {
return option.getText();
});
return list;
@@ -105,9 +88,7 @@ export class SearchSortingPicker extends Component {
if (!(await this.isSortByDropdownExpanded())) {
await this.clickSortByDropdown();
}
- const elem = browser.element(
- by.cssContainingText('.mat-option .mat-option-text', option)
- );
+ const elem = browser.element(by.cssContainingText('.mat-option .mat-option-text', option));
await elem.click();
}
diff --git a/projects/aca-testing-shared/src/components/sidenav/sidenav.ts b/projects/aca-testing-shared/src/components/sidenav/sidenav.ts
index 7b5b712b5..ad0656b5c 100755
--- a/projects/aca-testing-shared/src/components/sidenav/sidenav.ts
+++ b/projects/aca-testing-shared/src/components/sidenav/sidenav.ts
@@ -35,17 +35,9 @@ export class Sidenav extends Component {
activeLink = this.byCss('.action-button--active');
newButton = this.allByCss('[data-automation-id="create-button"]');
personalFiles = this.byCss(`[data-automation-id='app.navbar.personalFiles']`);
- fileLibraries = this.byCss(
- `[data-automation-id='app.navbar.libraries.menu']`
- );
- myLibraries = this.byCss(
- `[data-automation-id='app.navbar.libraries.files']`,
- browser
- );
- favoriteLibraries = this.byCss(
- `[data-automation-id='app.navbar.libraries.favorite']`,
- browser
- );
+ fileLibraries = this.byCss(`[data-automation-id='app.navbar.libraries.menu']`);
+ myLibraries = this.byCss(`[data-automation-id='app.navbar.libraries.files']`, browser);
+ favoriteLibraries = this.byCss(`[data-automation-id='app.navbar.libraries.favorite']`, browser);
shared = this.byCss(`[data-automation-id='app.navbar.shared']`);
recentFiles = this.byCss(`[data-automation-id='app.navbar.recentFiles']`);
favorites = this.byCss(`[data-automation-id='app.navbar.favorites']`);
@@ -59,9 +51,7 @@ export class Sidenav extends Component {
private async expandMenu(name: string): Promise {
try {
- if (
- await element(by.cssContainingText('.mat-expanded', name)).isPresent()
- ) {
+ if (await element(by.cssContainingText('.mat-expanded', name)).isPresent()) {
return Promise.resolve();
} else {
const link = this.getLink(name);
@@ -80,9 +70,7 @@ export class Sidenav extends Component {
}
async closeNewMenu(): Promise {
- await BrowserActions.click(
- element(by.css('button[data-automation-id="create-button"] span span'))
- );
+ await BrowserActions.click(element(by.css('button[data-automation-id="create-button"] span span')));
await this.menu.waitForMenuToClose();
}
@@ -112,9 +100,7 @@ export class Sidenav extends Component {
}
async childIsActive(name: string): Promise {
- const childClass = await this.getLinkLabel(name)
- .element(by.css('span'))
- .getAttribute('class');
+ const childClass = await this.getLinkLabel(name).element(by.css('span')).getAttribute('class');
return childClass.includes('action-button--active');
}
@@ -147,13 +133,9 @@ export class Sidenav extends Component {
async getLinkTooltip(name: string): Promise {
const link = this.getLinkLabel(name);
- const condition = () =>
- link.getAttribute('title').then(value => value && value.length > 0);
+ const condition = () => link.getAttribute('title').then((value) => value && value.length > 0);
- await browser
- .actions()
- .mouseMove(link)
- .perform();
+ await browser.actions().mouseMove(link).perform();
await browser.wait(condition, BROWSER_WAIT_TIMEOUT);
return link.getAttribute('title');
@@ -170,9 +152,7 @@ export class Sidenav extends Component {
}
async isFileLibrariesMenuExpanded(): Promise {
- return element(
- by.cssContainingText('.mat-expanded', SIDEBAR_LABELS.FILE_LIBRARIES)
- ).isPresent();
+ return element(by.cssContainingText('.mat-expanded', SIDEBAR_LABELS.FILE_LIBRARIES)).isPresent();
}
async expandFileLibraries(): Promise {
diff --git a/projects/aca-testing-shared/src/components/toolbar/toolbar.ts b/projects/aca-testing-shared/src/components/toolbar/toolbar.ts
index 4fff58305..8604c66ae 100755
--- a/projects/aca-testing-shared/src/components/toolbar/toolbar.ts
+++ b/projects/aca-testing-shared/src/components/toolbar/toolbar.ts
@@ -34,25 +34,17 @@ export class Toolbar extends Component {
buttons = this.allByCss('button');
shareButton = this.byCss(`.mat-icon-button[title='Share']`);
- shareEditButton = this.byCss(
- `.mat-icon-button[title='Shared Link Settings']`
- );
+ shareEditButton = this.byCss(`.mat-icon-button[title='Shared Link Settings']`);
viewButton = this.byCss(`.mat-icon-button[title='View']`);
- searchFiltersToggleButton = this.byCss(
- `.mat-icon-button[title='Toggle search filter']`
- );
+ searchFiltersToggleButton = this.byCss(`.mat-icon-button[title='Toggle search filter']`);
downloadButton = this.byCss(`.mat-icon-button[title='Download']`);
editFolderButton = this.byId('app.toolbar.editFolder');
viewDetailsButton = this.byCss(`.mat-icon-button[title='View Details']`);
printButton = this.byCss(`.mat-icon-button[title='Print']`);
- fullScreenButton = this.byCss(
- `.mat-icon-button[title='Activate full-screen mode']`
- );
+ fullScreenButton = this.byCss(`.mat-icon-button[title='Activate full-screen mode']`);
joinButton = this.byCss(`.mat-icon-button[title='Join']`);
leaveButton = this.byCss(`.mat-icon-button[title='Leave Library']`);
- permanentlyDeleteButton = this.byCss(
- `.mat-icon-button[title='Permanently Delete']`
- );
+ permanentlyDeleteButton = this.byCss(`.mat-icon-button[title='Permanently Delete']`);
restoreButton = this.byCss(`.mat-icon-button[title='Restore']`);
constructor(ancestor?: string) {
@@ -65,7 +57,7 @@ export class Toolbar extends Component {
}
async getButtons(): Promise {
- return this.buttons.map(async elem => {
+ return this.buttons.map(async (elem) => {
return elem.getAttribute('title');
});
}
diff --git a/projects/aca-testing-shared/src/pages/browsing-page.ts b/projects/aca-testing-shared/src/pages/browsing-page.ts
index 6710be4d4..d912778a8 100755
--- a/projects/aca-testing-shared/src/pages/browsing-page.ts
+++ b/projects/aca-testing-shared/src/pages/browsing-page.ts
@@ -23,14 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- Header,
- DataTable,
- Pagination,
- Toolbar,
- Breadcrumb,
- Sidenav
-} from '../components/components';
+import { Header, DataTable, Pagination, Toolbar, Breadcrumb, Sidenav } from '../components/components';
import { SIDEBAR_LABELS } from './../configs';
import { Page } from './page';
diff --git a/projects/aca-testing-shared/src/pages/login-page.ts b/projects/aca-testing-shared/src/pages/login-page.ts
index a5ff9bf1e..6fe205e57 100755
--- a/projects/aca-testing-shared/src/pages/login-page.ts
+++ b/projects/aca-testing-shared/src/pages/login-page.ts
@@ -51,10 +51,7 @@ export class LoginPage extends Page {
async loginWithAdmin() {
await this.load();
- return this.loginWith(
- browser.params.ADMIN_USERNAME,
- browser.params.ADMIN_PASSWORD
- );
+ return this.loginWith(browser.params.ADMIN_USERNAME, browser.params.ADMIN_PASSWORD);
}
async tryLoginWith(username: string, password?: string) {
diff --git a/projects/aca-testing-shared/src/pages/page.ts b/projects/aca-testing-shared/src/pages/page.ts
index c074e5a76..3b30951f3 100755
--- a/projects/aca-testing-shared/src/pages/page.ts
+++ b/projects/aca-testing-shared/src/pages/page.ts
@@ -26,12 +26,7 @@
import { browser, by, ElementFinder } from 'protractor';
import { Logger } from '@alfresco/adf-testing';
import { USE_HASH_STRATEGY } from './../configs';
-import {
- Utils,
- waitElement,
- waitForPresence,
- waitForVisibility
-} from '../utilities/utils';
+import { Utils, waitElement, waitForPresence, waitForVisibility } from '../utilities/utils';
export abstract class Page {
appRoot = 'app-root';
diff --git a/projects/aca-testing-shared/src/pages/search-results-page.ts b/projects/aca-testing-shared/src/pages/search-results-page.ts
index ceac9af3c..340b090c9 100755
--- a/projects/aca-testing-shared/src/pages/search-results-page.ts
+++ b/projects/aca-testing-shared/src/pages/search-results-page.ts
@@ -46,7 +46,7 @@ export class SearchResultsPage extends BrowsingPage {
async getResultsChipsValues(): Promise {
const chips = this.chipList.all(by.css('.mat-chip'));
- const chipsValues: string[] = await chips.map(async elem => {
+ const chipsValues: string[] = await chips.map(async (elem) => {
return (await elem.getText()).replace(`\ncancel`, '');
});
return chipsValues;
diff --git a/projects/aca-testing-shared/src/utilities/admin-actions.ts b/projects/aca-testing-shared/src/utilities/admin-actions.ts
index f858c0da1..3e050b145 100755
--- a/projects/aca-testing-shared/src/utilities/admin-actions.ts
+++ b/projects/aca-testing-shared/src/utilities/admin-actions.ts
@@ -51,95 +51,53 @@ export class AdminActions {
}
async getNodeTemplatesFolderId(): Promise {
- return this.adminApi.nodes.getNodeIdFromParent(
- 'Node Templates',
- await this.getDataDictionaryId()
- );
+ return this.adminApi.nodes.getNodeIdFromParent('Node Templates', await this.getDataDictionaryId());
}
async getSpaceTemplatesFolderId(): Promise {
- return this.adminApi.nodes.getNodeIdFromParent(
- 'Space Templates',
- await this.getDataDictionaryId()
- );
+ return this.adminApi.nodes.getNodeIdFromParent('Space Templates', await this.getDataDictionaryId());
}
async createUser(user: PersonModel): Promise {
return this.adminApi.people.createUser(user);
}
- async createNodeTemplate(
- name: string,
- title: string = '',
- description: string = '',
- author: string = ''
- ): Promise {
+ async createNodeTemplate(name: string, title: string = '', description: string = '', author: string = ''): Promise {
const templatesRootFolderId: string = await this.getNodeTemplatesFolderId();
- return this.adminApi.nodes.createFile(
- name,
- templatesRootFolderId,
- title,
- description,
- author
- );
+ return this.adminApi.nodes.createFile(name, templatesRootFolderId, title, description, author);
}
async createNodeTemplatesHierarchy(hierarchy: NodeContentTree): Promise {
- return this.adminApi.nodes.createContent(
- hierarchy,
- `Data Dictionary/Node Templates`
- );
+ return this.adminApi.nodes.createContent(hierarchy, `Data Dictionary/Node Templates`);
}
- async createSpaceTemplate(
- name: string,
- title: string = '',
- description: string = ''
- ): Promise {
+ async createSpaceTemplate(name: string, title: string = '', description: string = ''): Promise {
const templatesRootFolderId: string = await this.getSpaceTemplatesFolderId();
- return this.adminApi.nodes.createFolder(
- name,
- templatesRootFolderId,
- title,
- description
- );
+ return this.adminApi.nodes.createFolder(name, templatesRootFolderId, title, description);
}
- async createSpaceTemplatesHierarchy(
- hierarchy: NodeContentTree
- ): Promise {
- return this.adminApi.nodes.createContent(
- hierarchy,
- `Data Dictionary/Space Templates`
- );
+ async createSpaceTemplatesHierarchy(hierarchy: NodeContentTree): Promise {
+ return this.adminApi.nodes.createContent(hierarchy, `Data Dictionary/Space Templates`);
}
async removeUserAccessOnNodeTemplate(nodeName: string): Promise {
const templatesRootFolderId = await this.getNodeTemplatesFolderId();
- const nodeId: string = await this.adminApi.nodes.getNodeIdFromParent(
- nodeName,
- templatesRootFolderId
- );
+ const nodeId: string = await this.adminApi.nodes.getNodeIdFromParent(nodeName, templatesRootFolderId);
return this.adminApi.nodes.setInheritPermissions(nodeId, false);
}
async removeUserAccessOnSpaceTemplate(nodeName: string): Promise {
const templatesRootFolderId = await this.getSpaceTemplatesFolderId();
- const nodeId: string = await this.adminApi.nodes.getNodeIdFromParent(
- nodeName,
- templatesRootFolderId
- );
+ const nodeId: string = await this.adminApi.nodes.getNodeIdFromParent(nodeName, templatesRootFolderId);
return this.adminApi.nodes.setInheritPermissions(nodeId, false);
}
async cleanupNodeTemplatesFolder(): Promise {
- return this.adminApi.nodes.deleteNodeChildren(
- await this.getNodeTemplatesFolderId()
- );
+ return this.adminApi.nodes.deleteNodeChildren(await this.getNodeTemplatesFolderId());
}
async cleanupSpaceTemplatesFolder(): Promise {
@@ -147,68 +105,36 @@ export class AdminActions {
// folder links are deleted automatically when original folder is deleted
// Software Engineering Project is the default folder template coming from ACS, should not be deleted
- const nodesToDelete = (
- await this.adminApi.nodes.getNodeChildren(spaceTemplatesNodeId)
- ).list.entries
- .filter(
- node =>
- node.entry.nodeType !== 'app:folderlink' &&
- node.entry.name !== 'Software Engineering Project'
- )
- .map(node => node.entry.id);
+ const nodesToDelete = (await this.adminApi.nodes.getNodeChildren(spaceTemplatesNodeId)).list.entries
+ .filter((node) => node.entry.nodeType !== 'app:folderlink' && node.entry.name !== 'Software Engineering Project')
+ .map((node) => node.entry.id);
return this.adminApi.nodes.deleteNodesById(nodesToDelete);
}
- async createLinkToFileId(
- originalFileId: string,
- destinationParentId: string
- ): Promise {
- return this.adminApi.nodes.createFileLink(
- originalFileId,
- destinationParentId
- );
+ async createLinkToFileId(originalFileId: string, destinationParentId: string): Promise {
+ return this.adminApi.nodes.createFileLink(originalFileId, destinationParentId);
}
- async createLinkToFileName(
- originalFileName: string,
- originalFileParentId: string,
- destinationParentId?: string
- ): Promise {
+ async createLinkToFileName(originalFileName: string, originalFileParentId: string, destinationParentId?: string): Promise {
if (!destinationParentId) {
destinationParentId = originalFileParentId;
}
- const nodeId = await this.adminApi.nodes.getNodeIdFromParent(
- originalFileName,
- originalFileParentId
- );
+ const nodeId = await this.adminApi.nodes.getNodeIdFromParent(originalFileName, originalFileParentId);
return this.createLinkToFileId(nodeId, destinationParentId);
}
- async createLinkToFolderId(
- originalFolderId: string,
- destinationParentId: string
- ): Promise {
- return this.adminApi.nodes.createFolderLink(
- originalFolderId,
- destinationParentId
- );
+ async createLinkToFolderId(originalFolderId: string, destinationParentId: string): Promise {
+ return this.adminApi.nodes.createFolderLink(originalFolderId, destinationParentId);
}
- async createLinkToFolderName(
- originalFolderName: string,
- originalFolderParentId: string,
- destinationParentId?: string
- ): Promise {
+ async createLinkToFolderName(originalFolderName: string, originalFolderParentId: string, destinationParentId?: string): Promise {
if (!destinationParentId) {
destinationParentId = originalFolderParentId;
}
- const nodeId = await this.adminApi.nodes.getNodeIdFromParent(
- originalFolderName,
- originalFolderParentId
- );
+ const nodeId = await this.adminApi.nodes.getNodeIdFromParent(originalFolderName, originalFolderParentId);
return this.createLinkToFolderId(nodeId, destinationParentId);
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/authentication/authentication-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/authentication/authentication-api.ts
index 6fe9bda83..b92252a4a 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/authentication/authentication-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/authentication/authentication-api.ts
@@ -26,7 +26,7 @@
import { RepoApi } from '../repo-api';
export class AuthenticationApi extends RepoApi {
- constructor(username?, password?) {
+ constructor(username?: string, password?: string) {
super(username, password);
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/comments/comments-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/comments/comments-api.ts
index 33f7769e0..df7dccff7 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/comments/comments-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/comments/comments-api.ts
@@ -29,7 +29,7 @@ import { CommentsApi as AdfCommentsApi } from '@alfresco/js-api';
export class CommentsApi extends RepoApi {
commentsApi = new AdfCommentsApi(this.alfrescoJsApi);
- constructor(username?, password?) {
+ constructor(username?: string, password?: string) {
super(username, password);
}
@@ -38,10 +38,7 @@ export class CommentsApi extends RepoApi {
await this.apiAuth();
return await this.commentsApi.listComments(nodeId);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeComments.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeComments.name}`, error);
return null;
}
}
@@ -51,10 +48,7 @@ export class CommentsApi extends RepoApi {
await this.apiAuth();
return await this.commentsApi.createComment(nodeId, { content: comment });
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.addComment.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.addComment.name}`, error);
return null;
}
}
@@ -64,10 +58,7 @@ export class CommentsApi extends RepoApi {
await this.apiAuth();
return await this.commentsApi.createComment(nodeId, comment);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.addComments.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.addComments.name}`, error);
return null;
}
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/favorites/favorites-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/favorites/favorites-api.ts
index 4a1fd9d7c..1a4cf4eb7 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/favorites/favorites-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/favorites/favorites-api.ts
@@ -27,17 +27,13 @@ import { RepoApi } from '../repo-api';
import { Logger } from '@alfresco/adf-testing';
import { RepoClient } from './../../repo-client';
import { Utils } from '../../../../utilities/utils';
-import {
- FavoritesApi as AdfFavoritesApi,
- SitesApi as AdfSiteApi,
- FavoriteEntry
-} from '@alfresco/js-api';
+import { FavoritesApi as AdfFavoritesApi, SitesApi as AdfSiteApi, FavoriteEntry } from '@alfresco/js-api';
export class FavoritesApi extends RepoApi {
favoritesApi = new AdfFavoritesApi(this.alfrescoJsApi);
sitesApi = new AdfSiteApi(this.alfrescoJsApi);
- constructor(username?, password?) {
+ constructor(username?: string, password?: string) {
super(username, password);
}
@@ -53,18 +49,12 @@ export class FavoritesApi extends RepoApi {
};
return await this.favoritesApi.createFavorite('-me-', data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.addFavorite.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.addFavorite.name}`, error);
return null;
}
}
- async addFavoriteById(
- nodeType: 'file' | 'folder' | 'site',
- id: string
- ): Promise {
+ async addFavoriteById(nodeType: 'file' | 'folder' | 'site', id: string): Promise {
let guid;
try {
await this.apiAuth();
@@ -82,10 +72,7 @@ export class FavoritesApi extends RepoApi {
};
return await this.favoritesApi.createFavorite('-me-', data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.addFavoriteById.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.addFavoriteById.name}`, error);
return null;
}
}
@@ -97,10 +84,7 @@ export class FavoritesApi extends RepoApi {
await this.addFavoriteById(nodeType, current);
}, Promise.resolve());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.addFavoritesByIds.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.addFavoritesByIds.name}`, error);
}
}
@@ -109,10 +93,7 @@ export class FavoritesApi extends RepoApi {
await this.apiAuth();
return await this.favoritesApi.listFavorites(this.getUsername());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getFavorites.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getFavorites.name}`, error);
return null;
}
}
@@ -122,24 +103,16 @@ export class FavoritesApi extends RepoApi {
await this.apiAuth();
return await this.favoritesApi.getFavorite('-me-', nodeId);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getFavoriteById.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getFavoriteById.name}`, error);
return null;
}
}
async isFavorite(nodeId: string) {
try {
- return JSON.stringify((await this.getFavorites()).list.entries).includes(
- nodeId
- );
+ return JSON.stringify((await this.getFavorites()).list.entries).includes(nodeId);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.isFavorite.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.isFavorite.name}`, error);
return null;
}
}
@@ -167,10 +140,7 @@ export class FavoritesApi extends RepoApi {
await this.apiAuth();
return await this.favoritesApi.deleteFavorite('-me-', nodeId);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.removeFavoriteById.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.removeFavoriteById.name}`, error);
}
}
@@ -181,18 +151,14 @@ export class FavoritesApi extends RepoApi {
await this.removeFavoriteById(current);
}, Promise.resolve());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.removeFavoritesByIds.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.removeFavoritesByIds.name}`, error);
}
}
async waitForApi(data: { expect: number }) {
try {
const favoriteFiles = async () => {
- const totalItems = (await this.getFavorites()).list.pagination
- .totalItems;
+ const totalItems = (await this.getFavorites()).list.pagination.totalItems;
if (totalItems !== data.expect) {
return Promise.reject(totalItems);
} else {
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-content-tree.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-content-tree.ts
index bcc3d4ede..ca72cb645 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-content-tree.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/node-content-tree.ts
@@ -23,13 +23,7 @@
* along with Alfresco. If not, see .
*/
-import {
- NodeBodyCreate,
- NODE_TYPE_FILE,
- NODE_TYPE_FOLDER,
- NODE_TITLE,
- NODE_DESCRIPTION
-} from './node-body-create';
+import { NodeBodyCreate, NODE_TYPE_FILE, NODE_TYPE_FOLDER, NODE_TITLE, NODE_DESCRIPTION } from './node-body-create';
export interface NodeContentTree {
name?: string;
@@ -39,10 +33,7 @@ export interface NodeContentTree {
description?: string;
}
-export function flattenNodeContentTree(
- content: NodeContentTree,
- relativePath: string = '/'
-): NodeBodyCreate[] {
+export function flattenNodeContentTree(content: NodeContentTree, relativePath: string = '/'): NodeBodyCreate[] {
const { name, files, folders, title, description } = content;
const aspectNames: string[] = ['cm:versionable'];
let data: NodeBodyCreate[] = [];
@@ -63,23 +54,17 @@ export function flattenNodeContentTree(
}
]);
- relativePath =
- relativePath === '/' ? `/${name}` : `${relativePath}/${name}`;
+ relativePath = relativePath === '/' ? `/${name}` : `${relativePath}/${name}`;
}
if (folders) {
const foldersData: NodeBodyCreate[] = folders
.map((folder: string | NodeContentTree): NodeBodyCreate[] => {
- const folderData: NodeContentTree =
- typeof folder === 'string' ? { name: folder } : folder;
+ const folderData: NodeContentTree = typeof folder === 'string' ? { name: folder } : folder;
return flattenNodeContentTree(folderData, relativePath);
})
- .reduce(
- (nodesData: NodeBodyCreate[], folderData: NodeBodyCreate[]) =>
- nodesData.concat(folderData),
- []
- );
+ .reduce((nodesData: NodeBodyCreate[], folderData: NodeBodyCreate[]) => nodesData.concat(folderData), []);
data = data.concat(foldersData);
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts
index 3afda95b6..590a71ef6 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts
@@ -26,18 +26,13 @@
import { RepoApi } from '../repo-api';
import { NodeBodyCreate } from './node-body-create';
import { NodeContentTree, flattenNodeContentTree } from './node-content-tree';
-import {
- NodesApi as AdfNodeApi,
- NodeBodyLock,
- NodeEntry,
- NodeChildAssociationPaging
-} from '@alfresco/js-api';
+import { NodesApi as AdfNodeApi, NodeBodyLock, NodeEntry, NodeChildAssociationPaging } from '@alfresco/js-api';
import { Utils } from '../../../../utilities/utils';
export class NodesApi extends RepoApi {
nodesApi = new AdfNodeApi(this.alfrescoJsApi);
- constructor(username?, password?) {
+ constructor(username?: string, password?: string) {
super(username, password);
}
@@ -46,10 +41,7 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return await this.nodesApi.getNode('-my-', { relativePath });
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeByPath.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeByPath.name}`, error);
return null;
}
}
@@ -60,10 +52,7 @@ export class NodesApi extends RepoApi {
const node = await this.nodesApi.getNode(id);
return node;
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeById.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeById.name}`, error);
return null;
}
}
@@ -71,12 +60,9 @@ export class NodesApi extends RepoApi {
async getNodeIdFromParent(name: string, parentId: string): Promise {
try {
const children = (await this.getNodeChildren(parentId)).list.entries;
- return children.find(elem => elem.entry.name === name).entry.id || '';
+ return children.find((elem) => elem.entry.name === name).entry.id || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeIdFromParent.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeIdFromParent.name}`, error);
return '';
}
}
@@ -84,16 +70,9 @@ export class NodesApi extends RepoApi {
async getNodeDescription(name: string, parentId: string): Promise {
try {
const children = (await this.getNodeChildren(parentId)).list.entries;
- return (
- children.find(elem => elem.entry.name === name).entry.properties[
- 'cm:description'
- ] || ''
- );
+ return children.find((elem) => elem.entry.name === name).entry.properties['cm:description'] || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeDescription.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeDescription.name}`, error);
return '';
}
}
@@ -101,16 +80,9 @@ export class NodesApi extends RepoApi {
async getNodeTitle(name: string, parentId: string): Promise {
try {
const children = (await this.getNodeChildren(parentId)).list.entries;
- return (
- children.find(elem => elem.entry.name === name).entry.properties[
- 'cm:title'
- ] || ''
- );
+ return children.find((elem) => elem.entry.name === name).entry.properties['cm:title'] || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeTitle.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeTitle.name}`, error);
return '';
}
}
@@ -120,10 +92,7 @@ export class NodesApi extends RepoApi {
const node = await this.getNodeById(nodeId);
return (node.entry.properties && node.entry.properties[property]) || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeProperty.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeProperty.name}`, error);
return '';
}
}
@@ -133,10 +102,7 @@ export class NodesApi extends RepoApi {
const prop = await this.getNodeProperty(nodeId, 'cm:versionType');
return prop || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getFileVersionType.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getFileVersionType.name}`, error);
return '';
}
}
@@ -146,10 +112,7 @@ export class NodesApi extends RepoApi {
const prop = await this.getNodeProperty(nodeId, 'cm:versionLabel');
return prop || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getFileVersionLabel.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getFileVersionLabel.name}`, error);
return '';
}
}
@@ -159,26 +122,17 @@ export class NodesApi extends RepoApi {
const sharedId = await this.getNodeProperty(nodeId, 'qshare:sharedId');
return sharedId || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getSharedId.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getSharedId.name}`, error);
return '';
}
}
async getSharedExpiryDate(nodeId: string): Promise {
try {
- const expiryDate = await this.getNodeProperty(
- nodeId,
- 'qshare:expiryDate'
- );
+ const expiryDate = await this.getNodeProperty(nodeId, 'qshare:expiryDate');
return expiryDate || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getSharedExpiryDate.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getSharedExpiryDate.name}`, error);
return '';
}
}
@@ -188,10 +142,7 @@ export class NodesApi extends RepoApi {
const sharedId = await this.getSharedId(nodeId);
return sharedId !== '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.isFileShared.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.isFileShared.name}`, error);
return null;
}
}
@@ -201,69 +152,42 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
await this.nodesApi.deleteNode(id, { permanent });
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteNodeById.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteNodeById.name}`, error);
}
}
- async deleteNodeByPath(
- path: string,
- permanent: boolean = true
- ): Promise {
+ async deleteNodeByPath(path: string, permanent: boolean = true): Promise {
try {
const id = (await this.getNodeByPath(path)).entry.id;
await this.deleteNodeById(id, permanent);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteNodeByPath.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteNodeByPath.name}`, error);
}
}
- async deleteNodes(
- names: string[],
- relativePath: string = '',
- permanent: boolean = true
- ): Promise {
+ async deleteNodes(names: string[], relativePath: string = '', permanent: boolean = true): Promise {
try {
await names.reduce(async (previous, current) => {
await previous;
- const req = await this.deleteNodeByPath(
- `${relativePath}/${current}`,
- permanent
- );
+ const req = await this.deleteNodeByPath(`${relativePath}/${current}`, permanent);
return req;
}, Promise.resolve());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteNodes.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteNodes.name}`, error);
}
}
- async deleteNodesById(
- ids: string[],
- permanent: boolean = true
- ): Promise {
+ async deleteNodesById(ids: string[], permanent: boolean = true): Promise {
try {
for (const id of ids) {
await this.deleteNodeById(id, permanent);
}
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteNodesById.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteNodesById.name}`, error);
}
}
- async getNodeChildren(
- nodeId: string
- ): Promise {
+ async getNodeChildren(nodeId: string): Promise {
try {
const opts = {
include: ['properties']
@@ -271,61 +195,35 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return await this.nodesApi.listNodeChildren(nodeId, opts);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeChildren.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeChildren.name}`, error);
return null;
}
}
- async deleteNodeChildren(
- parentId: string,
- exceptNodesNamed?: string[]
- ): Promise {
+ async deleteNodeChildren(parentId: string, exceptNodesNamed?: string[]): Promise {
try {
const listEntries = (await this.getNodeChildren(parentId)).list.entries;
let nodeIds: string[];
if (exceptNodesNamed) {
- nodeIds = listEntries
- .filter(entries => !exceptNodesNamed.includes(entries.entry.name))
- .map(entries => entries.entry.id);
+ nodeIds = listEntries.filter((entries) => !exceptNodesNamed.includes(entries.entry.name)).map((entries) => entries.entry.id);
} else {
- nodeIds = listEntries.map(entries => entries.entry.id);
+ nodeIds = listEntries.map((entries) => entries.entry.id);
}
await this.deleteNodesById(nodeIds);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteNodeChildren.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteNodeChildren.name}`, error);
}
}
- async createImageNode(
- name: string,
- parentId: string = '-my-',
- title: string = '',
- description: string = ''
- ): Promise {
+ async createImageNode(name: string, parentId: string = '-my-', title: string = '', description: string = ''): Promise {
const imageProps = {
'exif:pixelXDimension': 1000,
'exif:pixelYDimension': 1200
};
try {
- return await this.createNode(
- 'cm:content',
- name,
- parentId,
- title,
- description,
- imageProps
- );
+ return await this.createNode('cm:content', name, parentId, title, description, imageProps);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createImageNode.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createImageNode.name}`, error);
return null;
}
}
@@ -364,10 +262,7 @@ export class NodesApi extends RepoApi {
majorVersion
});
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createNode.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createNode.name}`, error);
return null;
}
}
@@ -382,39 +277,18 @@ export class NodesApi extends RepoApi {
aspectNames: string[] = null
): Promise {
try {
- return await this.createNode(
- 'cm:content',
- name,
- parentId,
- title,
- description,
- null,
- author,
- majorVersion,
- aspectNames
- );
+ return await this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion, aspectNames);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createFile.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createFile.name}`, error);
return null;
}
}
- async createImage(
- name: string,
- parentId: string = '-my-',
- title: string = '',
- description: string = ''
- ): Promise {
+ async createImage(name: string, parentId: string = '-my-', title: string = '', description: string = ''): Promise {
try {
return await this.createImageNode(name, parentId, title, description);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createImage.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createImage.name}`, error);
return null;
}
}
@@ -428,22 +302,9 @@ export class NodesApi extends RepoApi {
aspectNames: string[] = null
): Promise {
try {
- return await this.createNode(
- 'cm:folder',
- name,
- parentId,
- title,
- description,
- null,
- author,
- null,
- aspectNames
- );
+ return await this.createNode('cm:folder', name, parentId, title, description, null, author, null, aspectNames);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createFolder.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createFolder.name}`, error);
return null;
}
}
@@ -453,54 +314,31 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return await this.nodesApi.createNode('-my-', data as any);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createChildren.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createChildren.name}`, error);
}
}
- async createContent(
- content: NodeContentTree,
- relativePath: string = '/'
- ): Promise {
+ async createContent(content: NodeContentTree, relativePath: string = '/'): Promise {
try {
- return await this.createChildren(
- flattenNodeContentTree(content, relativePath)
- );
+ return await this.createChildren(flattenNodeContentTree(content, relativePath));
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createContent.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createContent.name}`, error);
}
}
- async createFolders(
- names: string[],
- relativePath: string = '/'
- ): Promise {
+ async createFolders(names: string[], relativePath: string = '/'): Promise {
try {
return await this.createContent({ folders: names }, relativePath);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createFolders.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createFolders.name}`, error);
}
}
- async createFiles(
- names: string[],
- relativePath: string = '/'
- ): Promise {
+ async createFiles(names: string[], relativePath: string = '/'): Promise {
try {
return await this.createContent({ files: names }, relativePath);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createFiles.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createFiles.name}`, error);
}
}
@@ -509,18 +347,12 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return this.nodesApi.updateNode(nodeId, { aspectNames });
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.addAspects.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.addAspects.name}`, error);
return null;
}
}
- async createFileLink(
- originalNodeId: string,
- destinationId: string
- ): Promise {
+ async createFileLink(originalNodeId: string, destinationId: string): Promise {
const name = (await this.getNodeById(originalNodeId)).entry.name;
const nodeBody = {
name: `Link to ${name}.url`,
@@ -536,18 +368,12 @@ export class NodesApi extends RepoApi {
await this.addAspects(originalNodeId, ['app:linked']);
return link;
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createFileLink.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createFileLink.name}`, error);
return null;
}
}
- async createFolderLink(
- originalNodeId: string,
- destinationId: string
- ): Promise {
+ async createFolderLink(originalNodeId: string, destinationId: string): Promise {
const name = (await this.getNodeById(originalNodeId)).entry.name;
const nodeBody = {
name: `Link to ${name}.url`,
@@ -566,10 +392,7 @@ export class NodesApi extends RepoApi {
await this.addAspects(originalNodeId, ['app:linked']);
return link;
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createFolderLink.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createFolderLink.name}`, error);
return null;
}
}
@@ -580,25 +403,16 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return await this.nodesApi.getNodeContent(nodeId);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getNodeContent.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getNodeContent.name}`, error);
}
}
- async editNodeContent(
- nodeId: string,
- content: string
- ): Promise {
+ async editNodeContent(nodeId: string, content: string): Promise {
try {
await this.apiAuth();
return await this.nodesApi.updateNodeContent(nodeId, content);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.editNodeContent.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.editNodeContent.name}`, error);
return null;
}
}
@@ -608,19 +422,13 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return this.nodesApi.updateNode(nodeId, { name: newName });
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.renameNode.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.renameNode.name}`, error);
return null;
}
}
// node permissions
- async setInheritPermissions(
- nodeId: string,
- inheritPermissions: boolean
- ): Promise {
+ async setInheritPermissions(nodeId: string, inheritPermissions: boolean): Promise {
const data = {
permissions: {
isInheritanceEnabled: inheritPermissions
@@ -631,20 +439,12 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return await this.nodesApi.updateNode(nodeId, data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.setGranularPermission.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.setGranularPermission.name}`, error);
return null;
}
}
- async setGranularPermission(
- nodeId: string,
- inheritPermissions: boolean = false,
- username: string,
- role: string
- ): Promise {
+ async setGranularPermission(nodeId: string, inheritPermissions: boolean = false, username: string, role: string): Promise {
const data = {
permissions: {
isInheritanceEnabled: inheritPermissions,
@@ -661,19 +461,13 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return await this.nodesApi.updateNode(nodeId, data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.setGranularPermission.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.setGranularPermission.name}`, error);
return null;
}
}
// lock node
- async lockFile(
- nodeId: string,
- lockType: string = 'ALLOW_OWNER_CHANGES'
- ): Promise {
+ async lockFile(nodeId: string, lockType: string = 'ALLOW_OWNER_CHANGES'): Promise {
const data = {
type: lockType
} as NodeBodyLock;
@@ -692,10 +486,7 @@ export class NodesApi extends RepoApi {
await this.apiAuth();
return await this.nodesApi.unlockNode(nodeId);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.unlockFile.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.unlockFile.name}`, error);
return null;
}
}
@@ -705,10 +496,7 @@ export class NodesApi extends RepoApi {
const lockType = await this.getNodeProperty(nodeId, 'cm:lockType');
return lockType || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getLockType.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getLockType.name}`, error);
return '';
}
}
@@ -718,10 +506,7 @@ export class NodesApi extends RepoApi {
const lockOwner = await this.getNodeProperty(nodeId, 'cm:lockOwner');
return lockOwner || '';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getLockOwner.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getLockOwner.name}`, error);
return '';
}
}
@@ -730,18 +515,12 @@ export class NodesApi extends RepoApi {
try {
return (await this.getLockType(nodeId)) === 'WRITE_LOCK';
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.isFileLockedWrite.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.isFileLockedWrite.name}`, error);
return null;
}
}
- async isFileLockedWriteWithRetry(
- nodeId: string,
- expect: boolean
- ): Promise {
+ async isFileLockedWriteWithRetry(nodeId: string, expect: boolean): Promise {
const data = {
expect: expect,
retry: 5
@@ -758,26 +537,17 @@ export class NodesApi extends RepoApi {
};
return await Utils.retryCall(locked, data.retry);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.isFileLockedWriteWithRetry.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.isFileLockedWriteWithRetry.name}`, error);
}
return isLocked;
}
- async isFileLockedByName(
- fileName: string,
- parentId: string
- ): Promise {
+ async isFileLockedByName(fileName: string, parentId: string): Promise {
try {
const id = await this.getNodeIdFromParent(fileName, parentId);
return await this.isFileLockedWrite(id);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.isFileLockedByName.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.isFileLockedByName.name}`, error);
return null;
}
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/people/people-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/people/people-api.ts
index 97de5ab04..db310e3b3 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/people/people-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/people/people-api.ts
@@ -40,10 +40,7 @@ export class PeopleApi extends RepoApi {
await this.apiAuth();
return await this.peopleApi.createPerson(person);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createUser.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createUser.name}`, error);
return null;
}
}
@@ -63,10 +60,7 @@ export class PeopleApi extends RepoApi {
await this.apiAuth();
return this.peopleApi.updatePerson(username, userDetails);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.updateUser.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.updateUser.name}`, error);
return null;
}
}
@@ -75,10 +69,7 @@ export class PeopleApi extends RepoApi {
try {
return await this.updateUser(username, { enabled: false });
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.disableUser.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.disableUser.name}`, error);
return null;
}
}
@@ -87,10 +78,7 @@ export class PeopleApi extends RepoApi {
try {
return await this.updateUser(username, { password: newPassword });
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.changePassword.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.changePassword.name}`, error);
return null;
}
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/queries/queries-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/queries/queries-api.ts
index 8ffcff9c9..d9a605fcc 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/queries/queries-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/queries/queries-api.ts
@@ -45,10 +45,7 @@ export class QueriesApi extends RepoApi {
await this.apiAuth();
return this.queriesApi.findSites(searchTerm, data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.findSites.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.findSites.name}`, error);
return null;
}
}
@@ -63,10 +60,7 @@ export class QueriesApi extends RepoApi {
await this.apiAuth();
return this.queriesApi.findNodes(searchTerm, data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.findNodes.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.findNodes.name}`, error);
return null;
}
}
@@ -74,8 +68,7 @@ export class QueriesApi extends RepoApi {
async waitForSites(searchTerm: string, data: { expect: number }) {
try {
const sites = async () => {
- const totalItems = (await this.findSites(searchTerm)).list.pagination
- .totalItems;
+ const totalItems = (await this.findSites(searchTerm)).list.pagination.totalItems;
if (totalItems !== data.expect) {
return Promise.reject(totalItems);
} else {
@@ -85,9 +78,7 @@ export class QueriesApi extends RepoApi {
return await Utils.retryCall(sites);
} catch (error) {
- Logger.error(
- `${this.constructor.name} ${this.waitForSites.name} catch: `
- );
+ Logger.error(`${this.constructor.name} ${this.waitForSites.name} catch: `);
Logger.error(`\tExpected: ${data.expect} items, but found ${error}`);
}
}
@@ -95,8 +86,7 @@ export class QueriesApi extends RepoApi {
async waitForFilesAndFolders(searchTerm: string, data: { expect: number }) {
try {
const nodes = async () => {
- const totalItems = (await this.findNodes(searchTerm)).list.pagination
- .totalItems;
+ const totalItems = (await this.findNodes(searchTerm)).list.pagination.totalItems;
if (totalItems !== data.expect) {
return Promise.reject(totalItems);
} else {
@@ -106,9 +96,7 @@ export class QueriesApi extends RepoApi {
return await Utils.retryCall(nodes);
} catch (error) {
- Logger.error(
- `${this.constructor.name} ${this.waitForFilesAndFolders.name} catch: `
- );
+ Logger.error(`${this.constructor.name} ${this.waitForFilesAndFolders.name} catch: `);
Logger.error(`\tExpected: ${data.expect} items, but found ${error}`);
}
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/repo-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/repo-api.ts
index 6a59cf76d..0da29219d 100644
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/repo-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/repo-api.ts
@@ -30,10 +30,7 @@ import { Logger } from '@alfresco/adf-testing';
export abstract class RepoApi {
alfrescoJsApi = new AlfrescoApi();
- constructor(
- private username: string = browser.params.ADMIN_USERNAME,
- private password: string = browser.params.ADMIN_PASSWORD
- ) {
+ constructor(private username: string = browser.params.ADMIN_USERNAME, private password: string = browser.params.ADMIN_PASSWORD) {
this.alfrescoJsApi.setConfig(browser.params.config);
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/search/search-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/search/search-api.ts
index 8772afe37..9bea4b313 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/search/search-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/search/search-api.ts
@@ -31,7 +31,7 @@ import { SearchApi as AdfSearchApi } from '@alfresco/js-api';
export class SearchApi extends RepoApi {
searchApi = new AdfSearchApi(this.alfrescoJsApi);
- constructor(username?, password?) {
+ constructor(username?: string, password?: string) {
super(username, password);
}
@@ -52,10 +52,7 @@ export class SearchApi extends RepoApi {
await this.apiAuth();
return this.searchApi.search(data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.queryRecentFiles.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.queryRecentFiles.name}`, error);
return null;
}
}
@@ -73,10 +70,7 @@ export class SearchApi extends RepoApi {
await this.apiAuth();
return this.searchApi.search(data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.queryNodesNames.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.queryNodesNames.name}`, error);
return null;
}
}
@@ -94,10 +88,7 @@ export class SearchApi extends RepoApi {
await this.apiAuth();
return this.searchApi.search(data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.queryNodesExactNames.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.queryNodesExactNames.name}`, error);
return null;
}
}
@@ -105,8 +96,7 @@ export class SearchApi extends RepoApi {
async waitForApi(username: string, data: { expect: number }) {
try {
const recentFiles = async () => {
- const totalItems = (await this.queryRecentFiles(username)).list
- .pagination.totalItems;
+ const totalItems = (await this.queryRecentFiles(username)).list.pagination.totalItems;
if (totalItems !== data.expect) {
return Promise.reject(totalItems);
} else {
@@ -124,8 +114,7 @@ export class SearchApi extends RepoApi {
async waitForNodes(searchTerm: string, data: { expect: number }) {
try {
const nodes = async () => {
- const totalItems = (await this.queryNodesNames(searchTerm)).list
- .pagination.totalItems;
+ const totalItems = (await this.queryNodesNames(searchTerm)).list.pagination.totalItems;
if (totalItems !== data.expect) {
return Promise.reject(totalItems);
} else {
@@ -135,9 +124,7 @@ export class SearchApi extends RepoApi {
return await Utils.retryCall(nodes);
} catch (error) {
- Logger.error(
- `${this.constructor.name} ${this.waitForNodes.name} catch: `
- );
+ Logger.error(`${this.constructor.name} ${this.waitForNodes.name} catch: `);
Logger.error(`\tExpected: ${data.expect} items, but found ${error}`);
}
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/shared-links/shared-links-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/shared-links/shared-links-api.ts
index 74d60afe8..a7ef65bc1 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/shared-links/shared-links-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/shared-links/shared-links-api.ts
@@ -26,22 +26,16 @@
import { RepoApi } from '../repo-api';
import { Logger } from '@alfresco/adf-testing';
import { Utils } from '../../../../utilities/utils';
-import {
- SharedlinksApi as AdfSharedlinksApi,
- SharedLinkEntry
-} from '@alfresco/js-api';
+import { SharedlinksApi as AdfSharedlinksApi, SharedLinkEntry } from '@alfresco/js-api';
export class SharedLinksApi extends RepoApi {
sharedlinksApi = new AdfSharedlinksApi(this.alfrescoJsApi);
- constructor(username?, password?) {
+ constructor(username?: string, password?: string) {
super(username, password);
}
- async shareFileById(
- id: string,
- expireDate?: Date
- ): Promise {
+ async shareFileById(id: string, expireDate?: Date): Promise {
try {
await this.apiAuth();
const data = {
@@ -50,10 +44,7 @@ export class SharedLinksApi extends RepoApi {
};
return await this.sharedlinksApi.createSharedLink(data);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.shareFileById.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.shareFileById.name}`, error);
return null;
}
}
@@ -65,25 +56,17 @@ export class SharedLinksApi extends RepoApi {
return this.shareFileById(current);
}, Promise.resolve());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.shareFilesByIds.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.shareFilesByIds.name}`, error);
}
}
async getSharedIdOfNode(name: string) {
try {
const sharedLinks = (await this.getSharedLinks()).list.entries;
- const found = sharedLinks.find(
- sharedLink => sharedLink.entry.name === name
- );
+ const found = sharedLinks.find((sharedLink) => sharedLink.entry.name === name);
return (found || { entry: { id: null } }).entry.id;
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getSharedIdOfNode.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getSharedIdOfNode.name}`, error);
return null;
}
}
@@ -93,10 +76,7 @@ export class SharedLinksApi extends RepoApi {
const id = await this.getSharedIdOfNode(name);
return await this.sharedlinksApi.deleteSharedLink(id);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.unshareFile.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.unshareFile.name}`, error);
}
}
@@ -105,10 +85,7 @@ export class SharedLinksApi extends RepoApi {
await this.apiAuth();
return await this.sharedlinksApi.listSharedLinks();
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getSharedLinks.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getSharedLinks.name}`, error);
return null;
}
}
@@ -116,8 +93,7 @@ export class SharedLinksApi extends RepoApi {
async waitForApi(data: { expect: number }) {
try {
const sharedFiles = async () => {
- const totalItems = (await this.getSharedLinks()).list.pagination
- .totalItems;
+ const totalItems = (await this.getSharedLinks()).list.pagination.totalItems;
if (totalItems !== data.expect) {
return Promise.reject(totalItems);
} else {
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/sites/sites-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/sites/sites-api.ts
index 120ba3f2f..a103cb22d 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/sites/sites-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/sites/sites-api.ts
@@ -40,7 +40,7 @@ import { Utils } from '../../../../utilities/utils';
export class SitesApi extends RepoApi {
sitesApi = new AdfSiteApi(this.alfrescoJsApi);
- constructor(username?, password?) {
+ constructor(username?: string, password?: string) {
super(username, password);
}
@@ -57,9 +57,7 @@ export class SitesApi extends RepoApi {
async getSites() {
try {
await this.apiAuth();
- return await this.sitesApi.listSiteMembershipsForPerson(
- this.getUsername()
- );
+ return await this.sitesApi.listSiteMembershipsForPerson(this.getUsername());
} catch (error) {
this.handleError(`${this.constructor.name} ${this.getSites.name}`, error);
return null;
@@ -69,13 +67,9 @@ export class SitesApi extends RepoApi {
async getDocLibId(siteId: string) {
try {
await this.apiAuth();
- return (await this.sitesApi.listSiteContainers(siteId)).list.entries[0]
- .entry.id;
+ return (await this.sitesApi.listSiteContainers(siteId)).list.entries[0].entry.id;
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getDocLibId.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getDocLibId.name}`, error);
return null;
}
}
@@ -85,10 +79,7 @@ export class SitesApi extends RepoApi {
const site = await this.getSite(siteId);
return site.entry.visibility;
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getVisibility.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getVisibility.name}`, error);
return null;
}
}
@@ -98,10 +89,7 @@ export class SitesApi extends RepoApi {
const site = await this.getSite(siteId);
return site.entry.description;
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getDescription.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getDescription.name}`, error);
return null;
}
}
@@ -116,12 +104,7 @@ export class SitesApi extends RepoApi {
}
}
- async createSite(
- title: string,
- visibility?: string,
- description?: string,
- siteId?: string
- ): Promise {
+ async createSite(title: string, visibility?: string, description?: string, siteId?: string): Promise {
const site = {
title,
visibility: visibility || SITE_VISIBILITY.PUBLIC,
@@ -133,33 +116,17 @@ export class SitesApi extends RepoApi {
await this.apiAuth();
return await this.sitesApi.createSite(site);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createSite.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createSite.name}`, error);
return null;
}
}
- async createSitePrivate(
- title: string,
- description?: string,
- siteId?: string
- ): Promise {
+ async createSitePrivate(title: string, description?: string, siteId?: string): Promise {
return this.createSite(title, SITE_VISIBILITY.PRIVATE, description, siteId);
}
- async createSiteModerated(
- title: string,
- description?: string,
- siteId?: string
- ): Promise {
- return this.createSite(
- title,
- SITE_VISIBILITY.MODERATED,
- description,
- siteId
- );
+ async createSiteModerated(title: string, description?: string, siteId?: string): Promise {
+ return this.createSite(title, SITE_VISIBILITY.MODERATED, description, siteId);
}
async createSites(titles: string[], visibility?: string): Promise {
@@ -169,10 +136,7 @@ export class SitesApi extends RepoApi {
return this.createSite(current, visibility);
}, Promise.resolve());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.createSites.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.createSites.name}`, error);
}
}
@@ -185,10 +149,7 @@ export class SitesApi extends RepoApi {
await this.apiAuth();
return await this.sitesApi.deleteSite(siteId, { permanent });
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteSite.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteSite.name}`, error);
}
}
@@ -199,28 +160,20 @@ export class SitesApi extends RepoApi {
return this.deleteSite(current, permanent);
}, Promise.resolve());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteSites.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteSites.name}`, error);
}
}
async deleteAllUserSites(permanent: boolean = true) {
try {
- const siteIds = (await this.getSites()).list.entries.map(
- entries => entries.entry.id
- );
+ const siteIds = (await this.getSites()).list.entries.map((entries) => entries.entry.id);
return await siteIds.reduce(async (previous, current) => {
await previous;
return this.deleteSite(current, permanent);
}, Promise.resolve());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteAllUserSites.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteAllUserSites.name}`, error);
}
}
@@ -233,10 +186,7 @@ export class SitesApi extends RepoApi {
await this.apiAuth();
return await this.sitesApi.updateSiteMembership(siteId, userId, siteRole);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.updateSiteMember.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.updateSiteMember.name}`, error);
return null;
}
}
@@ -251,43 +201,24 @@ export class SitesApi extends RepoApi {
await this.apiAuth();
return await this.sitesApi.createSiteMembership(siteId, memberBody);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.addSiteMember.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.addSiteMember.name}`, error);
return null;
}
}
- async addSiteConsumer(
- siteId: string,
- userId: string
- ): Promise {
+ async addSiteConsumer(siteId: string, userId: string): Promise {
return this.addSiteMember(siteId, userId, SITE_ROLES.SITE_CONSUMER.ROLE);
}
- async addSiteContributor(
- siteId: string,
- userId: string
- ): Promise {
+ async addSiteContributor(siteId: string, userId: string): Promise {
return this.addSiteMember(siteId, userId, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
}
- async addSiteCollaborator(
- siteId: string,
- userId: string
- ): Promise {
- return this.addSiteMember(
- siteId,
- userId,
- SITE_ROLES.SITE_COLLABORATOR.ROLE
- );
+ async addSiteCollaborator(siteId: string, userId: string): Promise {
+ return this.addSiteMember(siteId, userId, SITE_ROLES.SITE_COLLABORATOR.ROLE);
}
- async addSiteManager(
- siteId: string,
- userId: string
- ): Promise {
+ async addSiteManager(siteId: string, userId: string): Promise {
return this.addSiteMember(siteId, userId, SITE_ROLES.SITE_MANAGER.ROLE);
}
@@ -296,31 +227,20 @@ export class SitesApi extends RepoApi {
await this.apiAuth();
return await this.sitesApi.deleteSiteMembership(siteId, userId);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.deleteSiteMember.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.deleteSiteMember.name}`, error);
}
}
- async requestToJoin(
- siteId: string
- ): Promise {
+ async requestToJoin(siteId: string): Promise {
const body = {
id: siteId
};
try {
await this.apiAuth();
- return await this.sitesApi.createSiteMembershipRequestForPerson(
- '-me-',
- body
- );
+ return await this.sitesApi.createSiteMembershipRequestForPerson('-me-', body);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.requestToJoin.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.requestToJoin.name}`, error);
return null;
}
}
@@ -328,15 +248,10 @@ export class SitesApi extends RepoApi {
async hasMembershipRequest(siteId: string) {
try {
await this.apiAuth();
- const requests = (
- await this.sitesApi.getSiteMembershipRequests('-me-')
- ).list.entries.map(e => e.entry.id);
+ const requests = (await this.sitesApi.getSiteMembershipRequests('-me-')).list.entries.map((e) => e.entry.id);
return requests.includes(siteId);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.hasMembershipRequest.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.hasMembershipRequest.name}`, error);
return null;
}
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/trashcan/trashcan-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/trashcan/trashcan-api.ts
index 15846d192..d5625fc73 100644
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/trashcan/trashcan-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/trashcan/trashcan-api.ts
@@ -40,10 +40,7 @@ export class TrashcanApi extends RepoApi {
await this.apiAuth();
return await this.trashcanApi.deleteDeletedNode(id);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.permanentlyDelete.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.permanentlyDelete.name}`, error);
}
}
@@ -65,37 +62,28 @@ export class TrashcanApi extends RepoApi {
await this.apiAuth();
return await this.trashcanApi.listDeletedNodes(opts);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.getDeletedNodes.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.getDeletedNodes.name}`, error);
return null;
}
}
async emptyTrash() {
try {
- const ids = (await this.getDeletedNodes()).list.entries.map(
- entries => entries.entry.id
- );
+ const ids = (await this.getDeletedNodes()).list.entries.map((entries) => entries.entry.id);
return await ids.reduce(async (previous, current) => {
await previous;
return this.permanentlyDelete(current);
}, Promise.resolve());
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.emptyTrash.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.emptyTrash.name}`, error);
}
}
async waitForApi(data: { expect: number }) {
try {
const deletedFiles = async () => {
- const totalItems = (await this.getDeletedNodes()).list.pagination
- .totalItems;
+ const totalItems = (await this.getDeletedNodes()).list.pagination.totalItems;
if (totalItems !== data.expect) {
return Promise.reject(totalItems);
} else {
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/upload/upload-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/upload/upload-api.ts
index e98acaa17..0597c4bb3 100644
--- a/projects/aca-testing-shared/src/utilities/repo-client/apis/upload/upload-api.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/upload/upload-api.ts
@@ -26,23 +26,20 @@
import { RepoApi } from '../repo-api';
import { UploadApi as AdfUploadApi } from '@alfresco/js-api';
import { browser } from 'protractor';
-
-const fs = require('fs');
+import * as fs from 'fs';
export class UploadApi extends RepoApi {
upload = new AdfUploadApi(this.alfrescoJsApi);
e2eRootPath = browser.params.e2eRootPath;
- constructor(username?, password?) {
+ constructor(username?: string, password?: string) {
super(username, password);
}
async uploadFile(fileName: string, parentFolderId: string = '-my-') {
- const file = fs.createReadStream(
- `${this.e2eRootPath}/resources/test-files/${fileName}`
- );
+ const file = fs.createReadStream(`${this.e2eRootPath}/resources/test-files/${fileName}`);
const opts = {
- name: file.name,
+ name: fileName,
nodeType: 'cm:content'
};
@@ -50,23 +47,12 @@ export class UploadApi extends RepoApi {
await this.apiAuth();
return await this.upload.uploadFile(file, '', parentFolderId, null, opts);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.uploadFile.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.uploadFile.name}`, error);
}
}
- async uploadFileWithRename(
- fileName: string,
- parentId: string = '-my-',
- newName: string,
- title: string = '',
- description: string = ''
- ) {
- const file = fs.createReadStream(
- `${this.e2eRootPath}/resources/test-files/${fileName}`
- );
+ async uploadFileWithRename(fileName: string, parentId: string = '-my-', newName: string, title: string = '', description: string = '') {
+ const file = fs.createReadStream(`${this.e2eRootPath}/resources/test-files/${fileName}`);
const nodeProps = {
properties: {
'cm:title': title,
@@ -83,10 +69,7 @@ export class UploadApi extends RepoApi {
await this.apiAuth();
return await this.upload.uploadFile(file, '', parentId, nodeProps, opts);
} catch (error) {
- this.handleError(
- `${this.constructor.name} ${this.uploadFileWithRename.name}`,
- error
- );
+ this.handleError(`${this.constructor.name} ${this.uploadFileWithRename.name}`, error);
}
}
}
diff --git a/projects/aca-testing-shared/src/utilities/repo-client/repo-client.ts b/projects/aca-testing-shared/src/utilities/repo-client/repo-client.ts
index e1e280b73..6e02fa3d4 100755
--- a/projects/aca-testing-shared/src/utilities/repo-client/repo-client.ts
+++ b/projects/aca-testing-shared/src/utilities/repo-client/repo-client.ts
@@ -37,10 +37,7 @@ import { UploadApi } from './apis/upload/upload-api';
import { AuthenticationApi } from './apis/authentication/authentication-api';
export class RepoClient {
- constructor(
- private username: string = browser.params.ADMIN_USERNAME,
- private password: string = browser.params.ADMIN_PASSWORD
- ) {}
+ constructor(private username: string = browser.params.ADMIN_USERNAME, private password: string = browser.params.ADMIN_PASSWORD) {}
private get auth() {
const { username, password } = this;
diff --git a/projects/aca-testing-shared/src/utilities/utils.ts b/projects/aca-testing-shared/src/utilities/utils.ts
index 1d7875824..25bd7aafe 100644
--- a/projects/aca-testing-shared/src/utilities/utils.ts
+++ b/projects/aca-testing-shared/src/utilities/utils.ts
@@ -23,116 +23,57 @@
* along with Alfresco. If not, see .
*/
-import {
- browser,
- protractor,
- ElementFinder,
- ExpectedConditions as EC,
- by,
- logging,
- until,
- WebElement
-} from 'protractor';
+import { browser, protractor, ElementFinder, ExpectedConditions as EC, by, logging, until, WebElement } from 'protractor';
import { Logger } from '@alfresco/adf-testing';
import { BROWSER_WAIT_TIMEOUT } from '../configs';
+import * as path from 'path';
+import * as fs from 'fs';
-const path = require('path');
-const fs = require('fs');
const StreamZip = require('node-stream-zip');
-export async function typeText(
- element: ElementFinder,
- text: string
-): Promise {
+export async function typeText(element: ElementFinder, text: string): Promise {
await element.clear();
await element.sendKeys(text);
}
-export async function clearTextWithBackspace(
- element: ElementFinder
-): Promise {
+export async function clearTextWithBackspace(element: ElementFinder): Promise {
await element.clear();
- await element.sendKeys(
- ' ',
- protractor.Key.CONTROL,
- 'a',
- protractor.Key.NULL,
- protractor.Key.BACK_SPACE
- );
+ await element.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
}
-export async function waitElement(
- css: string,
- errorMessage?: string
-): Promise {
- return browser.wait(
- until.elementLocated(by.css(css)),
- BROWSER_WAIT_TIMEOUT,
- errorMessage || `Timeout waiting for element: ${css}`
- );
+export async function waitElement(css: string, errorMessage?: string): Promise {
+ return browser.wait(until.elementLocated(by.css(css)), BROWSER_WAIT_TIMEOUT, errorMessage || `Timeout waiting for element: ${css}`);
}
-export async function waitForClickable(
- element: ElementFinder,
- errorMessage?: string
-): Promise {
+export async function waitForClickable(element: ElementFinder, errorMessage?: string): Promise {
await browser.wait(
EC.elementToBeClickable(element),
BROWSER_WAIT_TIMEOUT,
- errorMessage ||
- `Timeout waiting for element to be clickable: ${element.locator()}`
+ errorMessage || `Timeout waiting for element to be clickable: ${element.locator()}`
);
}
-export async function waitForVisibility(
- element: ElementFinder,
- errorMessage?: string
-): Promise {
- await browser.wait(
- EC.visibilityOf(element),
- BROWSER_WAIT_TIMEOUT,
- errorMessage ||
- `Timeout waiting for element visibility: ${element.locator()}`
- );
+export async function waitForVisibility(element: ElementFinder, errorMessage?: string): Promise {
+ await browser.wait(EC.visibilityOf(element), BROWSER_WAIT_TIMEOUT, errorMessage || `Timeout waiting for element visibility: ${element.locator()}`);
}
-export async function waitForInvisibility(
- element: ElementFinder,
- errorMessage?: string
-): Promise {
+export async function waitForInvisibility(element: ElementFinder, errorMessage?: string): Promise {
await browser.wait(
EC.invisibilityOf(element),
BROWSER_WAIT_TIMEOUT,
- errorMessage ||
- `Timeout waiting for element visibility: ${element.locator()}`
+ errorMessage || `Timeout waiting for element visibility: ${element.locator()}`
);
}
-export async function waitForPresence(
- element: ElementFinder,
- errorMessage?: string
-): Promise {
- await browser.wait(
- EC.presenceOf(element),
- BROWSER_WAIT_TIMEOUT,
- errorMessage || `Timeout waiting for element presence: ${element.locator()}`
- );
+export async function waitForPresence(element: ElementFinder, errorMessage?: string): Promise