diff --git a/e2e/suites/actions/copy-move/copy.test.ts b/e2e/suites/actions/copy-move/copy.test.ts index 4e5c75d43..f9433475b 100755 --- a/e2e/suites/actions/copy-move/copy.test.ts +++ b/e2e/suites/actions/copy-move/copy.test.ts @@ -23,16 +23,7 @@ * along with Alfresco. If not, see . */ -import { - AdminActions, - UserActions, - LoginPage, - BrowsingPage, - ContentNodeSelectorDialog, - RepoClient, - Utils, - SearchResultsPage -} from '@alfresco/aca-testing-shared'; +import { AdminActions, UserActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { BrowserActions, Logger } from '@alfresco/adf-testing'; describe('Copy content', () => { @@ -59,7 +50,6 @@ describe('Copy content', () => { const fileInFolder2 = fileInFolder; const folderExisting = `copy-folder-existing-${random}`; - let folderExistingId: string; const file1InFolderExisting = `copy-file1InFolderExisting-${random}.txt`; const file2InFolderExisting = `copy-file2InFolderExisting-${random}.txt`; @@ -94,8 +84,6 @@ describe('Copy content', () => { const page = new BrowsingPage(); const { dataTable, toolbar } = page; const copyDialog = new ContentNodeSelectorDialog(); - const searchResultsPage = new SearchResultsPage(); - const { searchInput } = page.header; const adminApiActions = new AdminActions(); const userActions = new UserActions(); @@ -146,7 +134,7 @@ describe('Copy content', () => { await apis.favorites.addFavoriteById('file', fileInFolderId); await userActions.shareNodes([fileInFolderId]); - folderExistingId = await apis.createFolder(folderExisting, sourceId); + const folderExistingId = await apis.createFolder(folderExisting, sourceId); await apis.favorites.addFavoriteById('folder', folderExistingId); await apis.createFile(file1InFolderExisting, folderExistingId); @@ -212,30 +200,6 @@ describe('Copy content', () => { } }); - describe('from Recent Files', () => { - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickRecentFilesAndWait(); - }); - - it('[C280194] Copy a file', async () => copyFile(file1, source, destinationRF)); - - 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('[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('[C280202] Undo copy of files', async () => undoCopyFile(file4, source, destinationRF)); - }); - describe('from Personal Files', () => { beforeEach(async () => { await Utils.pressEscape(); @@ -283,169 +247,6 @@ describe('Copy content', () => { undoCopyFolderWithExistingName(folderExisting, '', destinationPF)); }); - describe('from Shared Files', () => { - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickSharedFilesAndWait(); - }); - - it('[C280206] Copy a file', async () => copyFile(file1, source, destinationSF)); - - 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('[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('[C280214] Undo copy of files', async () => undoCopyFile(file4, source, destinationSF)); - }); - - describe('from Favorites', () => { - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickFavoritesAndWait(); - }); - - it('[C280218] Copy a file', async () => copyFile(file1, source, destinationFav)); - - it('[C280219] Copy a folder with content', async () => copyFolderWithContent(folder1, source, destinationFav)); - - 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('[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('[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)); - }); - - describe('from Search Results', () => { - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickPersonalFiles(); - await searchInput.clickSearchButton(); - }); - - it('[C306932] Copy a file', async () => - copyFile(file1, source, destinationSearch, async () => { - await searchInput.checkOnlyFiles(); - await searchInput.searchFor(file1); - await dataTable.waitForBody(); - })); - - it('[C306943] Copy a folder with content', async () => - copyFolderWithContent(folder1, source, destinationSearch, async () => { - await searchInput.checkOnlyFolders(); - await searchInput.searchFor(folder1); - await dataTable.waitForBody(); - })); - - it('[C306944] Copy multiple items', async () => - copyMultipleItems([file2, file3], source, destinationSearch, async () => { - await searchInput.checkOnlyFiles(); - await searchInput.searchFor(random); - 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.checkOnlyFiles(); - 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.checkOnlyFolders(); - await searchInput.searchFor(existingFolder); - await dataTable.waitForBody(); - })); - - it('[C306942] Copy items into a library', async () => - copyItemsIntoLibrary([file1, file2], source, folderSiteSearch, async () => { - await searchInput.checkOnlyFiles(); - await searchInput.searchFor(random); - await searchResultsPage.waitForResults(); - })); - - it('[C306935] Copy locked file', async () => - copyLockedFile(fileLocked1, source, destinationSearch, async () => { - locationId = sourceId; - destinationId = destinationIdSearch; - await searchInput.checkOnlyFiles(); - 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.checkOnlyFolders(); - await searchInput.searchFor(folderWithLockedFiles); - await dataTable.waitForBody(); - })); - - it('[C306938] Undo copy of files', async () => - undoCopyFile(file4, source, destinationSearch, async () => { - await searchInput.checkOnlyFiles(); - await searchInput.searchFor(file4); - await dataTable.waitForBody(); - })); - - it('[C306939] Undo copy of folders', async () => - undoCopyFolder(folder2, source, destinationSearch, async () => { - await searchInput.checkOnlyFolders(); - 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.checkOnlyFiles(); - 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.checkOnlyFolders(); - await searchInput.searchFor(folderExisting); - await dataTable.waitForBody(); - })); - }); - async function copyFile(fileName: string, location: string = '', destination: string, doBefore?: () => void) { if (doBefore) { await doBefore(); diff --git a/e2e/suites/actions/copy-move/move.test.ts b/e2e/suites/actions/copy-move/move.test.ts index 3dc93871c..2b0c3330f 100755 --- a/e2e/suites/actions/copy-move/move.test.ts +++ b/e2e/suites/actions/copy-move/move.test.ts @@ -23,7 +23,7 @@ * along with Alfresco. If not, see . */ -import { AdminActions, UserActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared'; +import { AdminActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { BrowserActions } from '@alfresco/adf-testing'; describe('Move content', () => { @@ -63,7 +63,6 @@ describe('Move content', () => { const moveDialog = new ContentNodeSelectorDialog(); const adminApiActions = new AdminActions(); - const userActions = new UserActions(); beforeAll(async () => { await adminApiActions.createUser({ username }); @@ -282,431 +281,4 @@ describe('Move content', () => { expect(await dataTable.isItemPresent(fileInFolder2)).toBe(true, `${fileInFolder2} not present in parent folder`); }); }); - - describe('from Recent Files', () => { - const file1 = `file1-${Utils.random()}.txt`; - const file2 = `file2-${Utils.random()}.txt`; - const file3 = `file3-${Utils.random()}.txt`; - const file4 = `file4-${Utils.random()}.txt`; - const existingFile = `existing-${Utils.random()}`; - - beforeAll(async () => { - await apis.createFile(file1, sourceIdRF); - await apis.createFile(file2, sourceIdRF); - await apis.createFile(file3, sourceIdRF); - await apis.createFile(`${existingFile}.txt`, sourceIdRF); - await apis.createFile(`${existingFile}.txt`, destinationIdRF); - await apis.createFile(file4, sourceIdRF); - - await apis.search.waitForApi(username, { expect: 16 }); - }); - - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickRecentFilesAndWait(); - }); - - it('[C280230] Move a file', async () => { - await dataTable.selectItem(file1, sourceRF); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationRF); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 1 item'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file1, destinationRF)).toBe(true, `${file1} from ${destinationRF} not present`); - expect(await dataTable.isItemPresent(file1, sourceRF)).toBe(false, `${file1} from ${sourceRF} is present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationRF); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); - }); - - it('[C280237] Move multiple items', async () => { - await dataTable.selectMultipleItems([file2, file3], sourceRF); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationRF); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 2 items'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file2, destinationRF)).toBe(true, `${file2} from ${destinationRF} not present`); - expect(await dataTable.isItemPresent(file3, destinationRF)).toBe(true, `${file3} from ${destinationRF} not present`); - expect(await dataTable.isItemPresent(file2, sourceRF)).toBe(false, `${file2} from ${sourceRF} is present`); - expect(await dataTable.isItemPresent(file3, sourceRF)).toBe(false, `${file3} from ${sourceRF} is present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationRF); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in destination folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in destination folder`); - }); - - it('[C291970] Move a file with a name that already exists on the destination', async () => { - await dataTable.selectItem(existingFile, sourceRF); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationRF); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Move unsuccessful, a file with the same name already exists'); - const action = await page.getSnackBarAction(); - expect(action).not.toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(existingFile, sourceRF)).toBe(true, `${existingFile} from ${sourceRF} not present`); - expect(await dataTable.isItemPresent(existingFile, destinationRF)).toBe(true, `${existingFile} from ${destinationRF} not present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationRF); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in destination folder`); - expect(await dataTable.isItemPresent(`${existingFile}-1.txt`)).toBe(false, `${existingFile}-1.txt is present in destination folder`); - }); - - it('[C291971] Move items into a library', async () => { - await dataTable.selectItem(file4, sourceRF); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('My Libraries'); - await moveDialog.dataTable.doubleClickOnRowByName(siteName); - await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary'); - await moveDialog.selectDestination(folderSiteRF); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 1 item'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file4, folderSiteRF)).toBe(true, `${file4} from ${folderSiteRF} not present`); - expect(await dataTable.isItemPresent(file4, sourceRF)).toBe(false, `${file4} from ${sourceRF} is present`); - - await page.goToMyLibraries(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.doubleClickOnRowByName(folderSiteRF); - - expect(await dataTable.isItemPresent(file4)).toBe(true, `${file4} not present in destination folder`); - }); - }); - - describe('from Shared Files', () => { - const file1 = `file1-${Utils.random()}.txt`; - const file2 = `file2-${Utils.random()}.txt`; - const file3 = `file3-${Utils.random()}.txt`; - const file4 = `file4-${Utils.random()}.txt`; - const existingFile = `existing-${Utils.random()}`; - - beforeAll(async () => { - const file1Id = await apis.createFile(file1, sourceIdSF); - - await userActions.login(username, username); - await userActions.shareNodes([file1Id]); - - const file2Id = await apis.createFile(file2, sourceIdSF); - const file3Id = await apis.createFile(file3, sourceIdSF); - await userActions.shareNodes([file2Id, file3Id]); - - const existingFileId = await apis.createFile(`${existingFile}.txt`, sourceIdSF); - await userActions.shareNodes([existingFileId]); - await apis.createFile(`${existingFile}.txt`, destinationIdSF); - - const file4Id = await apis.createFile(file4, sourceIdSF); - await userActions.shareNodes([file4Id]); - await apis.shared.waitForFilesToBeShared([file1Id, file2Id, file3Id, existingFileId, file4Id]); - }); - - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickSharedFilesAndWait(); - }); - - it('[C280243] Move a file', async () => { - await dataTable.selectItem(file1, sourceSF); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationSF); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 1 item'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file1, destinationSF)).toBe(true, `${file1} from ${destinationSF} not present`); - expect(await dataTable.isItemPresent(file1, sourceSF)).toBe(false, `${file1} from ${sourceSF} is present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationSF); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); - }); - - it('[C280250] Move multiple items', async () => { - await dataTable.selectMultipleItems([file2, file3], sourceSF); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationSF); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 2 items'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file2, destinationSF)).toBe(true, `${file2} from ${destinationSF} not present`); - expect(await dataTable.isItemPresent(file3, destinationSF)).toBe(true, `${file3} from ${destinationSF} not present`); - expect(await dataTable.isItemPresent(file2, sourceSF)).toBe(false, `${file2} from ${sourceSF} is present`); - expect(await dataTable.isItemPresent(file3, sourceSF)).toBe(false, `${file3} from ${sourceSF} is present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationSF); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in destination folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in destination folder`); - }); - - it('[C291977] Move a file with a name that already exists on the destination', async () => { - await dataTable.selectItem(existingFile, sourceSF); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationSF); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Move unsuccessful, a file with the same name already exists'); - const action = await page.getSnackBarAction(); - expect(action).not.toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(existingFile, sourceSF)).toBe(true, `${existingFile} from ${sourceSF} not present`); - expect(await dataTable.isItemPresent(existingFile, destinationSF)).toBe(false, `${existingFile} from ${destinationSF} is present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationSF); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in destination folder`); - expect(await dataTable.isItemPresent(`${existingFile}-1.txt`)).toBe(false, `${existingFile}-1.txt not present in destination folder`); - }); - - it('[C291978] Move items into a library', async () => { - await dataTable.selectItem(file4, sourceSF); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('My Libraries'); - await moveDialog.dataTable.doubleClickOnRowByName(siteName); - await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary'); - await moveDialog.selectDestination(folderSiteSF); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 1 item'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file4, folderSiteSF)).toBe(true, `${file4} from ${folderSiteSF} not present`); - expect(await dataTable.isItemPresent(file4, sourceSF)).toBe(false, `${file4} from ${sourceSF} is present`); - - await page.goToMyLibraries(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.doubleClickOnRowByName(folderSiteSF); - - expect(await dataTable.isItemPresent(file4)).toBe(true, `${file4} not present in destination folder`); - }); - }); - - describe('from Favorites', () => { - const file1 = `file1-${Utils.random()}.txt`; - const folder1 = `folder1-${Utils.random()}`; - 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()}`; - const fileInFolder2 = `fileInFolder2-${Utils.random()}.txt`; - const existingFile = `existing-${Utils.random()}`; - const existingFolder = `existing-${Utils.random()}`; - const file2InFolder = `file2InFolder-${Utils.random()}.txt`; - const file3InFolder = `file3InFolder-${Utils.random()}.txt`; - - async function createFavoriteFile(name: string, parentId: string) { - const fileId = await apis.createFile(name, parentId); - return apis.favorites.addFavoriteById('file', fileId); - } - - async function createFavoriteFolder(name: string, parentId: string): Promise { - const folderId = await apis.createFolder(name, parentId); - await apis.favorites.addFavoriteById('folder', folderId); - return folderId; - } - - beforeAll(async () => { - const folder1Id = await createFavoriteFolder(folder1, sourceIdFav); - await apis.createFile(fileInFolder, folder1Id); - - await createFavoriteFile(file1, sourceIdFav); - await createFavoriteFile(file2, sourceIdFav); - await createFavoriteFile(file3, sourceIdFav); - await createFavoriteFile(file4, sourceIdFav); - await createFavoriteFile(`${existingFile}.txt`, sourceIdFav); - - await apis.createFile(`${existingFile}.txt`, destinationIdFav); - - const existingId1 = await createFavoriteFolder(existingFolder, sourceIdFav); - await apis.createFile(file2InFolder, existingId1); - - const existingId2 = await apis.createFolder(existingFolder, destinationIdFav); - await apis.createFile(file3InFolder, existingId2); - - const folder2Id = await createFavoriteFolder(folder2, sourceIdFav); - await apis.createFile(fileInFolder2, folder2Id); - - await apis.favorites.waitForApi({ expect: 9 }); - }); - - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickFavoritesAndWait(); - }); - - it('[C280256] Move a file', async () => { - await dataTable.selectItem(file1); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationFav); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 1 item'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file1, destinationFav)).toBe(true, `${file1} from ${destinationFav} not present`); - expect(await dataTable.isItemPresent(file1, sourceFav)).toBe(false, `${file1} from ${sourceFav} is present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); - }); - - it('[C280257] Move a folder with content', async () => { - await dataTable.selectItem(folder1); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationFav); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 1 item'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(folder1, sourceFav)).toBe(false, `${folder1} from ${sourceFav} is present`); - expect(await dataTable.isItemPresent(folder1, destinationFav)).toBe(true, `${folder1} from ${destinationFav} not present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in destination folder`); - expect(await dataTable.isItemPresent(fileInFolder)).toBe(false, `${fileInFolder} is present in destination`); - - await dataTable.doubleClickOnRowByName(folder1); - expect(await dataTable.isItemPresent(fileInFolder)).toBe(true, `${fileInFolder} is not present in parent folder`); - }); - - it('[C280258] Move multiple items', async () => { - await dataTable.selectMultipleItems([file2, file3]); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationFav); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 2 items'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file2, destinationFav)).toBe(true, `${file2} from ${destinationFav} not present`); - expect(await dataTable.isItemPresent(file3, destinationFav)).toBe(true, `${file3} from ${destinationFav} not present`); - expect(await dataTable.isItemPresent(file2, sourceFav)).toBe(false, `${file2} from ${sourceFav} is present`); - expect(await dataTable.isItemPresent(file3, sourceFav)).toBe(false, `${file3} from ${sourceFav} is present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in destination folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in destination folder`); - }); - - it('[C280263] Move a file with a name that already exists on the destination', async () => { - await dataTable.selectItem(existingFile); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationFav); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Move unsuccessful, a file with the same name already exists'); - const action = await page.getSnackBarAction(); - expect(action).not.toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(existingFile, sourceFav)).toBe(true, `${existingFile} from ${sourceFav} not present`); - expect(await dataTable.isItemPresent(existingFile, destinationFav)).toBe(false, `${existingFile} from ${destinationFav} is present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in destination folder`); - expect(await dataTable.isItemPresent(`${existingFile}-1.txt`)).toBe(false, `${existingFile}-1.txt is present in destination folder`); - }); - - it('[C280259] Move a folder with a name that already exists on the destination', async () => { - await dataTable.selectItem(existingFolder); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('Personal Files'); - await moveDialog.selectDestination(destinationFav); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 1 item'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(existingFolder, sourceFav)).toBe(false, `${existingFolder} from ${sourceFav} is present`); - // expect(await dataTable.isItemPresent(existingFolder, destinationFav)).toBe(true, `${existingFolder} from ${destinationFav} not present`); - - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(existingFolder)).toBe(true, `${existingFolder} not present in destination folder`); - await dataTable.doubleClickOnRowByName(existingFolder); - expect(await dataTable.isItemPresent(file2InFolder)).toBe(true, `${file2InFolder} not present in destination folder`); - expect(await dataTable.isItemPresent(file3InFolder)).toBe(true, `${file3InFolder} not present in destination folder`); - }); - - it('[C291979] Move items into a library', async () => { - await dataTable.selectMultipleItems([file4, folder2], sourceFav); - await toolbar.clickMoreActionsMove(); - await moveDialog.selectLocation('My Libraries'); - await moveDialog.dataTable.doubleClickOnRowByName(siteName); - await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary'); - await moveDialog.selectDestination(folderSiteFav); - await BrowserActions.click(moveDialog.moveButton); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Moved 2 items'); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - - await moveDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file4, folderSiteFav)).toBe(true, `${file4} from ${folderSiteFav} not present`); - expect(await dataTable.isItemPresent(file4, sourceFav)).toBe(false, `${file4} from ${sourceFav} is present`); - expect(await dataTable.isItemPresent(folder2, folderSiteFav)).toBe(true, `${folder2} from ${folderSiteFav} not present`); - expect(await dataTable.isItemPresent(folder2, sourceFav)).toBe(false, `${folder2} from ${sourceFav} is present`); - - await page.goToMyLibraries(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.doubleClickOnRowByName(folderSiteFav); - - expect(await dataTable.isItemPresent(file4)).toBe(true, `${file4} not present in destination folder`); - expect(await dataTable.isItemPresent(folder2)).toBe(true, `${folder2} not present in destination folder`); - await dataTable.doubleClickOnRowByName(folder2); - expect(await dataTable.isItemPresent(fileInFolder2)).toBe(true, `${fileInFolder2} not present in parent folder`); - }); - }); }); diff --git a/e2e/suites/actions/create/create-folder.test.ts b/e2e/suites/actions/create/create-folder.test.ts index 442da556b..5a97d6055 100755 --- a/e2e/suites/actions/create/create-folder.test.ts +++ b/e2e/suites/actions/create/create-folder.test.ts @@ -37,21 +37,11 @@ import { BrowserActions } from '@alfresco/adf-testing'; describe('Create folder', () => { const username = `user-${Utils.random()}`; - const parent = `parent-${Utils.random()}`; let parentId: string; - const folderName1 = `folder-${Utils.random()}`; - const folderName2 = `folder-${Utils.random()}`; - const folderDescription = 'description of my folder'; const duplicateFolderName = `folder-${Utils.random()}`; - const nameWithSpaces = ` folder-${Utils.random()} `; - const siteName = `site-${Utils.random()}`; - const folderSite = `folder-site-${Utils.random()}`; - const duplicateFolderSite = `folder-${Utils.random()}`; - let docLibUserSite: string; - const apis = { user: new RepoClient(username, username) }; @@ -78,7 +68,8 @@ describe('Create folder', () => { await apis.user.createFolder(duplicateFolderName, parentId); await apis.user.sites.createSite(siteName); - docLibUserSite = await apis.user.sites.getDocLibId(siteName); + const docLibUserSite = await apis.user.sites.getDocLibId(siteName); + const duplicateFolderSite = `folder-${Utils.random()}`; await apis.user.createFolder(duplicateFolderSite, docLibUserSite); await loginPage.loginWith(username); @@ -99,6 +90,8 @@ describe('Create folder', () => { }); it('[C216341] creates new folder with name', async () => { + const folderName1 = `folder-${Utils.random()}`; + await openCreateFolderDialog(parent); await createDialog.enterName(folderName1); await BrowserActions.click(createDialog.createButton); @@ -109,6 +102,9 @@ describe('Create folder', () => { }); it('[C216340] creates new folder with name and description', async () => { + const folderDescription = 'description of my folder'; + const folderName2 = `folder-${Utils.random()}`; + await openCreateFolderDialog(parent); await createDialog.enterName(folderName2); await createDialog.enterDescription(folderDescription); @@ -186,6 +182,8 @@ describe('Create folder', () => { }); it('[C216351] trim ending spaces from folder name', async () => { + const nameWithSpaces = ` folder-${Utils.random()} `; + await openCreateFolderDialog(parent); await createDialog.enterName(nameWithSpaces); await BrowserActions.click(createDialog.createButton); @@ -195,47 +193,4 @@ describe('Create folder', () => { expect(await dataTable.isItemPresent(nameWithSpaces.trim())).toBe(true, 'Folder not displayed in list view'); }); }); - - describe('on File Libraries', () => { - const fileLibrariesPage = new BrowsingPage(); - - beforeEach(async () => { - await fileLibrariesPage.goToMyLibrariesAndWait(); - }); - - afterEach(async () => { - await Utils.pressEscape(); - }); - - it('[C280394] creates new folder with name and description', async () => { - await openCreateFolderDialog(siteName); - await createDialog.enterName(folderSite); - await createDialog.enterDescription(folderDescription); - await BrowserActions.click(createDialog.createButton); - await createDialog.waitForDialogToClose(); - await dataTable.waitForHeader(); - - expect(await dataTable.isItemPresent(folderSite)).toBe(true, 'Folder not displayed'); - const desc = await apis.user.nodes.getNodeDescription(folderSite, docLibUserSite); - expect(desc).toEqual(folderDescription); - }); - - it('[C280403] cancel folder creation', async () => { - await openCreateFolderDialog(siteName); - await createDialog.enterName('test'); - await createDialog.enterDescription('test description'); - await createDialog.clickCancel(); - - expect(await createDialog.isDialogOpen()).not.toBe(true, 'dialog is not closed'); - }); - - it('[C280404] duplicate folder name', async () => { - await openCreateFolderDialog(siteName); - await createDialog.enterName(duplicateFolderSite); - await BrowserActions.click(createDialog.createButton); - - expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); - expect(await createDialog.isDialogOpen()).toBe(true, 'dialog is not present'); - }); - }); }); diff --git a/e2e/suites/actions/delete/delete-undo-delete.test.ts b/e2e/suites/actions/delete/delete-undo-delete.test.ts index 5e49b94f3..70ba8dc3a 100755 --- a/e2e/suites/actions/delete/delete-undo-delete.test.ts +++ b/e2e/suites/actions/delete/delete-undo-delete.test.ts @@ -50,102 +50,6 @@ describe('Delete and undo delete', () => { await userActions.emptyTrashcan(); }); - describe('on Recent Files', () => { - const parent = `parentRF-${Utils.random()}`; - let parentId: string; - - const random = Utils.random(); - const recentFile1 = `recentFile1-${random}.txt`; - const recentFile2 = `recentFile2-${random}.txt`; - const recentFile3 = `recentFile3-${random}.txt`; - const recentFile4 = `recentFile4-${random}.txt`; - const recentFile5 = `recentFile5-${random}.txt`; - const recentFile6 = `recentFile6-${random}.txt`; - - beforeAll(async () => { - try { - parentId = (await apis.user.nodes.createFolder(parent)).entry.id; - - await apis.user.nodes.createFile(recentFile1, parentId); - await apis.user.nodes.createFile(recentFile2, parentId); - await apis.user.nodes.createFile(recentFile3, parentId); - await apis.user.nodes.createFile(recentFile4, parentId); - await apis.user.nodes.createFile(recentFile5, parentId); - await apis.user.nodes.createFile(recentFile6, parentId); - await apis.user.search.waitForNodes(random, { expect: 6 }); - - await loginPage.loginWith(username); - } catch (error) { - Logger.error(`----- beforeAll failed : ${error}`); - } - }); - - beforeEach(async () => { - await page.clickRecentFilesAndWait(); - }); - - afterAll(async () => { - try { - await userActions.login(username, username); - await userActions.deleteNodes([parentId]); - await userActions.emptyTrashcan(); - } catch (error) { - Logger.error(`----- afterAll failed : ${error}`); - } - }); - - it('[C280528] delete a file and check notification', async () => { - await dataTable.selectItem(recentFile1, parent); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toContain(`${recentFile1} deleted`); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - expect(await dataTable.isItemPresent(recentFile1)).toBe(false, `${recentFile1} was not removed from list`); - await page.clickTrashAndWait(); - expect(await dataTable.isItemPresent(recentFile1)).toBe(true, `${recentFile1} is not in trash`); - }); - - it('[C280529] delete multiple files and check notification', async () => { - await dataTable.selectMultipleItems([recentFile2, recentFile3], parent); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toContain(`Deleted 2 items`); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - expect(await dataTable.isItemPresent(recentFile2)).toBe(false, `${recentFile2} was not removed from list`); - expect(await dataTable.isItemPresent(recentFile3)).toBe(false, `${recentFile3} was not removed from list`); - await page.clickTrashAndWait(); - expect(await dataTable.isItemPresent(recentFile2)).toBe(true, `${recentFile2} is not in trash`); - expect(await dataTable.isItemPresent(recentFile3)).toBe(true, `${recentFile3} is not in trash`); - }); - - // due to the fact that the search api is slow to update, - // we cannot test that the restored file is displayed in the Recent Files list - // without adding a very big browser.sleep followed by a page.refresh - // so for the moment we're testing that the restored file is not displayed in the Trash - it('[C280536] undo delete of file', async () => { - await dataTable.selectItem(recentFile4); - await toolbar.clickMoreActionsDelete(); - await page.clickSnackBarAction(); - await page.clickTrash(); - expect(await dataTable.isItemPresent(recentFile4)).toBe(false, `${recentFile4} is in Trash`); - }); - - // due to the fact that the search api is slow to update, - // we cannot test that the restored file is displayed in the Recent Files list - // without adding a very big browser.sleep followed by a page.refresh - // so for the moment we're testing that the restored file is not displayed in the Trash - it('[C280537] undo delete of multiple files', async () => { - await dataTable.selectMultipleItems([recentFile5, recentFile6]); - await toolbar.clickMoreActionsDelete(); - await page.clickSnackBarAction(); - await page.clickTrash(); - expect(await dataTable.isItemPresent(recentFile5)).toBe(false, `${recentFile5} is in Trash`); - expect(await dataTable.isItemPresent(recentFile6)).toBe(false, `${recentFile6} is in Trash`); - }); - }); - describe('on Personal Files', () => { const file1 = `file1-${Utils.random()}.txt`; const file2 = `file2-${Utils.random()}.txt`; @@ -327,271 +231,4 @@ describe('Delete and undo delete', () => { expect(await dataTable.isItemPresent(file7)).toBe(true, `${file7} was removed from list`); }); }); - - describe('on Shared Files', () => { - const sharedFile1 = `sharedFile1-${Utils.random()}.txt`; - const sharedFile2 = `sharedFile2-${Utils.random()}.txt`; - const sharedFile3 = `sharedFile3-${Utils.random()}.txt`; - const sharedFile4 = `sharedFile4-${Utils.random()}.txt`; - const sharedFile5 = `sharedFile5-${Utils.random()}.txt`; - const sharedFile6 = `sharedFile6-${Utils.random()}.txt`; - - const parent = `parentSF-${Utils.random()}`; - let parentId: string; - - beforeAll(async () => { - try { - parentId = await apis.user.createFolder(parent); - - const sharedFile1Id = await apis.user.createFile(sharedFile1, parentId); - const sharedFile2Id = await apis.user.createFile(sharedFile2, parentId); - const sharedFile3Id = await apis.user.createFile(sharedFile3, parentId); - const sharedFile4Id = await apis.user.createFile(sharedFile4, parentId); - const sharedFile5Id = await apis.user.createFile(sharedFile5, parentId); - const sharedFile6Id = await apis.user.createFile(sharedFile6, parentId); - - await apis.user.shared.shareFilesByIds([sharedFile1Id, sharedFile2Id, sharedFile3Id, sharedFile4Id, sharedFile5Id, sharedFile6Id]); - await apis.user.shared.waitForFilesToBeShared([sharedFile1Id, sharedFile2Id, sharedFile3Id, sharedFile4Id, sharedFile5Id, sharedFile6Id]); - - await loginPage.loginWith(username); - } catch (error) { - Logger.error(`----- beforeAll failed : ${error}`); - } - }); - - beforeEach(async () => { - await page.clickSharedFilesAndWait(); - }); - - afterAll(async () => { - try { - await userActions.login(username, username); - await userActions.deleteNodes([parentId]); - await userActions.emptyTrashcan(); - } catch (error) { - Logger.error(`----- afterAll failed : ${error}`); - } - }); - - it('[C280316] delete a file and check notification', async () => { - await dataTable.selectItem(sharedFile1); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toContain(`${sharedFile1} deleted`); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - expect(await dataTable.isItemPresent(sharedFile1)).toBe(false, `${sharedFile1} was not removed from list`); - await page.clickTrashAndWait(); - expect(await dataTable.isItemPresent(sharedFile1)).toBe(true, `${sharedFile1} is not in trash`); - }); - - it('[C280513] delete multiple files and check notification', async () => { - await dataTable.selectMultipleItems([sharedFile2, sharedFile3]); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toContain(`Deleted 2 items`); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - expect(await dataTable.isItemPresent(sharedFile2)).toBe(false, `${sharedFile2} was not removed from list`); - expect(await dataTable.isItemPresent(sharedFile3)).toBe(false, `${sharedFile3} was not removed from list`); - await page.clickTrashAndWait(); - expect(await dataTable.isItemPresent(sharedFile2)).toBe(true, `${sharedFile2} is not in trash`); - expect(await dataTable.isItemPresent(sharedFile3)).toBe(true, `${sharedFile3} is not in trash`); - }); - - it('[C280324] undo delete of file', async () => { - await dataTable.selectItem(sharedFile4); - await toolbar.clickMoreActionsDelete(); - await page.clickSnackBarAction(); - await page.clickTrash(); - expect(await dataTable.isItemPresent(sharedFile4)).toBe(false, `${sharedFile4} was not restored`); - }); - - it('[C280514] undo delete of multiple files', async () => { - await dataTable.selectMultipleItems([sharedFile5, sharedFile6]); - await toolbar.clickMoreActionsDelete(); - await page.clickSnackBarAction(); - await page.clickTrash(); - expect(await dataTable.isItemPresent(sharedFile5)).toBe(false, `${sharedFile5} was not restored`); - expect(await dataTable.isItemPresent(sharedFile6)).toBe(false, `${sharedFile6} was not restored`); - }); - }); - - describe('on Favorites', () => { - const parent = `parentF-${Utils.random()}`; - let parentId: string; - - const favFile1 = `favFile1-${Utils.random()}.txt`; - const favFile2 = `favFile2-${Utils.random()}.txt`; - const favFile3 = `favFile3-${Utils.random()}.txt`; - const favFile4 = `favFile4-${Utils.random()}.txt`; - const favFile5 = `favFile5-${Utils.random()}.txt`; - const favFile6 = `favFile6-${Utils.random()}.txt`; - const favFile7 = `favFile7-${Utils.random()}.txt`; - - const favFolder1 = `favFolder1-${Utils.random()}`; - const favFolder2 = `favFolder2-${Utils.random()}`; - const favFolder3 = `favFolder3-${Utils.random()}`; - const favFolder4 = `favFolder4-${Utils.random()}`; - const favFolder5 = `favFolder5-${Utils.random()}`; - const favFolder6 = `favFolder6-${Utils.random()}`; - - const file1InFolder = `file1InFolder-${Utils.random()}.txt`; - const file2InFolder = `file2InFolder-${Utils.random()}.txt`; - 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 () => { - try { - parentId = await apis.user.createFolder(parent); - - const favFile1Id = await apis.user.createFile(favFile1, parentId); - const favFile2Id = await apis.user.createFile(favFile2, parentId); - const favFile3Id = await apis.user.createFile(favFile3, parentId); - const favFile4Id = await apis.user.createFile(favFile4, parentId); - const favFile5Id = await apis.user.createFile(favFile5, parentId); - const favFile6Id = await apis.user.createFile(favFile6, parentId); - const favFile7Id = await apis.user.createFile(favFile7, parentId); - - const favFolder1Id = await apis.user.createFolder(favFolder1, parentId); - const favFolder2Id = await apis.user.createFolder(favFolder2, parentId); - const favFolder3Id = await apis.user.createFolder(favFolder3, parentId); - const favFolder4Id = await apis.user.createFolder(favFolder4, parentId); - const favFolder5Id = await apis.user.createFolder(favFolder5, parentId); - const favFolder6Id = await apis.user.createFolder(favFolder6, parentId); - - await apis.user.createFile(file1InFolder, favFolder1Id); - fileLocked1Id = await apis.user.createFile(fileLocked1, favFolder2Id); - fileLocked2Id = await apis.user.createFile(fileLocked2, favFolder3Id); - fileLocked3Id = await apis.user.createFile(fileLocked3, favFolder4Id); - fileLocked4Id = await apis.user.createFile(fileLocked4, favFolder5Id); - await apis.user.nodes.createFile(file2InFolder, favFolder6Id); - - await userActions.lockNodes([fileLocked1Id, fileLocked2Id, fileLocked3Id, fileLocked4Id], 'FULL'); - - const initialFavoritesTotalItems = await apis.user.favorites.getFavoritesTotalItems(); - 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: initialFavoritesTotalItems + 13 }); - - await loginPage.loginWith(username); - } catch (error) { - Logger.error(`----- beforeAll failed : ${error}`); - } - }); - - beforeEach(async () => { - await page.clickFavoritesAndWait(); - }); - - afterAll(async () => { - try { - await userActions.login(username, username); - await userActions.unlockNodes([fileLocked1Id, fileLocked2Id, fileLocked3Id, fileLocked4Id]); - await userActions.deleteNodes([parentId]); - await userActions.emptyTrashcan(); - } catch (error) { - Logger.error(`----- afterAll failed : ${error}`); - } - }); - - it('[C280516] delete a file and check notification', async () => { - await dataTable.selectItem(favFile1); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toContain(`${favFile1} deleted`); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - expect(await dataTable.isItemPresent(favFile1)).toBe(false, `${favFile1} was not removed from list`); - await page.clickTrashAndWait(); - expect(await dataTable.isItemPresent(favFile1)).toBe(true, `${favFile1} is not in trash`); - }); - - it('[C280517] delete multiple files and check notification', async () => { - await dataTable.selectMultipleItems([favFile2, favFile3], parent); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toContain(`Deleted 2 items`); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - expect(await dataTable.isItemPresent(favFile2)).toBe(false, `${favFile2} was not removed from list`); - expect(await dataTable.isItemPresent(favFile3)).toBe(false, `${favFile3} was not removed from list`); - await page.clickTrashAndWait(); - expect(await dataTable.isItemPresent(favFile2)).toBe(true, `${favFile2} is not in trash`); - expect(await dataTable.isItemPresent(favFile3)).toBe(true, `${favFile3} is not in trash`); - }); - - it('[C280518] delete a folder with content', async () => { - await dataTable.selectItem(favFolder1, parent); - await toolbar.clickMoreActionsDelete(); - await dataTable.waitForHeader(); - expect(await dataTable.isItemPresent(favFolder1)).toBe(false, `${favFolder1} was not removed from list`); - await page.clickTrashAndWait(); - expect(await dataTable.isItemPresent(favFolder1)).toBe(true, `${favFolder1} is not in trash`); - expect(await dataTable.isItemPresent(file1InFolder)).toBe(false, `${file1InFolder} is in trash`); - }); - - it('[C280519] delete a folder containing locked files', async () => { - await dataTable.selectItem(favFolder2); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toContain(`${favFolder2} couldn't be deleted`); - expect(await dataTable.isItemPresent(favFolder2)).toBe(true, `${favFolder2} was removed from list`); - await page.clickTrash(); - expect(await dataTable.isItemPresent(favFolder2)).toBe(false, `${favFolder2} is in trash`); - expect(await dataTable.isItemPresent(fileLocked1)).toBe(false, `${fileLocked1} is in trash`); - }); - - it('[C280520] notification on multiple items deletion - some items fail to delete', async () => { - await dataTable.selectMultipleItems([favFile4, favFolder3], parent); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toContain(`Deleted 1 item, 1 couldn't be deleted`); - const action = await page.getSnackBarAction(); - expect(action).toContain('Undo'); - }); - - it('[C280521] notification on multiple items deletion - all items fail to delete', async () => { - await dataTable.selectMultipleItems([favFolder4, favFolder5], parent); - await toolbar.clickMoreActionsDelete(); - const message = await page.getSnackBarMessage(); - expect(message).toEqual(`2 items couldn't be deleted`); - const action = await page.getSnackBarAction(); - expect(action).not.toContain('Undo'); - }); - - it('[C280524] undo delete of file', async () => { - await dataTable.selectItem(favFile5, parent); - await toolbar.clickMoreActionsDelete(); - await page.clickSnackBarAction(); - await dataTable.waitForBody(); - expect(await dataTable.isItemPresent(favFile5)).toBe(true, `${favFile5} was not restored`); - }); - - it('[C280526] undo delete of folder with content', async () => { - await dataTable.selectItem(favFolder6); - await toolbar.clickMoreActionsDelete(); - await page.clickSnackBarAction(); - await dataTable.waitForBody(); - expect(await dataTable.isItemPresent(favFolder6)).toBe(true, `${favFolder6} was not restored`); - await dataTable.doubleClickOnRowByName(favFolder6); - await dataTable.waitForBody(); - expect(await dataTable.isItemPresent(file2InFolder)).toBe(true, `${file2InFolder} from ${favFolder6} not restored`); - }); - - it('[C280525] undo delete of multiple files', async () => { - await dataTable.selectMultipleItems([favFile6, favFile7]); - await toolbar.clickMoreActionsDelete(); - await page.clickSnackBarAction(); - await dataTable.waitForBody(); - expect(await dataTable.isItemPresent(favFile6)).toBe(true, `${favFile6} was not restored`); - expect(await dataTable.isItemPresent(favFile7)).toBe(true, `${favFile7} was not restored`); - }); - }); }); diff --git a/e2e/suites/actions/edit/edit-folder.test.ts b/e2e/suites/actions/edit/edit-folder.test.ts index 7b6892d5d..bd8a98d59 100755 --- a/e2e/suites/actions/edit/edit-folder.test.ts +++ b/e2e/suites/actions/edit/edit-folder.test.ts @@ -48,15 +48,12 @@ describe('Edit folder', () => { const duplicateFolderName = `folder-${Utils.random()}`; const folderNameEdited = `folder-renamed-${Utils.random()}`; - const folderNameEdited2 = `folder-search-renamed-${Utils.random()}`; const folderDescriptionEdited = 'description edited'; const sitePrivate = `site-private-${Utils.random()}`; const siteName = `site-${Utils.random()}`; const folderSite = `folder-site-${Utils.random()}`; - const folderSiteToEdit = `folder-site-${Utils.random()}`; - let folderSiteToEditId: string; const duplicateFolderSite = `folder-${Utils.random()}`; let docLibUserSite: string; @@ -81,7 +78,6 @@ describe('Edit folder', () => { const page = new BrowsingPage(); const editDialog = new CreateOrEditFolderDialog(); const { dataTable, toolbar } = page; - const { searchInput } = page.header; const adminApiActions = new AdminActions(); @@ -101,7 +97,6 @@ describe('Edit folder', () => { await apis.user.sites.createSite(siteName); docLibUserSite = await apis.user.sites.getDocLibId(siteName); await apis.user.nodes.createFolder(folderSite, docLibUserSite); - folderSiteToEditId = (await apis.user.nodes.createFolder(folderSiteToEdit, docLibUserSite)).entry.id; await apis.user.nodes.createFolder(duplicateFolderSite, docLibUserSite); folderFavoriteId = (await apis.user.nodes.createFolder(folderFavorite)).entry.id; @@ -240,115 +235,4 @@ describe('Edit folder', () => { expect(await dataTable.isItemPresent(folderName)).toBe(true, 'Folder not displayed in list view'); }); }); - - describe('on Favorites', () => { - beforeEach(async () => { - await page.clickFavoritesAndWait(); - }); - - it('[C280384] properties are modified when pressing OK', async () => { - await dataTable.selectItem(folderFavoriteToEdit); - await toolbar.openMoreMenu(); - await BrowserActions.click(toolbar.menu.editFolderAction); - await editDialog.waitForDialogToOpen(); - await editDialog.enterDescription(folderDescriptionEdited); - await editDialog.enterName(folderNameEdited); - await BrowserActions.click(editDialog.updateButton); - await editDialog.waitForDialogToClose(); - await dataTable.waitForHeader(); - - expect(await dataTable.isItemPresent(folderNameEdited)).toBe(true, 'Folder not displayed'); - const desc = await apis.user.nodes.getNodeProperty(folderFavoriteToEditId, 'cm:description'); - expect(desc).toEqual(folderDescriptionEdited); - }); - - it('[C280386] with duplicate folder name', async () => { - await dataTable.selectItem(folderFavorite); - await toolbar.openMoreMenu(); - await BrowserActions.click(toolbar.menu.editFolderAction); - await editDialog.waitForDialogToOpen(); - await editDialog.enterName(folderFavoriteDuplicate); - await BrowserActions.click(editDialog.updateButton); - - expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); - expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); - }); - }); - - describe('on My Libraries', () => { - beforeEach(async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - }); - - it('[C280509] properties are modified when pressing OK', async () => { - await dataTable.selectItem(folderSiteToEdit); - await toolbar.openMoreMenu(); - await BrowserActions.click(toolbar.menu.editFolderAction); - await editDialog.waitForDialogToOpen(); - await editDialog.enterDescription(folderDescriptionEdited); - await editDialog.enterName(folderNameEdited); - await BrowserActions.click(editDialog.updateButton); - await editDialog.waitForDialogToClose(); - await dataTable.waitForHeader(); - - expect(await dataTable.isItemPresent(folderNameEdited)).toBe(true, 'Folder not displayed'); - const desc = await apis.user.nodes.getNodeProperty(folderSiteToEditId, 'cm:description'); - expect(desc).toEqual(folderDescriptionEdited); - }); - - it('[C280511] with duplicate folder name', async () => { - await dataTable.selectItem(folderSite); - await toolbar.openMoreMenu(); - await BrowserActions.click(toolbar.menu.editFolderAction); - await editDialog.waitForDialogToOpen(); - await editDialog.enterName(duplicateFolderSite); - await BrowserActions.click(editDialog.updateButton); - - expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); - expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); - }); - }); - - describe('on Search Results', () => { - it('[C306947] properties are modified when pressing OK', async () => { - await page.clickPersonalFiles(); - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchFor(folderSearchToEdit); - await dataTable.waitForBody(); - - await dataTable.selectItem(folderSearchToEdit); - await toolbar.openMoreMenu(); - await BrowserActions.click(toolbar.menu.editFolderAction); - await editDialog.waitForDialogToOpen(); - await editDialog.enterDescription(folderDescriptionEdited); - await editDialog.enterName(folderNameEdited2); - await BrowserActions.click(editDialog.updateButton); - await editDialog.waitForDialogToClose(); - - await page.refresh(); - expect(await dataTable.isItemPresent(folderNameEdited2)).toBe(true, 'Folder not displayed'); - const desc = await apis.user.nodes.getNodeProperty(folderSearchToEditId, 'cm:description'); - expect(desc).toEqual(folderDescriptionEdited); - }); - - it('[C306948] with duplicate folder name', async () => { - await page.clickPersonalFiles(); - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchFor(folderSearch); - await dataTable.waitForBody(); - - await dataTable.selectItem(folderSearch); - await toolbar.openMoreMenu(); - await BrowserActions.click(toolbar.menu.editFolderAction); - await editDialog.waitForDialogToOpen(); - await editDialog.enterName(folderSearchDuplicate); - await BrowserActions.click(editDialog.updateButton); - - expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); - expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); - }); - }); }); diff --git a/e2e/suites/actions/edit/edit-offline.test.ts b/e2e/suites/actions/edit/edit-offline.test.ts index 0c251e3e5..60cd43d45 100755 --- a/e2e/suites/actions/edit/edit-offline.test.ts +++ b/e2e/suites/actions/edit/edit-offline.test.ts @@ -31,17 +31,7 @@ describe('Edit offline', () => { const file1 = `file1-${Utils.random()}.docx`; const fileLocked = `file-locked-${Utils.random()}.docx`; const fileLocked2 = `file-locked2-${Utils.random()}.docx`; - - const searchRandom = Utils.random(); - const fileSearch1 = `file-search-1-${searchRandom}.docx`; - const fileSearchLocked = `file-search-locked-${searchRandom}.docx`; - const fileSearchLocked2 = `file-search-locked2-${searchRandom}.docx`; - const parentPF = `parentPersonal-${Utils.random()}`; - const parentSF = `parentShared-${Utils.random()}`; - const parentRF = `parentRecent-${Utils.random()}`; - const parentFav = `parentFav-${Utils.random()}`; - const parentSearch = `parentSearch-${Utils.random()}`; const apis = { user: new RepoClient(username, username) @@ -50,7 +40,6 @@ describe('Edit offline', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); const { dataTable, toolbar } = page; - const { searchInput } = page.header; const adminApiActions = new AdminActions(); const userActions = new UserActions(); @@ -115,228 +104,4 @@ describe('Edit offline', () => { expect(await dataTable.hasLockIcon(fileLocked)).toBe(false, `${fileLocked} has a lock icon`); }); }); - - describe('on Shared Files', () => { - let parentSFId: string; - let file1Id: string; - let fileLockedId: string; - let fileLocked2Id: string; - - beforeAll(async () => { - parentSFId = await apis.user.createFolder(parentSF); - - file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, file1)).entry.id; - fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, fileLocked)).entry.id; - fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, fileLocked2)).entry.id; - - await userActions.lockNodes([fileLockedId, fileLocked2Id]); - - await apis.user.shared.shareFilesByIds([file1Id, fileLockedId, fileLocked2Id]); - await apis.user.shared.waitForFilesToBeShared([file1Id, fileLockedId, fileLocked2Id]); - - await loginPage.loginWith(username); - }); - - afterAll(async () => { - await userActions.deleteNodes([parentSFId]); - }); - - beforeEach(async () => { - await page.clickSharedFilesAndWait(); - }); - - afterEach(async () => { - await Utils.pressEscape(); - }); - - it('[C306950] File is locked and downloaded when clicking Edit Offline', async () => { - await dataTable.selectItem(file1, parentSF); - await toolbar.clickMoreActionsEditOffline(); - - expect(await Utils.fileExistsOnOS(file1)).toBe(true, 'File not found in download location'); - expect(await apis.user.nodes.isFileLockedWrite(file1Id)).toBe(true, `${file1} is not locked`); - }); - - it('[C306951] Lock information is displayed', async () => { - expect(await dataTable.isItemPresent(fileLocked2, parentSF)).toBe(true, `${fileLocked2} is not displayed`); - expect(await dataTable.hasLockIcon(fileLocked2, parentSF)).toBe(true, `${fileLocked2} does not have a lock icon`); - expect(await dataTable.getLockOwner(fileLocked2, parentSF)).toContain(username, `${fileLocked2} does not have correct lock owner info`); - }); - - it('[C306952] Cancel Editing unlocks the file', async () => { - await dataTable.selectItem(fileLocked); - await toolbar.clickMoreActionsCancelEditing(); - await dataTable.unselectItem(fileLocked); - - expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`); - expect(await dataTable.hasLockIcon(fileLocked, parentSF)).toBe(false, `${fileLocked} has a lock icon`); - }); - }); - - describe('on Recent Files', () => { - let parentRFId: string; - let file1Id: string; - let fileLockedId: string; - let fileLocked2Id: string; - - beforeAll(async () => { - parentRFId = await apis.user.createFolder(parentRF); - - await apis.user.search.waitForApi(username, { expect: 0 }); - - file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, file1)).entry.id; - fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, fileLocked)).entry.id; - fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, fileLocked2)).entry.id; - - await userActions.lockNodes([fileLockedId, fileLocked2Id]); - - await apis.user.search.waitForApi(username, { expect: 3 }); - - await loginPage.loginWith(username); - }); - - afterAll(async () => { - await userActions.deleteNodes([parentRFId]); - }); - - beforeEach(async () => { - await page.clickRecentFilesAndWait(); - }); - - afterEach(async () => { - await Utils.pressEscape(); - }); - - it('[C297541] File is locked and downloaded when clicking Edit Offline', async () => { - await dataTable.selectItem(file1, parentRF); - await toolbar.clickMoreActionsEditOffline(); - - expect(await Utils.fileExistsOnOS(file1)).toBe(true, 'File not found in download location'); - expect(await apis.user.nodes.isFileLockedWrite(file1Id)).toBe(true, `${file1} is not locked`); - }); - - it('[C297542] Lock information is displayed', async () => { - expect(await dataTable.isItemPresent(fileLocked2, parentRF)).toBe(true, `${fileLocked2} is not displayed`); - expect(await dataTable.hasLockIcon(fileLocked2, parentRF)).toBe(true, `${fileLocked2} does not have a lock icon`); - expect(await dataTable.getLockOwner(fileLocked2, parentRF)).toContain(username, `${fileLocked2} does not have correct lock owner info`); - }); - - it('[C297543] Cancel Editing unlocks the file', async () => { - await dataTable.selectItem(fileLocked, parentRF); - await toolbar.clickMoreActionsCancelEditing(); - await dataTable.unselectItem(fileLocked, parentRF); - - expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`); - expect(await dataTable.hasLockIcon(fileLocked, parentRF)).toBe(false, `${fileLocked} has a lock icon`); - }); - }); - - describe('on Favorite Files', () => { - let parentFavId: string; - let fileLockedId: string; - let fileLocked2Id: string; - - beforeAll(async () => { - parentFavId = await apis.user.createFolder(parentFav); - - fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentFavId, fileLocked)).entry.id; - fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentFavId, fileLocked2)).entry.id; - - userActions.lockNodes([fileLockedId, fileLocked2Id]); - - await apis.user.favorites.addFavoritesByIds('file', [fileLockedId, fileLocked2Id]); - await apis.user.favorites.waitForApi({ expect: 2 }); - - await loginPage.loginWith(username); - }); - - afterAll(async () => { - await userActions.deleteNodes([parentFavId]); - }); - - beforeEach(async () => { - await page.clickFavoritesAndWait(); - }); - - afterEach(async () => { - await Utils.pressEscape(); - }); - - it('[C306957] Lock information is displayed', async () => { - expect(await dataTable.isItemPresent(fileLocked2)).toBe(true, `${fileLocked2} is not displayed`); - expect(await dataTable.hasLockIcon(fileLocked2)).toBe(true, `${fileLocked2} does not have a lock icon`); - expect(await dataTable.getLockOwner(fileLocked2)).toContain(username, `${fileLocked2} does not have correct lock owner info`); - }); - - it('[C306958] Cancel Editing unlocks the file', async () => { - await dataTable.selectItem(fileLocked); - await toolbar.clickMoreActionsCancelEditing(); - await dataTable.unselectItem(fileLocked); - - expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`); - expect(await dataTable.hasLockIcon(fileLocked)).toBe(false, `${fileLocked} has a lock icon`); - }); - }); - - describe('on Search Results', () => { - let parentSearchId: string; - let fileSearch1Id: string; - let fileSearchLockedId: string; - let fileSearchLocked2Id: string; - - beforeAll(async () => { - parentSearchId = await apis.user.createFolder(parentSearch); - - fileSearch1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearch1)).entry.id; - fileSearchLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearchLocked)).entry.id; - fileSearchLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearchLocked2)).entry.id; - - await userActions.lockNodes([fileSearchLockedId, fileSearchLocked2Id]); - - await apis.user.search.waitForNodes(searchRandom, { expect: 3 }); - - await loginPage.loginWith(username); - }); - - afterAll(async () => { - await userActions.deleteNodes([parentSearchId]); - }); - - beforeEach(async () => { - await page.clickPersonalFilesAndWait(); - await searchInput.clickSearchButton(); - await searchInput.searchFor(searchRandom); - await dataTable.waitForBody(); - }); - - afterEach(async () => { - await Utils.pressEscape(); - }); - - it('[C306953] File is locked and downloaded when clicking Edit Offline', async () => { - await dataTable.selectItem(fileSearch1, parentSearch); - await toolbar.clickMoreActionsEditOffline(); - - expect(await Utils.fileExistsOnOS(fileSearch1)).toBe(true, 'File not found in download location'); - expect(await apis.user.nodes.isFileLockedWrite(fileSearch1Id)).toBe(true, `${fileSearch1} is not locked`); - }); - - it('[C306954] Lock information is displayed', async () => { - expect(await dataTable.isItemPresent(fileSearchLocked2, parentSearch)).toBe(true, `${fileSearchLocked2} is not displayed`); - expect(await dataTable.hasLockIcon(fileSearchLocked2, parentSearch)).toBe(true, `${fileSearchLocked2} does not have a lock icon`); - expect(await dataTable.getLockOwnerToolTip(fileSearchLocked2, parentSearch)).toContain( - username, - `${fileSearchLocked2} does not have correct lock owner info` - ); - }); - - it('[C306955] Cancel Editing unlocks the file', async () => { - await dataTable.selectItem(fileSearchLocked, parentSearch); - await toolbar.clickMoreActionsCancelEditing(); - await dataTable.unselectItem(fileSearchLocked); - - expect(await apis.user.nodes.isFileLockedWrite(fileSearchLockedId)).toBe(false, `${fileSearchLocked} is still locked`); - expect(await dataTable.hasLockIcon(fileSearchLocked, parentSearch)).toBe(false, `${fileSearchLocked} has a lock icon`); - }); - }); }); diff --git a/e2e/suites/actions/favorite/mark-favorite.test.ts b/e2e/suites/actions/favorite/mark-favorite.test.ts index 96a44da81..361860f68 100644 --- a/e2e/suites/actions/favorite/mark-favorite.test.ts +++ b/e2e/suites/actions/favorite/mark-favorite.test.ts @@ -23,7 +23,7 @@ * along with Alfresco. If not, see . */ -import { AdminActions, LoginPage, BrowsingPage, SITE_VISIBILITY, RepoClient, Utils, UserActions } from '@alfresco/aca-testing-shared'; +import { AdminActions, LoginPage, BrowsingPage, RepoClient, Utils, UserActions } from '@alfresco/aca-testing-shared'; describe('Mark items as favorites', () => { const username = `user-${Utils.random()}`; @@ -53,27 +53,6 @@ describe('Mark items as favorites', () => { let folderId: string; let parentId: string; - const searchRandom = Utils.random(); - const fileSearchNotFav1 = `search-${searchRandom}-fileNotFav1.txt`; - const fileSearchNotFav2 = `search-${searchRandom}-fileNotFav2.txt`; - const fileSearchNotFav3 = `search-${searchRandom}-fileNotFav3.txt`; - const fileSearchNotFav4 = `search-${searchRandom}-fileNotFav4.txt`; - const fileSearchFav1 = `search-${searchRandom}-fileFav1.txt`; - const fileSearchFav2 = `search-${searchRandom}-fileFav2.txt`; - const fileSearchFav3 = `search-${searchRandom}-fileFav3.txt`; - const fileSearchFav4 = `search-${searchRandom}-fileFav4.txt`; - const folderSearch = `search-${searchRandom}-folder`; - - 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 = { user: new RepoClient(username, username) }; @@ -81,7 +60,6 @@ describe('Mark items as favorites', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); const { dataTable, toolbar } = page; - const { searchInput } = page.header; const adminApiActions = new AdminActions(); const userActions = new UserActions(); @@ -215,349 +193,4 @@ describe('Mark items as favorites', () => { expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); }); }); - - describe('on Recent Files', () => { - afterAll(async () => { - try { - await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]); - await apis.user.favorites.removeFavoritesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]); - } catch (error) {} - }); - - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickRecentFilesAndWait(); - }); - - it('[C280352] favorite a file', async () => { - await dataTable.selectItem(fileNotFav1); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true })).toBe(true, `${fileNotFav1} not marked as favorite`); - }); - - it('[C280353] unfavorite an item', async () => { - await dataTable.selectItem(fileFav1); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); - }); - - it('[C280355] favorite multiple items - all unfavorite', async () => { - await dataTable.selectMultipleItems([fileNotFav2, fileNotFav3]); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true })).toBe(true, `${fileNotFav3} not marked as favorite`); - }); - - it('[C280357] favorite multiple items - some favorite and some unfavorite', async () => { - await dataTable.selectMultipleItems([fileNotFav4, fileFav2]); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true })).toBe(true, `${fileFav2} not marked as favorite`); - }); - - it('[C280356] unfavorite multiple items', async () => { - await dataTable.selectMultipleItems([fileFav3, fileFav4]); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); - }); - }); - - describe('on Shared Files', () => { - afterAll(async () => { - try { - await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]); - await apis.user.favorites.removeFavoritesByIds([fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]); - } catch (error) {} - }); - - beforeEach(async () => { - await Utils.pressEscape(); - await page.clickSharedFilesAndWait(); - }); - - it('[C280362] favorite a file', async () => { - await dataTable.selectItem(fileNotFav1); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true })).toBe(true, `${fileNotFav1} not marked as favorite`); - }); - - it('[C280363] unfavorite an item', async () => { - await dataTable.selectItem(fileFav1); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); - }); - - it('[C280365] favorite multiple items - all unfavorite', async () => { - await dataTable.selectMultipleItems([fileNotFav2, fileNotFav3]); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true })).toBe(true, `${fileNotFav3} not marked as favorite`); - }); - - it('[C280367] favorite multiple items - some favorite and some unfavorite', async () => { - await dataTable.selectMultipleItems([fileNotFav4, fileFav2]); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true })).toBe(true, `${fileFav2} not marked as favorite`); - }); - - it('[C280366] unfavorite multiple items', async () => { - await dataTable.selectMultipleItems([fileFav3, fileFav4]); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); - }); - }); - - describe('on Favorites', () => { - afterAll(async () => { - try { - await apis.user.favorites.addFavoritesByIds('file', [fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]); - } catch (error) {} - }); - - beforeEach(async () => { - await Utils.pressEscape(); - await page.refresh(); - await page.clickFavoritesAndWait(); - }); - - it('[C280368] unfavorite an item', async () => { - await dataTable.selectItem(fileFav1); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); - expect(await dataTable.isItemPresent(fileFav1)).toBe(false, 'item still displayed'); - }); - - it('[C280374] unfavorite multiple items', async () => { - await dataTable.selectMultipleItems([fileFav3, fileFav4]); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); - expect(await dataTable.isItemPresent(fileFav3)).toBe(false, 'file3 still displayed'); - expect(await dataTable.isItemPresent(fileFav4)).toBe(false, 'file4 still displayed'); - }); - - it('[C280371] Favorite action has full star icon for items marked as favorite', async () => { - await dataTable.selectItem(fileFav2); - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.getItemIconText('Remove Favorite')).toEqual('star'); - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Search Results', () => { - beforeAll(async () => { - fileSearchNotFav1Id = await apis.user.createFile(fileSearchNotFav1, parentId); - fileSearchNotFav2Id = await apis.user.createFile(fileSearchNotFav2, parentId); - fileSearchNotFav3Id = await apis.user.createFile(fileSearchNotFav3, parentId); - fileSearchNotFav4Id = await apis.user.createFile(fileSearchNotFav4, parentId); - fileSearchFav1Id = await apis.user.createFile(fileSearchFav1, parentId); - fileSearchFav2Id = await apis.user.createFile(fileSearchFav2, parentId); - fileSearchFav3Id = await apis.user.createFile(fileSearchFav3, parentId); - fileSearchFav4Id = await apis.user.createFile(fileSearchFav4, parentId); - folderSearchId = await apis.user.createFolder(folderSearch, parentId); - await apis.user.search.waitForNodes(searchRandom, { expect: 9 }); - - await apis.user.favorites.addFavoritesByIds('file', [fileSearchFav1Id, fileSearchFav2Id, fileSearchFav3Id, fileSearchFav4Id]); - - await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); - await searchInput.searchFor(searchRandom); - await dataTable.waitForBody(); - }); - - afterAll(async () => { - await page.header.expandSideNav(); - await page.clickPersonalFiles(); - }); - - it('[C306966] favorite a file', async () => { - await dataTable.selectItem(fileSearchNotFav1); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav1Id, { expect: true })).toBe( - true, - `${fileSearchNotFav1} not marked as favorite` - ); - }); - - it('[C306971] favorite a folder', async () => { - await dataTable.selectItem(folderSearch); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(folderSearchId, { expect: true })).toBe(true, `${folderSearch} not marked as favorite`); - }); - - it('[C306967] unfavorite an item', async () => { - await dataTable.selectItem(fileSearchFav1); - await toolbar.clickMoreActionsRemoveFavorite(); - - 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 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` - ); - }); - - it('[C306970] favorite multiple items - some favorite and some unfavorite', async () => { - 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` - ); - }); - - it('[C306969] unfavorite multiple items', async () => { - await dataTable.selectMultipleItems([fileSearchFav3, fileSearchFav4]); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav3Id, { expect: false })).toBe(false, `${fileSearchFav3} marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav4Id, { expect: false })).toBe(false, `${fileSearchFav4} marked as favorite`); - }); - }); - - describe('on File Libraries', () => { - const siteName = `site-public-${Utils.random()}`; - - const folderSite = `folderSite-${Utils.random()}`; - - const fileSiteNotFav1 = `fileSiteNotFav1-${Utils.random()}.txt`; - const fileSiteNotFav2 = `fileSiteNotFav2-${Utils.random()}.txt`; - const fileSiteNotFav3 = `fileSiteNotFav3-${Utils.random()}.txt`; - const fileSiteNotFav4 = `fileSiteNotFav4-${Utils.random()}.txt`; - const fileSiteFav1 = `fileSiteFav1-${Utils.random()}.txt`; - const fileSiteFav2 = `fileSiteFav2-${Utils.random()}.txt`; - const fileSiteFav3 = `fileSiteFav3-${Utils.random()}.txt`; - const fileSiteFav4 = `fileSiteFav4-${Utils.random()}.txt`; - - 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 () => { - await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC); - const docLibId = await apis.user.sites.getDocLibId(siteName); - - folderSiteId = await apis.user.createFolder(folderSite, docLibId); - fileSiteNotFav1Id = await apis.user.createFile(fileSiteNotFav1, folderSiteId); - fileSiteNotFav2Id = await apis.user.createFile(fileSiteNotFav2, folderSiteId); - fileSiteNotFav3Id = await apis.user.createFile(fileSiteNotFav3, folderSiteId); - fileSiteNotFav4Id = await apis.user.createFile(fileSiteNotFav4, folderSiteId); - fileSiteFav1Id = await apis.user.createFile(fileSiteFav1, folderSiteId); - fileSiteFav2Id = await apis.user.createFile(fileSiteFav2, folderSiteId); - fileSiteFav3Id = await apis.user.createFile(fileSiteFav3, folderSiteId); - fileSiteFav4Id = await apis.user.createFile(fileSiteFav4, folderSiteId); - - 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 }); - await apis.user.favorites.isFavoriteWithRetry(fileSiteFav3Id, { expect: true }); - await apis.user.favorites.isFavoriteWithRetry(fileSiteFav4Id, { expect: true }); - }); - - afterAll(async () => { - await userActions.deleteSites([siteName]); - }); - - beforeEach(async () => { - await Utils.pressEscape(); - await page.goToMyLibrariesAndWait(); - await page.dataTable.doubleClickOnRowByName(siteName); - await page.dataTable.waitForHeader(); - }); - - it('[C280391] Favorite a folder', async () => { - await dataTable.selectItem(folderSite); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(folderSiteId, { expect: true })).toBe(true, `${folderSite} not marked as favorite`); - }); - - it('[C280342] Favorite a file', async () => { - await page.dataTable.doubleClickOnRowByName(folderSite); - await dataTable.selectItem(fileSiteNotFav1); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteNotFav1Id, { expect: true })).toBe( - true, - `${fileSiteNotFav1} not marked as favorite` - ); - }); - - it('[C280343] Unfavorite an item', async () => { - await page.dataTable.doubleClickOnRowByName(folderSite); - await dataTable.selectItem(fileSiteFav1); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteFav1Id, { expect: false })).toBe(false, `${fileSiteFav1} is marked as favorite`); - }); - - it('[C280345] Favorite multiple items - all unfavorite', async () => { - await page.dataTable.doubleClickOnRowByName(folderSite); - await dataTable.selectMultipleItems([fileSiteNotFav2, fileSiteNotFav3]); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteNotFav2Id, { expect: true })).toBe(true, 'item not marked as favorite'); - expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteNotFav3Id, { expect: true })).toBe(true, 'item not marked as favorite'); - }); - - it('[C280346] Unfavorite multiple items', async () => { - await page.dataTable.doubleClickOnRowByName(folderSite); - await dataTable.selectMultipleItems([fileSiteFav2, fileSiteFav3]); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteFav2Id, { expect: false })).toBe(false, 'item marked as favorite'); - expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteFav3Id, { expect: false })).toBe(false, 'item marked as favorite'); - }); - - it('[C280347] Favorite multiple items - some favorite and some unfavorite', async () => { - await page.dataTable.doubleClickOnRowByName(folderSite); - await dataTable.selectMultipleItems([fileSiteNotFav4, fileSiteFav4]); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteNotFav4Id, { expect: true })).toBe(true, 'item not marked as favorite'); - expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteFav4Id, { expect: true })).toBe(true, 'item not marked as favorite'); - }); - }); }); diff --git a/e2e/suites/actions/upload-download/download.test.ts b/e2e/suites/actions/upload-download/download.test.ts index 9559e6900..d10616a82 100755 --- a/e2e/suites/actions/upload-download/download.test.ts +++ b/e2e/suites/actions/upload-download/download.test.ts @@ -23,7 +23,7 @@ * along with Alfresco. If not, see . */ -import { AdminActions, UserActions, LoginPage, BrowsingPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared'; +import { AdminActions, UserActions, LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared'; import { BrowserActions } from '@alfresco/adf-testing'; describe('Download', () => { @@ -50,10 +50,6 @@ describe('Download', () => { const fileInFolderSearch = `fileInFolderSearch-${random}.txt`; const unzippedPersonal = `unzippedPersonal-${random}`; - const unzippedRecent = `unzippedRecent-${random}`; - const unzippedShared = `unzippedShared-${random}`; - const unzippedFavorites = `unzippedFavorites-${random}`; - const unzippedSearch = `unzippedSearch-${random}`; let fileShared1Id: string; let fileShared2Id: string; @@ -71,8 +67,6 @@ describe('Download', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); const { dataTable, toolbar } = page; - const searchResultsPage = new SearchResultsPage(); - const { searchInput } = searchResultsPage.header; let initialFavoritesTotalItems: number; let initialRecentTotalItems: number; @@ -170,141 +164,4 @@ describe('Download', () => { ); }); }); - - describe('on Favorites', () => { - beforeEach(async () => { - await page.clickFavoritesAndWait(); - }); - - it('[C280173] Download a file', async () => { - await dataTable.selectItem(fileFavorites); - await BrowserActions.click(toolbar.downloadButton); - - expect(await Utils.fileExistsOnOS(fileFavorites)).toBe(true, 'File not found in download location'); - }); - - it('[C280188] Download a folder', async () => { - await dataTable.selectItem(folderFavorites); - await BrowserActions.click(toolbar.downloadButton); - - const folderZip = `${folderFavorites}.zip`; - - expect(await Utils.fileExistsOnOS(folderZip)).toBe(true, 'File not found in download location'); - - await Utils.unzip(folderZip); - - expect(await Utils.fileExistsOnOS(fileInFolderFavorites, folderFavorites)); - }); - - it('[C280189] Download multiple items', async () => { - await dataTable.selectMultipleItems([fileFavorites, folderFavorites]); - await BrowserActions.click(toolbar.downloadButton); - - expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); - - await Utils.unzip(archiveZip, unzippedFavorites); - - 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}` - ); - }); - }); - - describe('on Shared Files', () => { - beforeEach(async () => { - await page.clickSharedFilesAndWait(); - }); - - it('[C280170] Download a file', async () => { - await dataTable.selectItem(fileShared1); - await BrowserActions.click(toolbar.downloadButton); - - expect(await Utils.fileExistsOnOS(fileShared1)).toBe(true, 'File not found in download location'); - }); - - it('[C280183] Download multiple items', async () => { - await dataTable.selectMultipleItems([fileShared1, fileShared2]); - await BrowserActions.click(toolbar.downloadButton); - - expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); - - await Utils.unzip(archiveZip, unzippedShared); - - 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', () => { - beforeEach(async () => { - await page.clickRecentFilesAndWait(); - }); - - it('[C280167] Download a file', async () => { - await dataTable.selectItem(fileRecent1); - await BrowserActions.click(toolbar.downloadButton); - - expect(await Utils.fileExistsOnOS(fileRecent1)).toBe(true, 'File not found in download location'); - }); - - it('[C280177] Download multiple items', async () => { - await dataTable.selectMultipleItems([fileRecent1, fileRecent2]); - await BrowserActions.click(toolbar.downloadButton); - - expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); - - await Utils.unzip(archiveZip, unzippedRecent); - - 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 () => { - await page.clickPersonalFilesAndWait(); - await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); - await searchInput.searchFor(random); - }); - - it('[C279164] Download a file', async () => { - await dataTable.selectItem(fileSearch, parent); - await BrowserActions.click(toolbar.downloadButton); - - expect(await Utils.fileExistsOnOS(fileSearch)).toBe(true, 'File not found in download location'); - }); - - it('[C297694] Download a folder', async () => { - await dataTable.selectItem(folderSearch, parent); - await BrowserActions.click(toolbar.downloadButton); - - const folderZip = `${folderSearch}.zip`; - - expect(await Utils.fileExistsOnOS(folderZip)).toBe(true, 'File not found in download location'); - - await Utils.unzip(folderZip); - - expect(await Utils.fileExistsOnOS(fileInFolderSearch, folderSearch)); - }); - - it('[C297695] Download multiple items', async () => { - await dataTable.selectMultipleItems([fileSearch, folderSearch], parent); - await BrowserActions.click(toolbar.downloadButton); - - expect(await Utils.fileExistsOnOS(archiveZip)).toBe(true, 'File not found in download location'); - - await Utils.unzip(archiveZip, unzippedSearch); - - 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}` - ); - }); - }); }); diff --git a/e2e/suites/actions/upload-download/version-actions.test.ts b/e2e/suites/actions/upload-download/version-actions.test.ts index 65d1a5ad6..0dd185d2b 100644 --- a/e2e/suites/actions/upload-download/version-actions.test.ts +++ b/e2e/suites/actions/upload-download/version-actions.test.ts @@ -57,7 +57,6 @@ describe('Version actions', () => { const { dataTable, toolbar } = page; const versionManagePage = new ManageVersionsDialog(); const viewerPage = new Viewer(); - const { searchInput } = page.header; const adminApiActions = new AdminActions(); const userActions = new UserActions(); @@ -127,121 +126,4 @@ describe('Version actions', () => { expect(await Utils.fileExistsOnOS(filesToUpload[0])).toBe(true, 'File not found in download location'); }); }); - - describe('on Shared Files', () => { - beforeEach(async () => { - await page.clickSharedFilesAndWait(); - await dataTable.selectItem(filesToUpload[4], parentFolder); - await toolbar.clickMoreActionsManageVersions(); - await versionManagePage.viewFileVersion('2.0'); - }); - - afterEach(async () => { - await page.closeOpenDialogs(); - await Utils.pressEscape(); - }); - - it('[C586776] Should be possible to view a previous document version', async () => { - expect(await browser.getCurrentUrl()).toContain('2.0'); - }); - - it('[C586777] Previous document version title should be the same in Preview mode as the Uploaded File', async () => { - expect(await viewerPage.getFileTitle()).toContain(filesToUpload[1]); - }); - - it('[C586778] Should be possible to download a previous document version', async () => { - await viewerPage.toolbar.downloadButton.click(); - - expect(await Utils.fileExistsOnOS(filesToUpload[1])).toBe(true, 'File not found in download location'); - }); - }); - - describe('on Recent Files', () => { - beforeEach(async () => { - await page.clickRecentFilesAndWait(); - await dataTable.selectItem(filesToUpload[4], parentFolder); - await toolbar.clickMoreActionsManageVersions(); - await versionManagePage.viewFileVersion('3.0'); - }); - - afterEach(async () => { - await page.closeOpenDialogs(); - await Utils.pressEscape(); - }); - - it('[C586769] Should be possible to view a previous document version', async () => { - expect(await browser.getCurrentUrl()).toContain('3.0'); - }); - - it('[C586770] Previous document version title should be the same in Preview mode as the Uploaded File', async () => { - expect(await viewerPage.getFileTitle()).toContain(filesToUpload[2]); - }); - - it('[C586771] Should be possible to download a previous document version', async () => { - await viewerPage.toolbar.downloadButton.click(); - - expect(await Utils.fileExistsOnOS(filesToUpload[2])).toBe(true, 'File not found in download location'); - }); - }); - - describe('on Favorite Files', () => { - beforeEach(async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectItem(filesToUpload[4], parentFolder); - await toolbar.clickMoreActionsManageVersions(); - await versionManagePage.viewFileVersion('4.0'); - }); - - afterEach(async () => { - await page.closeOpenDialogs(); - await Utils.pressEscape(); - }); - - it('[C586772] Should be possible to view a previous document version', async () => { - expect(await browser.getCurrentUrl()).toContain('4.0'); - }); - - it('[C586773] Previous document version title should be the same in Preview mode as the Uploaded File', async () => { - expect(await viewerPage.getFileTitle()).toContain(filesToUpload[3]); - }); - - it('[C586774] Should be possible to download a previous document version', async () => { - await viewerPage.toolbar.downloadButton.click(); - - expect(await Utils.fileExistsOnOS(filesToUpload[3])).toBe(true, 'File not found in download location'); - }); - }); - - describe('on Search Results', () => { - beforeEach(async () => { - await page.clickPersonalFiles(); - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchFor(`${filesToUpload[4]} AND PARENT:"workspace://SpacesStore/${parentFolderId}"`); - await dataTable.waitForBody(); - - await dataTable.selectItem(filesToUpload[4], parentFolder); - await toolbar.clickMoreActionsManageVersions(); - await versionManagePage.viewFileVersion('5.0'); - }); - - afterEach(async () => { - await page.closeOpenDialogs(); - await Utils.pressEscape(); - }); - - it('[C586779] Should be possible to view a previous document version', async () => { - expect(await browser.getCurrentUrl()).toContain('5.0'); - }); - - it('[C586780] Previous document version title should be the same in Preview mode as the Uploaded File', async () => { - expect(await viewerPage.getFileTitle()).toContain(filesToUpload[4]); - }); - - it('[C586781] Should be possible to download a previous document version', async () => { - await viewerPage.toolbar.downloadButton.click(); - - expect(await Utils.fileExistsOnOS(filesToUpload[4])).toBe(true, 'File not found in download location'); - }); - }); }); diff --git a/e2e/suites/application/page-titles.test.ts b/e2e/suites/application/page-titles.test.ts index 6f3e148cb..8e18562ce 100755 --- a/e2e/suites/application/page-titles.test.ts +++ b/e2e/suites/application/page-titles.test.ts @@ -24,7 +24,19 @@ */ import { browser } from 'protractor'; -import { PAGE_TITLES, LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared'; +import { LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared'; + +const PAGE_TITLES = { + PERSONAL_FILES: 'Personal Files', + MY_LIBRARIES: 'My Libraries', + FAVORITE_LIBRARIES: 'Favorite Libraries', + SHARED_FILES: 'Shared', + RECENT_FILES: 'Recent Files', + FAVORITES: 'Favorites', + TRASH: 'Trash', + VIEWER: 'Preview', + SEARCH: 'Search Results' +}; describe('Page titles', () => { const loginPage = new LoginPage(); diff --git a/projects/aca-testing-shared/src/configs.ts b/projects/aca-testing-shared/src/configs.ts index e98e91705..4184ab17c 100755 --- a/projects/aca-testing-shared/src/configs.ts +++ b/projects/aca-testing-shared/src/configs.ts @@ -56,19 +56,6 @@ export const SIDEBAR_LABELS = { TRASH: 'Trash' }; -// Page titles -export const PAGE_TITLES = { - PERSONAL_FILES: 'Personal Files', - MY_LIBRARIES: 'My Libraries', - FAVORITE_LIBRARIES: 'Favorite Libraries', - SHARED_FILES: 'Shared', - RECENT_FILES: 'Recent Files', - FAVORITES: 'Favorites', - TRASH: 'Trash', - VIEWER: 'Preview', - SEARCH: 'Search Results' -}; - // Site visibility export const SITE_VISIBILITY = { PUBLIC: 'PUBLIC',