From 9dba35baed8bba3e5dba9c229f05552f27bd81ac Mon Sep 17 00:00:00 2001 From: Cilibiu Bogdan Date: Tue, 24 Jul 2018 12:23:08 +0300 Subject: [PATCH] [ACA] Document List - e2e fix (#522) * e2e fix * fix name column as link * fix 1 --- e2e/components/data-table/data-table.ts | 37 +++++++--- e2e/suites/actions/delete.test.ts | 32 ++++----- e2e/suites/actions/edit-folder.test.ts | 18 ++--- e2e/suites/actions/mark-favorite.test.ts | 42 +++++------ e2e/suites/actions/permanently-delete.test.ts | 6 +- e2e/suites/actions/restore.test.ts | 16 ++--- .../toolbar-multiple-selection.test.ts | 62 ++++++++-------- .../actions/toolbar-single-selection.test.ts | 70 +++++++++---------- e2e/suites/actions/undo-delete.test.ts | 36 +++++----- e2e/suites/actions/upload-file.test.ts | 2 +- e2e/suites/list-views/favorites.test.ts | 2 +- e2e/suites/list-views/file-libraries.test.ts | 4 +- e2e/suites/list-views/personal-files.test.ts | 4 +- e2e/suites/list-views/tooltips.test.ts | 2 +- .../pagination/pag-personal-files.test.ts | 2 +- .../favorites/favorites.component.html | 6 +- src/app/components/files/files.component.html | 6 +- .../libraries/libraries.component.html | 7 +- .../recent-files/recent-files.component.html | 6 +- .../shared-files/shared-files.component.html | 7 +- .../ui/overrides/adf-document-list.theme.scss | 10 +++ 21 files changed, 205 insertions(+), 172 deletions(-) diff --git a/e2e/components/data-table/data-table.ts b/e2e/components/data-table/data-table.ts index c9cdf9ed6..eb4d788e1 100755 --- a/e2e/components/data-table/data-table.ts +++ b/e2e/components/data-table/data-table.ts @@ -141,18 +141,10 @@ export class DataTable extends Component { return this.body.element(by.cssContainingText(`.adf-data-table-cell span`, name)); } - getRowLink(name: string): ElementFinder { - return this.body.element(by.cssContainingText(`.adf-data-table-cell a`, name)); - } - getItemNameTooltip(name: string): promise.Promise { return this.getRowName(name).getAttribute('title'); } - getLinkCellTooltip(name: string): promise.Promise { - return this.getRowLink(name).getAttribute('title'); - } - countRows(): promise.Promise { return this.getRows().count(); } @@ -172,12 +164,41 @@ export class DataTable extends Component { return dblClick.perform(); } + // Navigation/selection methods + doubleClickOnItemNameRow(name: string): promise.Promise { + const dblClick = browser.actions() + .mouseMove(this.getRowName(name).element(by.xpath(`./ancestor::div[contains(@class, 'adf-datatable-row')]`))) + .click() + .click(); + + return dblClick.perform(); + } + clickOnItemName(name: string): promise.Promise { const item = this.getRowName(name); return Utils.waitUntilElementClickable(item) .then(() => this.getRowName(name).click()); } + clickOnItemNameRow(name: string): promise.Promise { + const item = this.getRowName(name); + return Utils.waitUntilElementClickable(item) + .then(() => this.getRowName(name) + .element(by.xpath(`./ancestor::div[contains(@class, 'adf-datatable-row')]`)) + .click()); + } + + selectMultipleItemsRow(names: string[]): promise.Promise { + return this.clearSelection() + .then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform()) + .then(() => { + names.forEach(name => { + this.clickOnItemNameRow(name); + }); + }) + .then(() => browser.actions().sendKeys(protractor.Key.NULL).perform()); + } + selectMultipleItems(names: string[]): promise.Promise { return this.clearSelection() .then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform()) diff --git a/e2e/suites/actions/delete.test.ts b/e2e/suites/actions/delete.test.ts index f3a7b4c2f..a4e5f42fb 100755 --- a/e2e/suites/actions/delete.test.ts +++ b/e2e/suites/actions/delete.test.ts @@ -101,7 +101,7 @@ describe('Delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.clickOnItemName(file1) + dataTable.clickOnItemNameRow(file1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -121,7 +121,7 @@ describe('Delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.selectMultipleItems([file1, file2]) + dataTable.selectMultipleItemsRow([file1, file2]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -146,7 +146,7 @@ describe('Delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.clickOnItemName(folder1) + dataTable.clickOnItemNameRow(folder1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => { @@ -164,7 +164,7 @@ describe('Delete content', () => { }); it('delete a folder containing locked files', () => { - dataTable.clickOnItemName(folder2) + dataTable.clickOnItemNameRow(folder2) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -180,7 +180,7 @@ describe('Delete content', () => { }); it('notification on multiple items deletion - some items fail to delete', () => { - dataTable.selectMultipleItems([file1, folder2]) + dataTable.selectMultipleItemsRow([file1, folder2]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -191,7 +191,7 @@ describe('Delete content', () => { // TODO: needs to operate on two folders containing locked items xit('Notification on multiple items deletion - all items fail to delete', () => { - dataTable.selectMultipleItems([fileLocked1, folder2]) + dataTable.selectMultipleItemsRow([fileLocked1, folder2]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -234,7 +234,7 @@ describe('Delete content', () => { }); it('delete a file and check notification', () => { - dataTable.clickOnItemName(sharedFile1) + dataTable.clickOnItemNameRow(sharedFile1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -249,7 +249,7 @@ describe('Delete content', () => { }); it('delete multiple files and check notification', () => { - dataTable.selectMultipleItems([sharedFile2, sharedFile3]) + dataTable.selectMultipleItemsRow([sharedFile2, sharedFile3]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -324,7 +324,7 @@ describe('Delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.clickOnItemName(favoriteFile1) + dataTable.clickOnItemNameRow(favoriteFile1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -344,7 +344,7 @@ describe('Delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]) + dataTable.selectMultipleItemsRow([favoriteFile1, favoriteFile2]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -368,7 +368,7 @@ describe('Delete content', () => { it('delete a folder with content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.clickOnItemName(favoriteFolder1) + dataTable.clickOnItemNameRow(favoriteFolder1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => { @@ -386,7 +386,7 @@ describe('Delete content', () => { }); it('delete a folder containing locked files', () => { - dataTable.clickOnItemName(favoriteFolder2) + dataTable.clickOnItemNameRow(favoriteFolder2) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -402,7 +402,7 @@ describe('Delete content', () => { }); it('notification on multiple items deletion - some items fail to delete', () => { - dataTable.selectMultipleItems([favoriteFile1, favoriteFolder2]) + dataTable.selectMultipleItemsRow([favoriteFile1, favoriteFolder2]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -414,7 +414,7 @@ describe('Delete content', () => { }); it('Notification on multiple items deletion - all items fail to delete', () => { - dataTable.selectMultipleItems([favoriteFileLocked1, favoriteFolder2]) + dataTable.selectMultipleItemsRow([favoriteFileLocked1, favoriteFolder2]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -467,7 +467,7 @@ describe('Delete content', () => { }); xit('delete a file and check notification', () => { - dataTable.clickOnItemName(recentFile1) + dataTable.clickOnItemNameRow(recentFile1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -482,7 +482,7 @@ describe('Delete content', () => { }); xit('delete multiple files and check notification', () => { - dataTable.selectMultipleItems([recentFile2, recentFile3]) + dataTable.selectMultipleItemsRow([recentFile2, recentFile3]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) diff --git a/e2e/suites/actions/edit-folder.test.ts b/e2e/suites/actions/edit-folder.test.ts index 137dcfe3f..5395463ab 100755 --- a/e2e/suites/actions/edit-folder.test.ts +++ b/e2e/suites/actions/edit-folder.test.ts @@ -74,7 +74,7 @@ describe('Edit folder', () => { beforeEach(done => { personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.doubleClickOnItemName(parent)) + .then(() => dataTable.doubleClickOnItemNameRow(parent)) .then(() => dataTable.waitForHeader()) .then(done); }); @@ -94,7 +94,7 @@ describe('Edit folder', () => { }); it('dialog UI defaults', () => { - dataTable.clickOnItemName(folderName) + dataTable.clickOnItemNameRow(folderName) .then(() => editButton.click()) .then(() => { expect(editDialog.getTitle()).toEqual('Edit folder'); @@ -106,7 +106,7 @@ describe('Edit folder', () => { }); it('properties are modified when pressing OK', () => { - dataTable.clickOnItemName(folderNameToEdit) + dataTable.clickOnItemNameRow(folderNameToEdit) .then(() => editButton.click()) .then(() => editDialog.waitForDialogToOpen()) .then(() => editDialog.enterDescription(folderDescriptionEdited)) @@ -120,7 +120,7 @@ describe('Edit folder', () => { }); it('with empty folder name', () => { - dataTable.clickOnItemName(folderName) + dataTable.clickOnItemNameRow(folderName) .then(() => editButton.click()) .then(() => editDialog.deleteNameWithBackspace()) .then(() => { @@ -132,7 +132,7 @@ describe('Edit folder', () => { it('with name with special characters', () => { const namesWithSpecialChars = [ 'a*a', 'a"a', 'aa', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ]; - dataTable.clickOnItemName(folderName) + dataTable.clickOnItemNameRow(folderName) .then(() => editButton.click()) .then(() => namesWithSpecialChars.forEach(name => { editDialog.enterName(name); @@ -143,7 +143,7 @@ describe('Edit folder', () => { }); it('with name ending with a dot', () => { - dataTable.clickOnItemName(folderName) + dataTable.clickOnItemNameRow(folderName) .then(() => editButton.click()) .then(() => editDialog.nameInput.sendKeys('.')) .then(() => { @@ -153,7 +153,7 @@ describe('Edit folder', () => { }); it('Cancel button', () => { - dataTable.clickOnItemName(folderName) + dataTable.clickOnItemNameRow(folderName) .then(() => editButton.click()) .then(() => editDialog.clickCancel()) .then(() => { @@ -162,7 +162,7 @@ describe('Edit folder', () => { }); it('with duplicate folder name', () => { - dataTable.clickOnItemName(folderName) + dataTable.clickOnItemNameRow(folderName) .then(() => editButton.click()) .then(() => editDialog.enterName(duplicateFolderName)) .then(() => editDialog.clickUpdate()) @@ -174,7 +174,7 @@ describe('Edit folder', () => { }); it('trim ending spaces', () => { - dataTable.clickOnItemName(folderName) + dataTable.clickOnItemNameRow(folderName) .then(() => editButton.click()) .then(() => editDialog.nameInput.sendKeys(' ')) .then(() => editDialog.clickUpdate()) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index cc861d022..bc63bb92b 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -88,25 +88,25 @@ describe('Mark items as favorites', () => { }); it('Favorite action has empty star icon for an item not marked as favorite', () => { - dataTable.clickOnItemName(file1NotFav) + dataTable.clickOnItemNameRow(file1NotFav) .then(() => toolbar.actions.openMoreMenu()) .then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border')); }); it('Favorite action has empty star icon for multiple selection of items when some are not favorite', () => { - dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) + dataTable.selectMultipleItemsRow([ file1NotFav, file3Fav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border')); }); it('Favorite action has full star icon for items marked as favorite', () => { - dataTable.clickOnItemName(file3Fav) + dataTable.clickOnItemNameRow(file3Fav) .then(() => toolbar.actions.openMoreMenu()) .then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star')); }); it('favorite a file', () => { - dataTable.clickOnItemName(file1NotFav) + dataTable.clickOnItemNameRow(file1NotFav) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 3 })) @@ -117,7 +117,7 @@ describe('Mark items as favorites', () => { }); it('favorite a folder', () => { - dataTable.clickOnItemName(folder1) + dataTable.clickOnItemNameRow(folder1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 3 })) @@ -128,7 +128,7 @@ describe('Mark items as favorites', () => { }); it('unfavorite an item', () => { - dataTable.clickOnItemName(file3Fav) + dataTable.clickOnItemNameRow(file3Fav) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 1 })) @@ -139,7 +139,7 @@ describe('Mark items as favorites', () => { }); it('favorite multiple items - all unfavorite', () => { - dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) + dataTable.selectMultipleItemsRow([ file1NotFav, file2NotFav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 4 })) @@ -157,7 +157,7 @@ describe('Mark items as favorites', () => { }); it('favorite multiple items - some favorite and some unfavorite', () => { - dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) + dataTable.selectMultipleItemsRow([ file1NotFav, file3Fav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 3 })) @@ -174,7 +174,7 @@ describe('Mark items as favorites', () => { }); it('unfavorite multiple items', () => { - dataTable.selectMultipleItems([ file3Fav, file4Fav ]) + dataTable.selectMultipleItemsRow([ file3Fav, file4Fav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => browser.sleep(2000)) @@ -205,7 +205,7 @@ describe('Mark items as favorites', () => { }); it('favorite a file', () => { - dataTable.clickOnItemName(file1NotFav) + dataTable.clickOnItemNameRow(file1NotFav) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 3 })) @@ -216,7 +216,7 @@ describe('Mark items as favorites', () => { }); it('unfavorite an item', () => { - dataTable.clickOnItemName(file3Fav) + dataTable.clickOnItemNameRow(file3Fav) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 1 })) @@ -227,7 +227,7 @@ describe('Mark items as favorites', () => { }); it('favorite multiple items - all unfavorite', () => { - dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) + dataTable.selectMultipleItemsRow([ file1NotFav, file2NotFav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 4 })) @@ -245,7 +245,7 @@ describe('Mark items as favorites', () => { }); it('favorite multiple items - some favorite and some unfavorite', () => { - dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) + dataTable.selectMultipleItemsRow([ file1NotFav, file3Fav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 3 })) @@ -262,7 +262,7 @@ describe('Mark items as favorites', () => { }); it('unfavorite multiple items', () => { - dataTable.selectMultipleItems([ file3Fav, file4Fav ]) + dataTable.selectMultipleItemsRow([ file3Fav, file4Fav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => browser.sleep(2000)) @@ -295,7 +295,7 @@ describe('Mark items as favorites', () => { }); it('favorite a file', () => { - dataTable.clickOnItemName(file1NotFav) + dataTable.clickOnItemNameRow(file1NotFav) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 3 })) @@ -306,7 +306,7 @@ describe('Mark items as favorites', () => { }); it('unfavorite an item', () => { - dataTable.clickOnItemName(file3Fav) + dataTable.clickOnItemNameRow(file3Fav) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 1 })) @@ -317,7 +317,7 @@ describe('Mark items as favorites', () => { }); it('favorite multiple items - all unfavorite', () => { - dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) + dataTable.selectMultipleItemsRow([ file1NotFav, file2NotFav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 4 })) @@ -335,7 +335,7 @@ describe('Mark items as favorites', () => { }); it('favorite multiple items - some favorite and some unfavorite', () => { - dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) + dataTable.selectMultipleItemsRow([ file1NotFav, file3Fav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 3 })) @@ -352,7 +352,7 @@ describe('Mark items as favorites', () => { }); it('unfavorite multiple items', () => { - dataTable.selectMultipleItems([ file3Fav, file4Fav ]) + dataTable.selectMultipleItemsRow([ file3Fav, file4Fav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => browser.sleep(2000)) @@ -382,7 +382,7 @@ describe('Mark items as favorites', () => { }); it('unfavorite an item', () => { - dataTable.clickOnItemName(file3Fav) + dataTable.clickOnItemNameRow(file3Fav) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => apis.user.favorites.waitForApi({ expect: 1 })) @@ -396,7 +396,7 @@ describe('Mark items as favorites', () => { }); it('unfavorite multiple items', () => { - dataTable.selectMultipleItems([ file3Fav, file4Fav ]) + dataTable.selectMultipleItemsRow([ file3Fav, file4Fav ]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => browser.sleep(2000)) diff --git a/e2e/suites/actions/permanently-delete.test.ts b/e2e/suites/actions/permanently-delete.test.ts index 1025feefd..c725ab506 100755 --- a/e2e/suites/actions/permanently-delete.test.ts +++ b/e2e/suites/actions/permanently-delete.test.ts @@ -78,7 +78,7 @@ describe('Permanently delete from Trash', () => { }); it('delete file [C217094] [C217091] [C217092]', () => { - dataTable.clickOnItemName(file1) + dataTable.clickOnItemNameRow(file1) .then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click()) .then(() => trashPage.waitForDialog()) .then(() => trashPage.getDialogActionByLabel('Delete')) @@ -92,7 +92,7 @@ describe('Permanently delete from Trash', () => { }); it('delete folder [C217091] [C217092]', () => { - dataTable.clickOnItemName(folder1) + dataTable.clickOnItemNameRow(folder1) .then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click()) .then(() => trashPage.waitForDialog()) .then(() => trashPage.getDialogActionByLabel('Delete')) @@ -106,7 +106,7 @@ describe('Permanently delete from Trash', () => { }); it('delete multiple items [C217093]', () => { - dataTable.selectMultipleItems([ file2, folder2 ]) + dataTable.selectMultipleItemsRow([ file2, folder2 ]) .then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click()) .then(() => trashPage.waitForDialog()) .then(() => trashPage.getDialogActionByLabel('Delete')) diff --git a/e2e/suites/actions/restore.test.ts b/e2e/suites/actions/restore.test.ts index c6f379407..96ee9a69e 100755 --- a/e2e/suites/actions/restore.test.ts +++ b/e2e/suites/actions/restore.test.ts @@ -80,7 +80,7 @@ describe('Restore from Trash', () => { }); it('restore file', () => { - dataTable.clickOnItemName(file) + dataTable.clickOnItemNameRow(file) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => page.getSnackBarMessage()) .then(text => { @@ -98,7 +98,7 @@ describe('Restore from Trash', () => { }); it('restore folder', () => { - dataTable.clickOnItemName(folder) + dataTable.clickOnItemNameRow(folder) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => page.getSnackBarMessage()) .then(text => { @@ -116,7 +116,7 @@ describe('Restore from Trash', () => { }); it('restore multiple items', () => { - dataTable.selectMultipleItems([ file, folder ]) + dataTable.selectMultipleItemsRow([ file, folder ]) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => page.getSnackBarMessage()) .then(text => { @@ -136,7 +136,7 @@ describe('Restore from Trash', () => { }); it('View from notification', () => { - dataTable.clickOnItemName(file) + dataTable.clickOnItemNameRow(file) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => page.clickSnackBarAction()) .then(() => page.dataTable.waitForHeader()) @@ -186,7 +186,7 @@ describe('Restore from Trash', () => { it('Restore a file when another file with same name exists on the restore location', () => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) - .then(() => dataTable.clickOnItemName(file1)) + .then(() => dataTable.clickOnItemNameRow(file1)) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => page.getSnackBarMessage()) .then(text => expect(text).toEqual(`Can't restore, ${file1} already exists`)); @@ -194,7 +194,7 @@ describe('Restore from Trash', () => { it('Restore a file when original location no longer exists', () => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) - .then(() => dataTable.clickOnItemName(file2)) + .then(() => dataTable.clickOnItemNameRow(file2)) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => page.getSnackBarMessage()) .then(text => expect(text).toEqual(`Can't restore ${file2}, the original location no longer exists`)); @@ -252,14 +252,14 @@ describe('Restore from Trash', () => { }); it('one failure', () => { - dataTable.selectMultipleItems([ file1, file2 ]) + dataTable.selectMultipleItemsRow([ file1, file2 ]) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => page.getSnackBarMessage()) .then(text => expect(text).toEqual(`Can't restore ${file1}, the original location no longer exists`)); }); it('multiple failures', () => { - dataTable.selectMultipleItems([ file3, file4, file5 ]) + dataTable.selectMultipleItemsRow([ file3, file4, file5 ]) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => page.getSnackBarMessage()) .then(text => expect(text).toEqual('2 items not restored because of issues with the restore location')); diff --git a/e2e/suites/actions/toolbar-multiple-selection.test.ts b/e2e/suites/actions/toolbar-multiple-selection.test.ts index c3c54dfa7..5a0642220 100755 --- a/e2e/suites/actions/toolbar-multiple-selection.test.ts +++ b/e2e/suites/actions/toolbar-multiple-selection.test.ts @@ -115,26 +115,26 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('unselect selected items - single click', () => { - dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ]) + dataTable.selectMultipleItemsRow([ file1, file2, folder1, folder2 ]) .then(() => expect(dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number')) - .then(() => dataTable.clickOnItemName(file1)) + .then(() => dataTable.clickOnItemNameRow(file1)) .then(() => expect(dataTable.countSelectedRows()).toEqual(1, 'incorrect selected rows number')) .then(() => dataTable.clearSelection()); }); it('unselect selected items - CMD+click', () => { - dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ]) + dataTable.selectMultipleItemsRow([ file1, file2, folder1, folder2 ]) .then(() => expect(dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number')) .then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform()) - .then(() => dataTable.clickOnItemName(file1)) - .then(() => dataTable.clickOnItemName(file2)) + .then(() => dataTable.clickOnItemNameRow(file1)) + .then(() => dataTable.clickOnItemNameRow(file2)) .then(() => browser.actions().sendKeys(protractor.Key.NULL).perform()) .then(() => expect(dataTable.countSelectedRows()).toEqual(2, 'incorrect selected rows number')) .then(() => dataTable.clearSelection()); }); it('correct actions appear when multiple files are selected', () => { - dataTable.selectMultipleItems([file1, file2]) + dataTable.selectMultipleItemsRow([file1, file2]) .then(() => toolbar.actions.openMoreMenu()) .then(menu => { expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); @@ -148,7 +148,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple folders are selected', () => { - dataTable.selectMultipleItems([folder1, folder2]) + dataTable.selectMultipleItemsRow([folder1, folder2]) .then(() => toolbar.actions.openMoreMenu()) .then(menu => { expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); @@ -162,49 +162,49 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('should not display View action when multiple entries selected', async () => { - await dataTable.selectMultipleItems([folder1, file1, folder2]); + await dataTable.selectMultipleItemsRow([folder1, file1, folder2]); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'Action is displayed'); }); it('should display View action when one file is selected', async () => { - await dataTable.selectMultipleItems([file1]); + await dataTable.selectMultipleItemsRow([file1]); expect(toolbar.actions.isButtonPresent('View')).toBe(true, 'Action is not displayed'); }); it('should not display View action when only folders selected', async () => { - await dataTable.selectMultipleItems([folder1, folder2]); + await dataTable.selectMultipleItemsRow([folder1, folder2]); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'Action is displayed'); }); it('should display Download action for selected items', async () => { - await dataTable.selectMultipleItems([folder1, file1, folder2]); + await dataTable.selectMultipleItemsRow([folder1, file1, folder2]); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Action is not displayed'); }); it('should not display Download action for empty selection', async () => { - await dataTable.selectMultipleItems([folder1, file1, folder2]); + await dataTable.selectMultipleItemsRow([folder1, file1, folder2]); await dataTable.clearSelection(); expect(toolbar.actions.isButtonPresent('Download')).toBe(false, 'Action is displayed'); }); it('should display Edit action when single folder selected', async () => { - await dataTable.selectMultipleItems([folder1]); + await dataTable.selectMultipleItemsRow([folder1]); expect(toolbar.actions.isButtonPresent('Edit')).toBe(true, 'Action is not displayed'); }); it('should not display Edit action when multiple folders selected', async () => { - await dataTable.selectMultipleItems([folder1, file1, folder2]); + await dataTable.selectMultipleItemsRow([folder1, file1, folder2]); expect(toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Action is displayed'); }); it('should not display Edit action if no folders selected', async () => { - await dataTable.selectMultipleItems([file1, file2]); + await dataTable.selectMultipleItemsRow([file1, file2]); expect(toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Action is displayed'); }); it('correct actions appear when both files and folders are selected', () => { - dataTable.selectMultipleItems([file1, file2, folder1, folder2]) + dataTable.selectMultipleItemsRow([file1, file2, folder1, folder2]) .then(() => toolbar.actions.openMoreMenu()) .then(menu => { expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); @@ -232,7 +232,7 @@ describe('Toolbar actions - multiple selection : ', () => { beforeEach(done => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.doubleClickOnItemName(siteName)) + .then(() => dataTable.doubleClickOnItemNameRow(siteName)) .then(() => dataTable.waitForHeader()) .then(done); }); @@ -253,7 +253,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple files are selected', () => { - dataTable.selectMultipleItems([file1Admin, file2Admin]) + dataTable.selectMultipleItemsRow([file1Admin, file2Admin]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files'); @@ -272,7 +272,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple folders are selected', () => { - dataTable.selectMultipleItems([folder1Admin, folder2Admin]) + dataTable.selectMultipleItemsRow([folder1Admin, folder2Admin]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); @@ -291,7 +291,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when both files and folders are selected', () => { - dataTable.selectMultipleItems([file1Admin, file2Admin, folder1Admin, folder2Admin]) + dataTable.selectMultipleItemsRow([file1Admin, file2Admin, folder1Admin, folder2Admin]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); @@ -320,7 +320,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple files are selected', () => { - dataTable.selectMultipleItems([file1Admin, file2Admin]) + dataTable.selectMultipleItemsRow([file1Admin, file2Admin]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files'); @@ -339,7 +339,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple folders are selected', () => { - dataTable.selectMultipleItems([folder1Admin, folder2Admin]) + dataTable.selectMultipleItemsRow([folder1Admin, folder2Admin]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); @@ -358,7 +358,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when both files and folders are selected', () => { - dataTable.selectMultipleItems([file1Admin, file2Admin, folder1Admin, folder2Admin]) + dataTable.selectMultipleItemsRow([file1Admin, file2Admin, folder1Admin, folder2Admin]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files'); @@ -395,7 +395,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple files are selected', () => { - dataTable.selectMultipleItems([file1, file2]) + dataTable.selectMultipleItemsRow([file1, file2]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files'); @@ -430,7 +430,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple files are selected', () => { - dataTable.selectMultipleItems([file1, file2]) + dataTable.selectMultipleItemsRow([file1, file2]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); @@ -465,7 +465,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple files are selected', () => { - dataTable.selectMultipleItems([file1, file2]) + dataTable.selectMultipleItemsRow([file1, file2]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); @@ -484,7 +484,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple folders are selected', () => { - dataTable.selectMultipleItems([folder1, folder2]) + dataTable.selectMultipleItemsRow([folder1, folder2]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); @@ -503,7 +503,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when both files and folders are selected', () => { - dataTable.selectMultipleItems([file1, file2, folder1, folder2]) + dataTable.selectMultipleItemsRow([file1, file2, folder1, folder2]) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files'); @@ -539,7 +539,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple files are selected', () => { - dataTable.selectMultipleItems([fileForDelete1, fileForDelete2]) + dataTable.selectMultipleItemsRow([fileForDelete1, fileForDelete2]) .then(() => { expect(toolbar.actions.isButtonPresent('Permanently delete')) .toBe(true, 'Permanently delete is displayed for selected files'); @@ -549,7 +549,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when multiple folders are selected', () => { - dataTable.selectMultipleItems([folderForDelete1, folderForDelete2]) + dataTable.selectMultipleItemsRow([folderForDelete1, folderForDelete2]) .then(() => { expect(toolbar.actions.isButtonPresent('Permanently delete')) .toBe(true, 'Permanently delete is displayed for selected files'); @@ -559,7 +559,7 @@ describe('Toolbar actions - multiple selection : ', () => { }); it('correct actions appear when both files and folders are selected', () => { - dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]) + dataTable.selectMultipleItemsRow([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]) .then(() => { expect(toolbar.actions.isButtonPresent('Permanently delete')) .toBe(true, 'Permanently delete is displayed for selected files'); diff --git a/e2e/suites/actions/toolbar-single-selection.test.ts b/e2e/suites/actions/toolbar-single-selection.test.ts index d97d7f65b..64416adab 100755 --- a/e2e/suites/actions/toolbar-single-selection.test.ts +++ b/e2e/suites/actions/toolbar-single-selection.test.ts @@ -102,14 +102,14 @@ describe('Toolbar actions - single selection : ', () => { xit('actions not displayed for top level of File Libraries', () => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.clickOnItemName(userSite)) + .then(() => dataTable.clickOnItemNameRow(userSite)) .then(() => expect(toolbar.actions.isEmpty()).toBe(true, 'toolbar not empty')); }); it('selected row is marked with a check circle icon', () => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.clickOnItemName(fileUser)) + .then(() => dataTable.clickOnItemNameRow(fileUser)) .then(() => expect(dataTable.hasCheckMarkIcon(fileUser)).toBe(true, 'check mark missing')); }); @@ -152,9 +152,9 @@ describe('Toolbar actions - single selection : ', () => { it('on File Libraries', () => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.doubleClickOnItemName(site)) + .then(() => dataTable.doubleClickOnItemNameRow(site)) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.clickOnItemName(file1)) + .then(() => dataTable.clickOnItemNameRow(file1)) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`); @@ -168,7 +168,7 @@ describe('Toolbar actions - single selection : ', () => { expect(menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`); }) .then(() => browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform()) - .then(() => dataTable.clickOnItemName(file2)) + .then(() => dataTable.clickOnItemNameRow(file2)) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file2}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file2}`); @@ -187,7 +187,7 @@ describe('Toolbar actions - single selection : ', () => { xit('on Shared Files', () => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.clickOnItemName(file1)) + .then(() => dataTable.clickOnItemNameRow(file1)) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`); @@ -201,7 +201,7 @@ describe('Toolbar actions - single selection : ', () => { expect(menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`); }) .then(() => browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform()) - .then(() => dataTable.clickOnItemName(file2)) + .then(() => dataTable.clickOnItemNameRow(file2)) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file2}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file2}`); @@ -221,7 +221,7 @@ describe('Toolbar actions - single selection : ', () => { xit('on Favorites', () => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.clickOnItemName(file1)) + .then(() => dataTable.clickOnItemNameRow(file1)) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`); @@ -235,7 +235,7 @@ describe('Toolbar actions - single selection : ', () => { expect(menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`); }) .then(() => browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform()) - .then(() => dataTable.clickOnItemName(file2)) + .then(() => dataTable.clickOnItemNameRow(file2)) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file2}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file2}`); @@ -256,7 +256,7 @@ describe('Toolbar actions - single selection : ', () => { it('on File Libraries', () => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.doubleClickOnItemName(site)) + .then(() => dataTable.doubleClickOnItemNameRow(site)) .then(() => dataTable.waitForHeader()) .then(() => dataTable.selectMultipleItems([ file1, file2 ])) .then(() => { @@ -338,21 +338,21 @@ describe('Toolbar actions - single selection : ', () => { }); it('actions are displayed when a file is selected', () => { - dataTable.clickOnItemName(fileUser) + dataTable.clickOnItemNameRow(fileUser) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); }); }); it('actions are displayed when a folder is selected', () => { - dataTable.clickOnItemName(folderUser) + dataTable.clickOnItemNameRow(folderUser) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); }); }); it('correct actions appear when a file is selected', () => { - dataTable.clickOnItemName(fileUser) + dataTable.clickOnItemNameRow(fileUser) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`); @@ -369,7 +369,7 @@ describe('Toolbar actions - single selection : ', () => { }); it('correct actions appear when a folder is selected', () => { - dataTable.clickOnItemName(folderUser) + dataTable.clickOnItemNameRow(folderUser) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`); @@ -400,7 +400,7 @@ describe('Toolbar actions - single selection : ', () => { beforeEach(done => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.doubleClickOnItemName(siteName)) + .then(() => dataTable.doubleClickOnItemNameRow(siteName)) .then(() => dataTable.waitForHeader()) .then(done); }); @@ -425,21 +425,21 @@ describe('Toolbar actions - single selection : ', () => { }); it('actions are displayed when a file is selected', () => { - dataTable.clickOnItemName(fileAdmin) + dataTable.clickOnItemNameRow(fileAdmin) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileAdmin}`); }); }); it('actions are displayed when a folder is selected', () => { - dataTable.clickOnItemName(folderAdmin) + dataTable.clickOnItemNameRow(folderAdmin) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderAdmin}`); }); }); it('correct actions appear when a file is selected', () => { - dataTable.clickOnItemName(fileAdmin) + dataTable.clickOnItemNameRow(fileAdmin) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileAdmin}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileAdmin}`); @@ -456,7 +456,7 @@ describe('Toolbar actions - single selection : ', () => { }); it('correct actions appear when a folder is selected', () => { - dataTable.clickOnItemName(folderAdmin) + dataTable.clickOnItemNameRow(folderAdmin) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderAdmin}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderAdmin}`); @@ -487,21 +487,21 @@ describe('Toolbar actions - single selection : ', () => { }); it('actions are displayed when a file is selected', () => { - dataTable.clickOnItemName(fileAdmin) + dataTable.clickOnItemNameRow(fileAdmin) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileAdmin}`); }); }); it('actions are displayed when a folder is selected', () => { - dataTable.clickOnItemName(folderAdmin) + dataTable.clickOnItemNameRow(folderAdmin) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderAdmin}`); }); }); it('correct actions appear when a file is selected', () => { - dataTable.clickOnItemName(fileAdmin) + dataTable.clickOnItemNameRow(fileAdmin) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileAdmin}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileAdmin}`); @@ -518,7 +518,7 @@ describe('Toolbar actions - single selection : ', () => { }); it('correct actions appear when a folder is selected', () => { - dataTable.clickOnItemName(folderAdmin) + dataTable.clickOnItemNameRow(folderAdmin) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderAdmin}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderAdmin}`); @@ -560,14 +560,14 @@ describe('Toolbar actions - single selection : ', () => { }); it('actions are displayed when a file is selected', () => { - dataTable.clickOnItemName(fileUser) + dataTable.clickOnItemNameRow(fileUser) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); }); }); it('correct actions appear when a file is selected', () => { - dataTable.clickOnItemName(fileUser) + dataTable.clickOnItemNameRow(fileUser) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`); @@ -608,14 +608,14 @@ describe('Toolbar actions - single selection : ', () => { }); it('actions are displayed when a file is selected', () => { - dataTable.clickOnItemName(fileUser) + dataTable.clickOnItemNameRow(fileUser) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); }); }); it('correct actions appear when a file is selected', () => { - dataTable.clickOnItemName(fileUser) + dataTable.clickOnItemNameRow(fileUser) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`); @@ -652,21 +652,21 @@ describe('Toolbar actions - single selection : ', () => { }); it('actions are displayed when a file is selected', () => { - dataTable.clickOnItemName(fileUser) + dataTable.clickOnItemNameRow(fileUser) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); }); }); it('actions are displayed when a folder is selected', () => { - dataTable.clickOnItemName(folderUser) + dataTable.clickOnItemNameRow(folderUser) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); }); }); it('correct actions appear when a file is selected', () => { - dataTable.clickOnItemName(fileUser) + dataTable.clickOnItemNameRow(fileUser) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`); @@ -683,7 +683,7 @@ describe('Toolbar actions - single selection : ', () => { }); it('correct actions appear when a folder is selected', () => { - dataTable.clickOnItemName(folderUser) + dataTable.clickOnItemNameRow(folderUser) .then(() => { expect(toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`); expect(toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`); @@ -729,21 +729,21 @@ describe('Toolbar actions - single selection : ', () => { }); it('actions are displayed when a file is selected', () => { - dataTable.clickOnItemName(fileForDelete) + dataTable.clickOnItemNameRow(fileForDelete) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileForDelete}`); }); }); it('actions are displayed when a folder is selected', () => { - dataTable.clickOnItemName(folderForDelete) + dataTable.clickOnItemNameRow(folderForDelete) .then(() => { expect(toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderForDelete}`); }); }); it('correct actions appear when a file is selected', () => { - dataTable.clickOnItemName(fileForDelete) + dataTable.clickOnItemNameRow(fileForDelete) .then(() => { expect(toolbar.actions.isButtonPresent('Permanently delete')) .toBe(true, `Permanently delete is not displayed for ${fileForDelete}`); @@ -752,7 +752,7 @@ describe('Toolbar actions - single selection : ', () => { }); it('correct actions appear when a folder is selected', () => { - dataTable.clickOnItemName(folderForDelete) + dataTable.clickOnItemNameRow(folderForDelete) .then(() => { expect(toolbar.actions.isButtonPresent('Permanently delete')) .toBe(true, `Permanently delete is displayed for ${folderForDelete}`); diff --git a/e2e/suites/actions/undo-delete.test.ts b/e2e/suites/actions/undo-delete.test.ts index a780644bc..527344420 100755 --- a/e2e/suites/actions/undo-delete.test.ts +++ b/e2e/suites/actions/undo-delete.test.ts @@ -95,7 +95,7 @@ describe('Undo delete content', () => { }); it('Successful delete notification shows Undo action', () => { - dataTable.clickOnItemName(file1) + dataTable.clickOnItemNameRow(file1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -107,7 +107,7 @@ describe('Undo delete content', () => { }); it('Unsuccessful delete notification does not show Undo action', () => { - dataTable.clickOnItemName(folder2) + dataTable.clickOnItemNameRow(folder2) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -120,7 +120,7 @@ describe('Undo delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.clickOnItemName(file1) + dataTable.clickOnItemNameRow(file1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -134,7 +134,7 @@ describe('Undo delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.clickOnItemName(folder1) + dataTable.clickOnItemNameRow(folder1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -142,7 +142,7 @@ describe('Undo delete content', () => { expect(dataTable.getRowName(folder1).isPresent()).toBe(true, 'Item was not restored'); expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`); }) - .then(() => dataTable.doubleClickOnItemName(folder1)) + .then(() => dataTable.doubleClickOnItemNameRow(folder1)) .then(() => { expect(dataTable.getRowName(file4).isPresent()).toBe(true, 'file from folder not restored'); }); @@ -152,7 +152,7 @@ describe('Undo delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.selectMultipleItems([file2, file3]) + dataTable.selectMultipleItemsRow([file2, file3]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -201,7 +201,7 @@ describe('Undo delete content', () => { }); it('Successful delete notification shows Undo action', () => { - dataTable.clickOnItemName(sharedFile1) + dataTable.clickOnItemNameRow(sharedFile1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -209,7 +209,7 @@ describe('Undo delete content', () => { }); it('Undo delete of file', () => { - dataTable.clickOnItemName(sharedFile2) + dataTable.clickOnItemNameRow(sharedFile2) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -218,7 +218,7 @@ describe('Undo delete content', () => { }); it('undo delete of multiple files', () => { - dataTable.selectMultipleItems([sharedFile3, sharedFile4]) + dataTable.selectMultipleItemsRow([sharedFile3, sharedFile4]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -276,7 +276,7 @@ describe('Undo delete content', () => { }); it('Successful delete notification shows Undo action', () => { - dataTable.clickOnItemName(favoriteFile1) + dataTable.clickOnItemNameRow(favoriteFile1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -286,7 +286,7 @@ describe('Undo delete content', () => { }); it('Unsuccessful delete notification does not show Undo action', () => { - dataTable.clickOnItemName(favoriteFolder2) + dataTable.clickOnItemNameRow(favoriteFolder2) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -297,7 +297,7 @@ describe('Undo delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.clickOnItemName(favoriteFile1) + dataTable.clickOnItemNameRow(favoriteFile1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -311,7 +311,7 @@ describe('Undo delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.clickOnItemName(favoriteFolder1) + dataTable.clickOnItemNameRow(favoriteFolder1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -319,7 +319,7 @@ describe('Undo delete content', () => { expect(dataTable.getRowName(favoriteFolder1).isPresent()).toBe(true, 'Item was not restored'); expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`); }) - .then(() => dataTable.doubleClickOnItemName(favoriteFolder1)) + .then(() => dataTable.doubleClickOnItemNameRow(favoriteFolder1)) .then(() => expect(dataTable.getRowName(favoriteFile4).isPresent()).toBe(true, 'file from folder not restored')); }); @@ -327,7 +327,7 @@ describe('Undo delete content', () => { let items: number; page.dataTable.countRows().then(number => { items = number; }); - dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]) + dataTable.selectMultipleItemsRow([favoriteFile1, favoriteFile2]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -384,7 +384,7 @@ describe('Undo delete content', () => { }); xit('Successful delete notification shows Undo action', () => { - dataTable.clickOnItemName(recentFile1) + dataTable.clickOnItemNameRow(recentFile1) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.getSnackBarMessage()) @@ -396,7 +396,7 @@ describe('Undo delete content', () => { // 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 xit('Undo delete of file', () => { - dataTable.clickOnItemName(recentFile2) + dataTable.clickOnItemNameRow(recentFile2) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) @@ -409,7 +409,7 @@ describe('Undo delete content', () => { // 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 xit('undo delete of multiple files', () => { - dataTable.selectMultipleItems([recentFile3, recentFile4]) + dataTable.selectMultipleItemsRow([recentFile3, recentFile4]) .then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => page.clickSnackBarAction()) diff --git a/e2e/suites/actions/upload-file.test.ts b/e2e/suites/actions/upload-file.test.ts index 7789d4366..1b5b3486f 100755 --- a/e2e/suites/actions/upload-file.test.ts +++ b/e2e/suites/actions/upload-file.test.ts @@ -67,7 +67,7 @@ describe('Upload files', () => { }); it('Upload a file', () => { - dataTable.doubleClickOnItemName(folder1) + dataTable.doubleClickOnItemNameRow(folder1) .then(() => page.sidenav.openNewMenu()) .then(() => page.sidenav.menu.uploadFile().sendKeys(`${__dirname}/create-folder.test.ts`)); }); diff --git a/e2e/suites/list-views/favorites.test.ts b/e2e/suites/list-views/favorites.test.ts index 3cd8ae546..cb734a35c 100755 --- a/e2e/suites/list-views/favorites.test.ts +++ b/e2e/suites/list-views/favorites.test.ts @@ -145,7 +145,7 @@ describe('Favorites', () => { }); it('Navigate into folder from Favorites [C213230]', () => { - dataTable.doubleClickOnItemName(folderName) + dataTable.doubleClickOnItemNameRow(folderName) .then(() => dataTable.waitForHeader()) .then(() => breadcrumb.getCurrentItemName()) .then(name => { diff --git a/e2e/suites/list-views/file-libraries.test.ts b/e2e/suites/list-views/file-libraries.test.ts index 0b0fba94a..3f6567ddd 100755 --- a/e2e/suites/list-views/file-libraries.test.ts +++ b/e2e/suites/list-views/file-libraries.test.ts @@ -150,12 +150,12 @@ describe('File Libraries', () => { }); it('Tooltip for sites without description [C217096]', () => { - const tooltip = dataTable.getLinkCellTooltip(sitePrivate); + const tooltip = dataTable.getItemNameTooltip(sitePrivate); expect(tooltip).toBe(`${sitePrivate}`); }); it('Tooltip for sites with description [C217097]', () => { - const tooltip = dataTable.getLinkCellTooltip(siteModerated); + const tooltip = dataTable.getItemNameTooltip(siteModerated); expect(tooltip).toBe(`${siteDescription}`); }); }); diff --git a/e2e/suites/list-views/personal-files.test.ts b/e2e/suites/list-views/personal-files.test.ts index 88bdd95de..168cee8bc 100755 --- a/e2e/suites/list-views/personal-files.test.ts +++ b/e2e/suites/list-views/personal-files.test.ts @@ -135,7 +135,7 @@ describe('Personal Files', () => { .then(response => response.data.entry.id); const navigatePromise = dataTable - .doubleClickOnItemName(userFolder) + .doubleClickOnItemNameRow(userFolder) .then(() => dataTable.waitForHeader()); Promise @@ -153,7 +153,7 @@ describe('Personal Files', () => { }); it('redirects to Personal Files on clicking the link from sidebar [C213245]', () => { - personalFilesPage.dataTable.doubleClickOnItemName(userFolder) + personalFilesPage.dataTable.doubleClickOnItemNameRow(userFolder) .then(() => personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)) .then(() => browser.getCurrentUrl()) .then(url => expect(url.endsWith(APP_ROUTES.PERSONAL_FILES)).toBe(true, 'incorrect url')); diff --git a/e2e/suites/list-views/tooltips.test.ts b/e2e/suites/list-views/tooltips.test.ts index 43e12985b..770b169ea 100755 --- a/e2e/suites/list-views/tooltips.test.ts +++ b/e2e/suites/list-views/tooltips.test.ts @@ -100,7 +100,7 @@ describe('File / folder tooltips', () => { describe('on Personal Files', () => { beforeAll(done => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) - .then(() => dataTable.doubleClickOnItemName(parent)) + .then(() => dataTable.doubleClickOnItemNameRow(parent)) .then(done); }); diff --git a/e2e/suites/pagination/pag-personal-files.test.ts b/e2e/suites/pagination/pag-personal-files.test.ts index beb580638..fcd2817d4 100755 --- a/e2e/suites/pagination/pag-personal-files.test.ts +++ b/e2e/suites/pagination/pag-personal-files.test.ts @@ -110,7 +110,7 @@ describe('Pagination on Personal Files', () => { beforeEach(done => { page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) .then(() => dataTable.waitForHeader()) - .then(() => dataTable.doubleClickOnItemName(parent)) + .then(() => dataTable.doubleClickOnItemNameRow(parent)) .then(done); }); diff --git a/src/app/components/favorites/favorites.component.html b/src/app/components/favorites/favorites.component.html index 67eceaca6..1a93dd228 100644 --- a/src/app/components/favorites/favorites.component.html +++ b/src/app/components/favorites/favorites.component.html @@ -153,15 +153,15 @@ - {{ value }} - + diff --git a/src/app/components/files/files.component.html b/src/app/components/files/files.component.html index 7fa555c0b..a5ebe94f0 100644 --- a/src/app/components/files/files.component.html +++ b/src/app/components/files/files.component.html @@ -158,15 +158,15 @@ - {{ value }} - + diff --git a/src/app/components/libraries/libraries.component.html b/src/app/components/libraries/libraries.component.html index b8d57991d..dec9350b6 100644 --- a/src/app/components/libraries/libraries.component.html +++ b/src/app/components/libraries/libraries.component.html @@ -70,15 +70,16 @@ - {{ makeLibraryTitle(context.row.obj.entry) }} - + diff --git a/src/app/components/recent-files/recent-files.component.html b/src/app/components/recent-files/recent-files.component.html index a56b13463..b02450b2d 100644 --- a/src/app/components/recent-files/recent-files.component.html +++ b/src/app/components/recent-files/recent-files.component.html @@ -147,15 +147,15 @@ - {{ value }} - + diff --git a/src/app/components/shared-files/shared-files.component.html b/src/app/components/shared-files/shared-files.component.html index 0cd9946fc..837082076 100644 --- a/src/app/components/shared-files/shared-files.component.html +++ b/src/app/components/shared-files/shared-files.component.html @@ -142,15 +142,16 @@ - {{ value }} - + diff --git a/src/app/ui/overrides/adf-document-list.theme.scss b/src/app/ui/overrides/adf-document-list.theme.scss index 799a25c82..d4bac05e5 100644 --- a/src/app/ui/overrides/adf-document-list.theme.scss +++ b/src/app/ui/overrides/adf-document-list.theme.scss @@ -18,6 +18,16 @@ .adf-data-table { border: none !important; + .dl-link { + text-decoration: none; + color: mat-color($foreground, text); + + &:hover { + color: #2196F3; + text-decoration: underline; + } + } + .adf-datatable-selected > svg { // fill: mat-color($primary); fill: #2196f3;