From ffac56f7e13d01f2bcfff9a1b9a0f2611848ec67 Mon Sep 17 00:00:00 2001 From: Mykyta Maliarchuk Date: Wed, 4 Oct 2023 19:20:05 +0200 Subject: [PATCH] [ACS-5994] redundant method removed --- .../files-folders/folders-actions.test.ts | 2 +- .../locked-files-actions.test.ts | 2 +- .../multiple-files-actions.test.ts | 2 +- .../office-files-actions.test.ts | 2 +- .../files-folders/single-file-actions.test.ts | 2 +- .../files-folders/trash.test.ts | 2 +- .../suites/actions/copy-move/copy.test.ts | 3 ++- .../destination-picker-dialog.test.ts | 4 ++-- .../create/create-file-from-template.test.ts | 2 +- .../create-folder-from-template.test.ts | 2 +- .../actions/create/create-folder.test.ts | 2 +- .../actions/delete/delete-undo-delete.test.ts | 2 +- .../actions/delete/permanently-delete.test.ts | 2 +- .../suites/actions/delete/restore.test.ts | 20 +++++++++---------- .../suites/actions/edit/edit-offline.test.ts | 2 +- .../actions/favorite/mark-favorite.test.ts | 2 +- .../suites/actions/share/share-file.test.ts | 6 +++--- .../share/unshare-file-search-results.test.ts | 2 +- .../actions/upload-download/download.test.ts | 2 +- .../upload-download/upload-file.test.ts | 2 +- .../upload-new-version.test.ts | 2 +- .../upload-download/version-actions.test.ts | 2 +- .../extensions/ext-context-submenus.test.ts | 2 +- .../suites/extensions/ext-info-drawer.test.ts | 2 +- .../suites/extensions/ext-metadata.test.ts | 2 +- .../suites/info-drawer/comments.test.ts | 2 +- .../suites/info-drawer/general.test.ts | 2 +- .../suites/list-views/favorites.test.ts | 4 ++-- .../suites/list-views/generic-errors.test.ts | 4 ++-- .../suites/list-views/recent-files.test.ts | 4 ++-- .../suites/list-views/tooltips.test.ts | 5 +++-- .../suites/list-views/trash.test.ts | 2 +- .../suites/navigation/single-click.test.ts | 4 ++-- .../pagination/multiple-pages-trash.test.ts | 2 +- .../suites/pagination/single-page.test.ts | 2 +- .../suites/viewer/viewer-actions.test.ts | 8 ++++---- .../repo-client/apis/nodes/nodes-api.ts | 4 +--- .../src/utilities/user-actions.ts | 15 -------------- 38 files changed, 59 insertions(+), 74 deletions(-) diff --git a/e2e/protractor/suites/actions-available/files-folders/folders-actions.test.ts b/e2e/protractor/suites/actions-available/files-folders/folders-actions.test.ts index 312dacbacf..4da4b20d84 100755 --- a/e2e/protractor/suites/actions-available/files-folders/folders-actions.test.ts +++ b/e2e/protractor/suites/actions-available/files-folders/folders-actions.test.ts @@ -70,7 +70,7 @@ describe('Folders - available actions : ', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await userApi.nodes.deleteNodeById(parentId); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/actions-available/files-folders/locked-files-actions.test.ts b/e2e/protractor/suites/actions-available/files-folders/locked-files-actions.test.ts index f73efad717..44167890a1 100755 --- a/e2e/protractor/suites/actions-available/files-folders/locked-files-actions.test.ts +++ b/e2e/protractor/suites/actions-available/files-folders/locked-files-actions.test.ts @@ -75,7 +75,7 @@ describe('Locked Files - available actions : ', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await userApi.nodes.deleteNodeById(parentId); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/actions-available/files-folders/multiple-files-actions.test.ts b/e2e/protractor/suites/actions-available/files-folders/multiple-files-actions.test.ts index 08fd019441..294cb919b2 100755 --- a/e2e/protractor/suites/actions-available/files-folders/multiple-files-actions.test.ts +++ b/e2e/protractor/suites/actions-available/files-folders/multiple-files-actions.test.ts @@ -83,7 +83,7 @@ describe('Multiple Files - available actions : ', () => { afterAll(async () => { await userActions.login(username, username); await userActions.unlockNodes([file1LockedFavId, file2LockedFavId, file3LockedId]); - await userActions.deleteNodes([parentId]); + await userApi.nodes.deleteNodeById(parentId); }); beforeEach(async () => { diff --git a/e2e/protractor/suites/actions-available/files-folders/office-files-actions.test.ts b/e2e/protractor/suites/actions-available/files-folders/office-files-actions.test.ts index 32e893903e..4cb87ce7ae 100755 --- a/e2e/protractor/suites/actions-available/files-folders/office-files-actions.test.ts +++ b/e2e/protractor/suites/actions-available/files-folders/office-files-actions.test.ts @@ -69,7 +69,7 @@ describe('Office Files - available actions : ', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await userApi.nodes.deleteNodeById(parentId); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/actions-available/files-folders/single-file-actions.test.ts b/e2e/protractor/suites/actions-available/files-folders/single-file-actions.test.ts index 02b64e7158..ecb82b08fe 100755 --- a/e2e/protractor/suites/actions-available/files-folders/single-file-actions.test.ts +++ b/e2e/protractor/suites/actions-available/files-folders/single-file-actions.test.ts @@ -74,7 +74,7 @@ describe('Files - available actions : ', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await userApi.nodes.deleteNodeById(parentId); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/actions-available/files-folders/trash.test.ts b/e2e/protractor/suites/actions-available/files-folders/trash.test.ts index 75c8fa9136..e288f33ad3 100755 --- a/e2e/protractor/suites/actions-available/files-folders/trash.test.ts +++ b/e2e/protractor/suites/actions-available/files-folders/trash.test.ts @@ -54,7 +54,7 @@ describe('Trash - available actions : ', () => { await userActions.login(username, username); const initialDeletedTotalItems = await userActions.getTrashcanSize(); - await userActions.deleteNodes([fileInTrashId, file2InTrashId, folderInTrashId, folder2InTrashId], false); + await userApi.nodes.deleteNodesById([fileInTrashId, file2InTrashId, folderInTrashId, folder2InTrashId], false); await userActions.waitForTrashcanSize(initialDeletedTotalItems + 4); await loginPage.loginWith(username); diff --git a/e2e/protractor/suites/actions/copy-move/copy.test.ts b/e2e/protractor/suites/actions/copy-move/copy.test.ts index 7ea7f7a2c2..7319ff8342 100755 --- a/e2e/protractor/suites/actions/copy-move/copy.test.ts +++ b/e2e/protractor/suites/actions/copy-move/copy.test.ts @@ -192,7 +192,8 @@ describe('Copy content', () => { try { await userActions.login(username, username); await userActions.unlockNodes([fileLocked1Id, fileLockedInFolderId]); - await userActions.deleteNodes([sourceId, destinationIdRF, destinationIdPF, destinationIdSF, destinationIdFav, destinationIdSearch]); + + await apis.nodes.deleteNodesById([sourceId, destinationIdRF, destinationIdPF, destinationIdSF, destinationIdFav, destinationIdSearch]); await userActions.deleteSites([siteName]); } catch (error) { Logger.error(`---- afterAll failed : ${error}`); diff --git a/e2e/protractor/suites/actions/copy-move/destination-picker-dialog.test.ts b/e2e/protractor/suites/actions/copy-move/destination-picker-dialog.test.ts index 622709f89b..9687964e73 100755 --- a/e2e/protractor/suites/actions/copy-move/destination-picker-dialog.test.ts +++ b/e2e/protractor/suites/actions/copy-move/destination-picker-dialog.test.ts @@ -123,7 +123,7 @@ describe('Destination picker dialog : ', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([fileId, destinationId]); + await userApi.nodes.deleteNodesById([fileId, destinationId]); await userActions.deleteSites([site]); await consumerApi.nodes.deleteNodeById(fileIdConsumer); @@ -131,7 +131,7 @@ describe('Destination picker dialog : ', () => { await collaboratorApi.nodes.deleteNodeById(fileIdCollaborator); await adminApiActions.login(); - await adminApiActions.deleteNodes([adminFolderId]); + await userApi.nodes.deleteNodeById(adminFolderId); }); afterEach(async () => { diff --git a/e2e/protractor/suites/actions/create/create-file-from-template.test.ts b/e2e/protractor/suites/actions/create/create-file-from-template.test.ts index efeebdb9ff..2290b194b6 100755 --- a/e2e/protractor/suites/actions/create/create-file-from-template.test.ts +++ b/e2e/protractor/suites/actions/create/create-file-from-template.test.ts @@ -128,7 +128,7 @@ describe('Create file from template', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await userApi.nodes.deleteNodeById(parentId); await userActions.deleteSites([siteName]); await adminApiActions.login(); diff --git a/e2e/protractor/suites/actions/create/create-folder-from-template.test.ts b/e2e/protractor/suites/actions/create/create-folder-from-template.test.ts index f97fd3bc46..494c223b9f 100755 --- a/e2e/protractor/suites/actions/create/create-folder-from-template.test.ts +++ b/e2e/protractor/suites/actions/create/create-folder-from-template.test.ts @@ -134,7 +134,7 @@ describe('Create folder from template', () => { }); afterAll(async () => { - await userActions.deleteNodes([parentId]); + await userApi.nodes.deleteNodeById(parentId); await userActions.deleteSites([siteName]); await adminApiActions.login(); diff --git a/e2e/protractor/suites/actions/create/create-folder.test.ts b/e2e/protractor/suites/actions/create/create-folder.test.ts index 31a5129077..32ceae098f 100755 --- a/e2e/protractor/suites/actions/create/create-folder.test.ts +++ b/e2e/protractor/suites/actions/create/create-folder.test.ts @@ -76,7 +76,7 @@ describe('Create folder', () => { afterAll(async () => { await userActions.deleteSites([siteName]); - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); }); describe('on Personal Files', () => { diff --git a/e2e/protractor/suites/actions/delete/delete-undo-delete.test.ts b/e2e/protractor/suites/actions/delete/delete-undo-delete.test.ts index 33811cec94..dd4d733a15 100755 --- a/e2e/protractor/suites/actions/delete/delete-undo-delete.test.ts +++ b/e2e/protractor/suites/actions/delete/delete-undo-delete.test.ts @@ -118,7 +118,7 @@ describe('Delete and undo delete', () => { try { await userActions.login(username, username); await userActions.unlockNodes([fileLocked1Id, fileLocked2Id, fileLocked3Id, fileLocked4Id]); - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); await userActions.emptyTrashcan(); } catch (error) { Logger.error(`----- afterAll failed : ${error}`); diff --git a/e2e/protractor/suites/actions/delete/permanently-delete.test.ts b/e2e/protractor/suites/actions/delete/permanently-delete.test.ts index 31ac11bcd0..065fbe1b65 100755 --- a/e2e/protractor/suites/actions/delete/permanently-delete.test.ts +++ b/e2e/protractor/suites/actions/delete/permanently-delete.test.ts @@ -59,7 +59,7 @@ describe('Permanently delete from Trash', () => { await apis.user.sites.createSite(site); await userActions.login(username, username); - await userActions.deleteNodes([...filesIds, ...foldersIds], false); + await apis.user.nodes.deleteNodesById([...filesIds, ...foldersIds], false); await userActions.deleteSites([site], false); await loginPage.loginWith(username); diff --git a/e2e/protractor/suites/actions/delete/restore.test.ts b/e2e/protractor/suites/actions/delete/restore.test.ts index 35c7fcbfd6..6af729e27e 100755 --- a/e2e/protractor/suites/actions/delete/restore.test.ts +++ b/e2e/protractor/suites/actions/delete/restore.test.ts @@ -62,7 +62,7 @@ describe('Restore from Trash', () => { await apis.user.sites.createSite(site); await userActions.login(username, username); - await userActions.deleteNodes([fileId, folderId], false); + await apis.user.nodes.deleteNodesById([fileId, folderId], false); await userActions.deleteSites([site], false); }); @@ -86,7 +86,7 @@ describe('Restore from Trash', () => { await page.clickPersonalFilesAndWait(); expect(await page.dataTable.isItemPresent(file)).toBe(true, 'Item not displayed in list'); - await userActions.deleteNodes([fileId], false); + await apis.user.nodes.deleteNodeById(fileId, false); }); it('[C280438] restore folder', async () => { @@ -100,7 +100,7 @@ describe('Restore from Trash', () => { await page.clickPersonalFilesAndWait(); expect(await page.dataTable.isItemPresent(folder)).toBe(true, 'Item not displayed in list'); - await userActions.deleteNodes([folderId], false); + await apis.user.nodes.deleteNodeById(folderId, false); }); it('[C290104] restore library', async () => { @@ -128,7 +128,7 @@ describe('Restore from Trash', () => { expect(await page.dataTable.isItemPresent(file)).toBe(true, 'Item not displayed in list'); expect(await page.dataTable.isItemPresent(folder)).toBe(true, 'Item not displayed in list'); - await userActions.deleteNodes([fileId, folderId], false); + await apis.user.nodes.deleteNodesById([fileId, folderId], false); }); it('[C217181] View from notification', async () => { @@ -139,7 +139,7 @@ describe('Restore from Trash', () => { expect(await page.sidenav.isActive('Personal Files')).toBe(true, 'Personal Files sidebar link not active'); expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES); - await userActions.deleteNodes([fileId], false); + await apis.user.nodes.deleteNodeById(fileId, false); }); }); @@ -160,13 +160,13 @@ describe('Restore from Trash', () => { file1Id1 = (await apis.user.nodes.createFile(file1, folder1Id)).entry.id; await userActions.login(username, username); - await userActions.deleteNodes([file1Id1], false); + await apis.user.nodes.deleteNodeById(file1Id1, false); file1Id2 = (await apis.user.nodes.createFile(file1, folder1Id)).entry.id; folder2Id = (await apis.user.nodes.createFolder(folder2)).entry.id; file2Id = (await apis.user.nodes.createFile(file2, folder2Id)).entry.id; - await userActions.deleteNodes([file2Id, folder2Id], false); + await apis.user.nodes.deleteNodesById([file2Id, folder2Id], false); }); beforeEach(async () => { @@ -175,7 +175,7 @@ describe('Restore from Trash', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([file1Id2]); + await apis.user.nodes.deleteNodeById(file1Id2); await userActions.emptyTrashcan(); }); @@ -221,7 +221,7 @@ describe('Restore from Trash', () => { file2Id = (await apis.user.nodes.createFile(file2, folder2Id)).entry.id; await userActions.login(username, username); - await userActions.deleteNodes([file1Id, folder1Id, file2Id], false); + await apis.user.nodes.deleteNodesById([file1Id, folder1Id, file2Id], false); folder3Id = (await apis.user.nodes.createFolder(folder3)).entry.id; file3Id = (await apis.user.nodes.createFile(file3, folder3Id)).entry.id; @@ -229,7 +229,7 @@ describe('Restore from Trash', () => { folder4Id = (await apis.user.nodes.createFolder(folder4)).entry.id; file5Id = (await apis.user.nodes.createFile(file5, folder4Id)).entry.id; - await userActions.deleteNodes([file3Id, file4Id, folder3Id, file5Id], false); + await apis.user.nodes.deleteNodesById([file3Id, file4Id, folder3Id, file5Id], false); await loginPage.loginWith(username); } catch (error) { Logger.error(`----- beforeAll failed : ${error}`); diff --git a/e2e/protractor/suites/actions/edit/edit-offline.test.ts b/e2e/protractor/suites/actions/edit/edit-offline.test.ts index ce69bc5838..1c316ed451 100755 --- a/e2e/protractor/suites/actions/edit/edit-offline.test.ts +++ b/e2e/protractor/suites/actions/edit/edit-offline.test.ts @@ -77,7 +77,7 @@ describe('Edit offline', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentPFId]); + await apis.user.nodes.deleteNodeById(parentPFId); }); it('[C297538] File is locked and downloaded when clicking Edit Offline', async () => { diff --git a/e2e/protractor/suites/actions/favorite/mark-favorite.test.ts b/e2e/protractor/suites/actions/favorite/mark-favorite.test.ts index f0702856f8..43e3b1fa4b 100644 --- a/e2e/protractor/suites/actions/favorite/mark-favorite.test.ts +++ b/e2e/protractor/suites/actions/favorite/mark-favorite.test.ts @@ -102,7 +102,7 @@ describe('Mark items as favorites', () => { }); afterAll(async () => { - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); }); afterEach(async () => { diff --git a/e2e/protractor/suites/actions/share/share-file.test.ts b/e2e/protractor/suites/actions/share/share-file.test.ts index ea6a4dd41c..5553e47954 100755 --- a/e2e/protractor/suites/actions/share/share-file.test.ts +++ b/e2e/protractor/suites/actions/share/share-file.test.ts @@ -59,7 +59,7 @@ describe('Share a file', () => { }); afterAll(async () => { - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); }); describe('when logged out', () => { @@ -75,7 +75,7 @@ describe('Share a file', () => { }); afterAll(async () => { - await userActions.deleteNodes([file6Id]); + await apis.user.nodes.deleteNodeById(file6Id); }); it('[C286326] A non-logged user can download the shared file from the viewer', async () => { @@ -137,7 +137,7 @@ describe('Share a file', () => { }); afterAll(async () => { - await userActions.deleteNodes([file3Id, file4Id, file5Id, file6Id, file7Id, file8Id, file9Id]); + await apis.user.nodes.deleteNodesById([file3Id, file4Id, file5Id, file6Id, file7Id, file8Id, file9Id]); }); it('[C286327] Share dialog default values', async () => { diff --git a/e2e/protractor/suites/actions/share/unshare-file-search-results.test.ts b/e2e/protractor/suites/actions/share/unshare-file-search-results.test.ts index 074478049f..5d808fd4c7 100755 --- a/e2e/protractor/suites/actions/share/unshare-file-search-results.test.ts +++ b/e2e/protractor/suites/actions/share/unshare-file-search-results.test.ts @@ -113,7 +113,7 @@ describe('Unshare a file from Search Results', () => { }); afterAll(async () => { - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); await adminApiActions.sites.deleteSite(sitePrivate); }); diff --git a/e2e/protractor/suites/actions/upload-download/download.test.ts b/e2e/protractor/suites/actions/upload-download/download.test.ts index 7fd8c64b94..9688c2d0c2 100755 --- a/e2e/protractor/suites/actions/upload-download/download.test.ts +++ b/e2e/protractor/suites/actions/upload-download/download.test.ts @@ -113,7 +113,7 @@ describe('Download', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/actions/upload-download/upload-file.test.ts b/e2e/protractor/suites/actions/upload-download/upload-file.test.ts index e8b7a6b4b7..d42a2f81c5 100755 --- a/e2e/protractor/suites/actions/upload-download/upload-file.test.ts +++ b/e2e/protractor/suites/actions/upload-download/upload-file.test.ts @@ -60,7 +60,7 @@ describe('Upload files', () => { }); afterAll(async () => { - await userActions.deleteNodes([folder1Id]); + await apis.user.nodes.deleteNodeById(folder1Id); }); it('Upload a file', async () => { diff --git a/e2e/protractor/suites/actions/upload-download/upload-new-version.test.ts b/e2e/protractor/suites/actions/upload-download/upload-new-version.test.ts index f4a216eedf..85089e2c30 100755 --- a/e2e/protractor/suites/actions/upload-download/upload-new-version.test.ts +++ b/e2e/protractor/suites/actions/upload-download/upload-new-version.test.ts @@ -112,7 +112,7 @@ describe('Upload new version', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentPFId, parentSFId, parentRFId, parentFavId, parentSearchId]); + await apis.user.nodes.deleteNodesById([parentPFId, parentSFId, parentRFId, parentFavId, parentSearchId]); }); describe('on Search Results', () => { diff --git a/e2e/protractor/suites/actions/upload-download/version-actions.test.ts b/e2e/protractor/suites/actions/upload-download/version-actions.test.ts index c421368a45..f919d707d7 100644 --- a/e2e/protractor/suites/actions/upload-download/version-actions.test.ts +++ b/e2e/protractor/suites/actions/upload-download/version-actions.test.ts @@ -93,7 +93,7 @@ describe('Version actions', () => { }); afterAll(async () => { - await userActions.deleteNodes([parentFolderId]); + await apis.user.nodes.deleteNodeById(parentFolderId); }); describe('on Personal Files', () => { diff --git a/e2e/protractor/suites/extensions/ext-context-submenus.test.ts b/e2e/protractor/suites/extensions/ext-context-submenus.test.ts index 3b8a4ecf97..425fe5eb4d 100644 --- a/e2e/protractor/suites/extensions/ext-context-submenus.test.ts +++ b/e2e/protractor/suites/extensions/ext-context-submenus.test.ts @@ -73,7 +73,7 @@ describe('Extensions - Context submenu', () => { }); afterAll(async () => { - await userActions.deleteNodes([fileId, folderId]); + await apis.user.nodes.deleteNodesById([fileId, folderId]); }); it('[C286717] Displays the submenu actions set from config', async () => { diff --git a/e2e/protractor/suites/extensions/ext-info-drawer.test.ts b/e2e/protractor/suites/extensions/ext-info-drawer.test.ts index cc1cb603ba..3a2c08a724 100755 --- a/e2e/protractor/suites/extensions/ext-info-drawer.test.ts +++ b/e2e/protractor/suites/extensions/ext-info-drawer.test.ts @@ -82,7 +82,7 @@ describe('Extensions - Info Drawer', () => { }); afterAll(async () => { - await userActions.deleteNodes([fileId]); + await apis.user.nodes.deleteNodeById(fileId); }); describe('', () => { diff --git a/e2e/protractor/suites/extensions/ext-metadata.test.ts b/e2e/protractor/suites/extensions/ext-metadata.test.ts index 33cc8fc84b..b032a8df20 100644 --- a/e2e/protractor/suites/extensions/ext-metadata.test.ts +++ b/e2e/protractor/suites/extensions/ext-metadata.test.ts @@ -99,7 +99,7 @@ describe('Extensions - Metadata presets', () => { }); afterAll(async () => { - await userActions.deleteNodes([fileId]); + await apis.user.nodes.deleteNodeById(fileId); }); it('[C286636] Set groups of properties to display', async () => { diff --git a/e2e/protractor/suites/info-drawer/comments.test.ts b/e2e/protractor/suites/info-drawer/comments.test.ts index aede26c4b8..6b9044a274 100755 --- a/e2e/protractor/suites/info-drawer/comments.test.ts +++ b/e2e/protractor/suites/info-drawer/comments.test.ts @@ -98,7 +98,7 @@ describe('Comments', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); }); afterEach(async () => { diff --git a/e2e/protractor/suites/info-drawer/general.test.ts b/e2e/protractor/suites/info-drawer/general.test.ts index 7f9002a8d1..d3837ef960 100755 --- a/e2e/protractor/suites/info-drawer/general.test.ts +++ b/e2e/protractor/suites/info-drawer/general.test.ts @@ -59,7 +59,7 @@ describe('General', () => { }); afterAll(async () => { - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); }); beforeEach(async () => { diff --git a/e2e/protractor/suites/list-views/favorites.test.ts b/e2e/protractor/suites/list-views/favorites.test.ts index 649dd7c703..0ba7fa96db 100755 --- a/e2e/protractor/suites/list-views/favorites.test.ts +++ b/e2e/protractor/suites/list-views/favorites.test.ts @@ -70,7 +70,7 @@ describe('Favorites', () => { await apis.user.favorites.addFavoriteById('file', file4Id); await userActions.login(username, username); - await userActions.deleteNodes([file3Id, file4Id], false); + await apis.user.nodes.deleteNodesById([file3Id, file4Id], false); await userActions.trashcanApi.restoreDeletedNode(file4Id); await loginPage.loginWith(username); }); @@ -81,7 +81,7 @@ describe('Favorites', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([folderId, parentId]); + await apis.user.nodes.deleteNodesById([folderId, parentId]); await userActions.emptyTrashcan(); await adminApiActions.login(); diff --git a/e2e/protractor/suites/list-views/generic-errors.test.ts b/e2e/protractor/suites/list-views/generic-errors.test.ts index 71b6eead7b..0ccbfd0dc0 100755 --- a/e2e/protractor/suites/list-views/generic-errors.test.ts +++ b/e2e/protractor/suites/list-views/generic-errors.test.ts @@ -65,7 +65,7 @@ describe('Generic errors', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); await userActions.emptyTrashcan(); }); @@ -74,7 +74,7 @@ describe('Generic errors', () => { await dataTable.doubleClickOnRowByName(parent); await dataTable.doubleClickOnRowByName(file1); const URL = await browser.getCurrentUrl(); - await userActions.deleteNodes([file1Id], false); + await apis.user.nodes.deleteNodeById(file1Id, false); await browser.get(URL); expect(await page.genericError.isDisplayed()).toBe(true, 'Generic error page not displayed'); diff --git a/e2e/protractor/suites/list-views/recent-files.test.ts b/e2e/protractor/suites/list-views/recent-files.test.ts index 5a9231878f..0e0e48df0c 100755 --- a/e2e/protractor/suites/list-views/recent-files.test.ts +++ b/e2e/protractor/suites/list-views/recent-files.test.ts @@ -59,7 +59,7 @@ describe('Recent Files', () => { const id = (await apis.user.nodes.createFiles([fileName3])).entry.id; await userActions.login(username, username); - await userActions.deleteNodes([id], false); + await apis.user.nodes.deleteNodeById(id, false); await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC); const docLibId = await apis.user.sites.getDocLibId(siteName); @@ -77,7 +77,7 @@ describe('Recent Files', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([folderId, file2Id]); + await apis.user.nodes.deleteNodesById([folderId, file2Id]); await userActions.deleteSites([siteName]); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/list-views/tooltips.test.ts b/e2e/protractor/suites/list-views/tooltips.test.ts index 91702247bb..2c4df9b638 100755 --- a/e2e/protractor/suites/list-views/tooltips.test.ts +++ b/e2e/protractor/suites/list-views/tooltips.test.ts @@ -85,7 +85,7 @@ describe('File / folder tooltips', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentId]); + await apis.user.nodes.deleteNodeById(parentId); await userActions.emptyTrashcan(); }); @@ -233,13 +233,14 @@ describe('File / folder tooltips', () => { [file1TrashId, file2TrashId, file3TrashId, file4TrashId, file5TrashId, file6TrashId, file7TrashId, file8TrashId], false ); + // await apis.user.nodes. await page.clickTrashAndWait(); }); afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([parentForTrashId]); + await apis.user.nodes.deleteNodeById(parentForTrashId); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/list-views/trash.test.ts b/e2e/protractor/suites/list-views/trash.test.ts index f6ca1aa37b..e3ade6f59f 100755 --- a/e2e/protractor/suites/list-views/trash.test.ts +++ b/e2e/protractor/suites/list-views/trash.test.ts @@ -97,7 +97,7 @@ describe('Trash', () => { await adminApiActions.trashcanApi.deleteDeletedNode(folderAdminId); await userActions.login(username, username); - await userActions.deleteNodes([folderNotDeletedId]); + await apis.user.nodes.deleteNodeById(folderNotDeletedId); await userActions.emptyTrashcan(); } catch (error) { Logger.error(`----- afterAll failed : ${error}`); diff --git a/e2e/protractor/suites/navigation/single-click.test.ts b/e2e/protractor/suites/navigation/single-click.test.ts index a91b82fbd8..3868a156f2 100755 --- a/e2e/protractor/suites/navigation/single-click.test.ts +++ b/e2e/protractor/suites/navigation/single-click.test.ts @@ -71,7 +71,7 @@ describe('Single click on item name', () => { deletedFolder1Id = (await apis.user.nodes.createFolder(deletedFolder1)).entry.id; await userActions.login(username, username); - await userActions.deleteNodes([deletedFile1Id, deletedFolder1Id], false); + await apis.user.nodes.deleteNodesById([deletedFile1Id, deletedFolder1Id], false); await loginPage.loginWith(username); }); @@ -79,7 +79,7 @@ describe('Single click on item name', () => { afterAll(async () => { await userActions.login(username, username); await userActions.deleteSites([siteName]); - await userActions.deleteNodes([folder1Id, file1Id]); + await apis.user.nodes.deleteNodesById([folder1Id, file1Id]); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/pagination/multiple-pages-trash.test.ts b/e2e/protractor/suites/pagination/multiple-pages-trash.test.ts index f4c82e41a6..a529a00550 100755 --- a/e2e/protractor/suites/pagination/multiple-pages-trash.test.ts +++ b/e2e/protractor/suites/pagination/multiple-pages-trash.test.ts @@ -47,7 +47,7 @@ describe('Pagination on multiple pages on Trash', () => { filesDeletedIds = (await userApi.nodes.createFiles(filesForDelete)).list.entries.map((entries: any) => entries.entry.id); await userActions.login(username, username); - await userActions.deleteNodes(filesDeletedIds, false); + await userApi.nodes.deleteNodesById(filesDeletedIds, false); await userActions.waitForTrashcanSize(51); await loginPage.loginWith(username); diff --git a/e2e/protractor/suites/pagination/single-page.test.ts b/e2e/protractor/suites/pagination/single-page.test.ts index 2385d95896..1981f2c045 100755 --- a/e2e/protractor/suites/pagination/single-page.test.ts +++ b/e2e/protractor/suites/pagination/single-page.test.ts @@ -74,7 +74,7 @@ describe('Pagination on single page', () => { afterAll(async () => { await userActions.login(username, username); - await userActions.deleteNodes([fileId]); + await userApi.nodes.deleteNodeById(fileId); await userActions.deleteSites([siteId]); await userActions.emptyTrashcan(); }); diff --git a/e2e/protractor/suites/viewer/viewer-actions.test.ts b/e2e/protractor/suites/viewer/viewer-actions.test.ts index 31802f0546..73e8cb2d3b 100755 --- a/e2e/protractor/suites/viewer/viewer-actions.test.ts +++ b/e2e/protractor/suites/viewer/viewer-actions.test.ts @@ -131,7 +131,7 @@ describe('Viewer actions', () => { afterAll(async () => { try { await userActions.login(username, username); - await userActions.deleteNodes([parentId, destinationId]); + await apis.user.nodes.deleteNodesById([parentId, destinationId]); await userActions.emptyTrashcan(); } catch (error) { Logger.error(`----- afterAll failed : ${error}`); @@ -237,7 +237,7 @@ describe('Viewer actions', () => { afterAll(async () => { try { await userActions.login(username, username); - await userActions.deleteNodes([parentId, destinationId]); + await apis.user.nodes.deleteNodesById([parentId, destinationId]); await userActions.emptyTrashcan(); } catch (error) { Logger.error(`----- afterAll failed : ${error}`); @@ -344,7 +344,7 @@ describe('Viewer actions', () => { afterAll(async () => { try { await userActions.login(username, username); - await userActions.deleteNodes([parentId, destinationId]); + await apis.user.nodes.deleteNodesById([parentId, destinationId]); await userActions.emptyTrashcan(); } catch (error) { Logger.error(`----- afterAll failed : ${error}`); @@ -421,7 +421,7 @@ describe('Viewer actions', () => { afterAll(async () => { try { await userActions.login(username, username); - await userActions.deleteNodes([parentId, destinationId]); + await apis.user.nodes.deleteNodesById([parentId, destinationId]); await userActions.emptyTrashcan(); } catch (error) { Logger.error(`----- afterAll failed : ${error}`); 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 79e9d40db6..28f73fc757 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 @@ -176,9 +176,7 @@ export class NodesApi extends RepoApi { async deleteNodesById(ids: string[], permanent: boolean = true): Promise { try { await this.apiAuth(); - for (const id of ids) { - await this.nodesApi.deleteNode(id, { permanent }); - } + await this.nodesApi.deleteNodes(ids, {permanent}); } catch (error) { this.handleError(`${this.constructor.name} ${this.deleteNodesById.name}`, error); } diff --git a/projects/aca-testing-shared/src/utilities/user-actions.ts b/projects/aca-testing-shared/src/utilities/user-actions.ts index acc68f8b6b..c42d2b9ee4 100644 --- a/projects/aca-testing-shared/src/utilities/user-actions.ts +++ b/projects/aca-testing-shared/src/utilities/user-actions.ts @@ -81,21 +81,6 @@ export class UserActions { } } - /** - * Delete multiple nodes. - * @param nodeIds The list of node IDs to delete. - * @param permanent Delete permanently, without moving to the trashcan? (default: true) - */ - async deleteNodes(nodeIds: string[], permanent: boolean = true): Promise { - try { - for (const nodeId of nodeIds) { - await this.nodesApi.deleteNode(nodeId, { permanent }); - } - } catch (error) { - this.handleError('User Actions - deleteNodes failed : ', error); - } - } - /** * Empties the trashcan. Uses multiple batches 1000 nodes each. */