- fix intermittent failing tests from Shared Files (#539)

- rename some methods to be more clear
- use async / await - part1
This commit is contained in:
Adina Parpalita
2018-07-26 16:27:00 +03:00
committed by Denys Vuika
parent 262240c8ea
commit c6f704270f
26 changed files with 856 additions and 988 deletions

View File

@@ -43,7 +43,7 @@ export class DataTable extends Component {
row: '.adf-datatable-row[role]',
selectedRow: '.adf-datatable-row.is-selected',
cell: '.adf-data-table-cell',
locationLink: 'aca-location-link',
locationLink: '.aca-location-link',
linkCell: '.adf-location-cell',
selectedIcon: '.mat-icon',
@@ -125,6 +125,10 @@ export class DataTable extends Component {
return this.body.all(by.css(DataTable.selectors.row));
}
countRows(): promise.Promise<number> {
return this.getRows().count();
}
getSelectedRows(): ElementArrayFinder {
return this.body.all(by.css(DataTable.selectors.selectedRow));
}
@@ -137,66 +141,41 @@ export class DataTable extends Component {
return this.getRows().get(nth - 1);
}
getRowName(name: string): ElementFinder {
return this.body.element(by.cssContainingText(`.adf-data-table-cell span`, name));
getRowByName(name: string): ElementFinder {
return this.body.element(by.cssContainingText(DataTable.selectors.row, name));
}
getRowFirstCell(name: string) {
return this.getRowByName(name).all(by.css(DataTable.selectors.cell)).get(0);
}
getRowNameCell(name: string) {
return this.getRowByName(name).all(by.css(DataTable.selectors.cell)).get(1);
}
getRowNameCellText(name: string) {
return this.getRowNameCell(name).$('span');
}
getItemNameTooltip(name: string): promise.Promise<string> {
return this.getRowName(name).getAttribute('title');
}
countRows(): promise.Promise<number> {
return this.getRows().count();
return this.getRowNameCellText(name).getAttribute('title');
}
hasCheckMarkIcon(itemName: string) {
return this.getRowName(itemName).element(by.xpath(`./ancestor::div[contains(@class, 'adf-datatable-row')]`))
.element(by.css(DataTable.selectors.selectedIcon)).isPresent();
return this.getRowByName(itemName).element(by.css(DataTable.selectors.selectedIcon)).isPresent();
}
// Navigation/selection methods
doubleClickOnItemName(name: string): promise.Promise<any> {
const dblClick = browser.actions()
.mouseMove(this.getRowName(name))
.click()
.click();
return dblClick.perform();
}
// Navigation/selection methods
doubleClickOnItemNameRow(name: string): promise.Promise<any> {
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<any> {
const item = this.getRowName(name);
doubleClickOnRowByName(name: string): promise.Promise<any> {
const item = this.getRowFirstCell(name);
return Utils.waitUntilElementClickable(item)
.then(() => this.getRowName(name).click());
.then(() => browser.actions().mouseMove(item).click().click().perform());
}
clickOnItemNameRow(name: string): promise.Promise<any> {
const item = this.getRowName(name);
clickOnRowByName(name: string): promise.Promise<any> {
const item = this.getRowFirstCell(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<void> {
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());
.then(() => item.click());
}
selectMultipleItems(names: string[]): promise.Promise<void> {
@@ -204,7 +183,7 @@ export class DataTable extends Component {
.then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform())
.then(() => {
names.forEach(name => {
this.clickOnItemName(name);
this.clickOnRowByName(name);
});
})
.then(() => browser.actions().sendKeys(protractor.Key.NULL).perform());
@@ -218,8 +197,7 @@ export class DataTable extends Component {
}
getItemLocation(name: string) {
return this.getRowName(name).element(by.xpath(`./ancestor::div[contains(@class, 'adf-datatable-row')]`))
.element(this.locationLink);
return this.getRowByName(name).element(this.locationLink);
}
getItemLocationTooltip(name: string): promise.Promise<string> {

View File

@@ -23,7 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ElementFinder, ElementArrayFinder, by, promise } from 'protractor';
import { ElementFinder, ElementArrayFinder, by, promise, protractor, browser } from 'protractor';
import { Menu } from '../menu/menu';
import { Component } from '../component';
@@ -61,4 +61,8 @@ export class ToolbarActions extends Component {
.then(() => this.menu.waitForMenuToOpen())
.then(() => this.menu);
}
closeMoreMenu() {
return browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
}

View File

@@ -29,7 +29,7 @@ export const BROWSER_RESOLUTION_HEIGHT = 800;
export const BROWSER_WAIT_TIMEOUT = 30000;
// Application configs
export const APP_HOST = 'http://localhost:3000';
export const APP_HOST = 'http://localhost:4000';
// Repository configs
export const REPO_API_HOST = 'http://localhost:8080';

View File

@@ -85,7 +85,7 @@ describe('Create folder', () => {
});
it('option is enabled when having enough permissions', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openNewMenu())
.then(menu => {
const isEnabled = menu.getItemByLabel('Create folder').isEnabled();
@@ -94,7 +94,7 @@ describe('Create folder', () => {
});
it('creates new folder with name', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(folderName1))
@@ -102,13 +102,13 @@ describe('Create folder', () => {
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.then(() => {
const isPresent = dataTable.getRowName(folderName1).isPresent();
const isPresent = dataTable.getRowByName(folderName1).isPresent();
expect(isPresent).toBe(true, 'Folder not displayed in list view');
});
});
it('creates new folder with name and description', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(folderName2))
@@ -116,13 +116,13 @@ describe('Create folder', () => {
.then(() => createDialog.clickCreate())
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.then(() => expect(dataTable.getRowName(folderName2).isPresent()).toBe(true, 'Folder not displayed'))
.then(() => expect(dataTable.getRowByName(folderName2).isPresent()).toBe(true, 'Folder not displayed'))
.then(() => apis.user.nodes.getNodeDescription(folderName2, parent))
.then(desc => expect(desc).toEqual(folderDescription));
});
it('enabled option tooltip', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openNewMenu())
.then(menu => browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform()
.then(() => menu))
@@ -135,8 +135,8 @@ describe('Create folder', () => {
const fileLibrariesPage = new BrowsingPage();
fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => fileLibrariesPage.dataTable.doubleClickOnItemName(siteName))
.then(() => fileLibrariesPage.dataTable.doubleClickOnItemName(folderName1))
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName))
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1))
.then(() => fileLibrariesPage.sidenav.openNewMenu())
.then(menu => {
const isEnabled = menu.getItemByLabel('Create folder').isEnabled();
@@ -148,8 +148,8 @@ describe('Create folder', () => {
const fileLibrariesPage = new BrowsingPage();
fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => fileLibrariesPage.dataTable.doubleClickOnItemName(siteName))
.then(() => fileLibrariesPage.dataTable.doubleClickOnItemName(folderName1))
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName))
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1))
.then(() => fileLibrariesPage.sidenav.openNewMenu())
.then(menu => browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform()
.then(() => menu))
@@ -160,7 +160,7 @@ describe('Create folder', () => {
});
it('dialog UI elements', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => {
@@ -179,7 +179,7 @@ describe('Create folder', () => {
});
it('with empty folder name', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.deleteNameWithBackspace())
@@ -193,7 +193,7 @@ describe('Create folder', () => {
});
it('with folder name ending with a dot "."', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName('folder-name.'))
@@ -209,7 +209,7 @@ describe('Create folder', () => {
it('with folder name containing special characters', () => {
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => namesWithSpecialChars.forEach(name => {
@@ -224,7 +224,7 @@ describe('Create folder', () => {
});
it('with folder name containing only spaces', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(' '))
@@ -238,7 +238,7 @@ describe('Create folder', () => {
});
it('cancel folder creation', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName('test'))
@@ -250,7 +250,7 @@ describe('Create folder', () => {
});
it('duplicate folder name', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(duplicateFolderName))
@@ -263,7 +263,7 @@ describe('Create folder', () => {
});
it('trim ending spaces from folder name', () => {
personalFilesPage.dataTable.doubleClickOnItemName(parent)
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(nameWithSpaces))
@@ -271,7 +271,7 @@ describe('Create folder', () => {
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.then(() => {
const isPresent = dataTable.getRowName(nameWithSpaces.trim()).isPresent();
const isPresent = dataTable.getRowByName(nameWithSpaces.trim()).isPresent();
expect(isPresent).toBe(true, 'Folder not displayed in list view');
});
});

View File

@@ -101,18 +101,18 @@ describe('Delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnItemNameRow(file1)
dataTable.clickOnRowByName(file1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`${file1} deleted`);
expect(dataTable.getRowName(file1).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(file1).isPresent()).toBe(false, 'Item was not removed from list');
items--;
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => expect(dataTable.getRowName(file1).isPresent()).toBe(true, 'Item is not in trash'))
.then(() => expect(dataTable.getRowByName(file1).isPresent()).toBe(true, 'Item is not in trash'))
.then(() => apis.user.trashcan.restore(file1Id));
});
@@ -121,21 +121,21 @@ describe('Delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.selectMultipleItemsRow([file1, file2])
dataTable.selectMultipleItems([file1, file2])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`Deleted 2 items`);
expect(dataTable.getRowName(file1).isPresent()).toBe(false, `${file1} was not removed from list`);
expect(dataTable.getRowName(file2).isPresent()).toBe(false, `${file2} was not removed from list`);
expect(dataTable.getRowByName(file1).isPresent()).toBe(false, `${file1} was not removed from list`);
expect(dataTable.getRowByName(file2).isPresent()).toBe(false, `${file2} was not removed from list`);
items = items - 2;
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(file1).isPresent()).toBe(true, `${file1} is not in trash`);
expect(dataTable.getRowName(file2).isPresent()).toBe(true, `${file2} is not in trash`);
expect(dataTable.getRowByName(file1).isPresent()).toBe(true, `${file1} is not in trash`);
expect(dataTable.getRowByName(file2).isPresent()).toBe(true, `${file2} is not in trash`);
})
.then(() => apis.user.trashcan.restore(file1Id))
@@ -146,41 +146,41 @@ describe('Delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnItemNameRow(folder1)
dataTable.clickOnRowByName(folder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => {
expect(dataTable.getRowName(folder1).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(folder1).isPresent()).toBe(false, 'Item was not removed from list');
items--;
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(folder1).isPresent()).toBe(true, 'Item is not in trash');
expect(dataTable.getRowName(file3).isPresent()).toBe(false, 'Item is in trash');
expect(dataTable.getRowByName(folder1).isPresent()).toBe(true, 'Item is not in trash');
expect(dataTable.getRowByName(file3).isPresent()).toBe(false, 'Item is in trash');
})
.then(() => apis.user.trashcan.restore(folder1Id));
});
it('delete a folder containing locked files', () => {
dataTable.clickOnItemNameRow(folder2)
dataTable.clickOnRowByName(folder2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`${folder2} couldn't be deleted`);
expect(dataTable.getRowName(folder2).isPresent()).toBe(true, 'Item was removed from list');
expect(dataTable.getRowByName(folder2).isPresent()).toBe(true, 'Item was removed from list');
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(folder2).isPresent()).toBe(false, 'Item is in trash');
expect(dataTable.getRowName(file4).isPresent()).toBe(false, 'Item is in trash');
expect(dataTable.getRowByName(folder2).isPresent()).toBe(false, 'Item is in trash');
expect(dataTable.getRowByName(file4).isPresent()).toBe(false, 'Item is in trash');
});
});
it('notification on multiple items deletion - some items fail to delete', () => {
dataTable.selectMultipleItemsRow([file1, folder2])
dataTable.selectMultipleItems([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.selectMultipleItemsRow([fileLocked1, folder2])
dataTable.selectMultipleItems([fileLocked1, folder2])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
@@ -234,34 +234,34 @@ describe('Delete content', () => {
});
it('delete a file and check notification', () => {
dataTable.clickOnItemNameRow(sharedFile1)
dataTable.clickOnRowByName(sharedFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`${sharedFile1} deleted`);
expect(dataTable.getRowName(sharedFile1).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(sharedFile1).isPresent()).toBe(false, 'Item was not removed from list');
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => expect(dataTable.getRowName(sharedFile1).isPresent()).toBe(true, 'Item is not in trash'))
.then(() => expect(dataTable.getRowByName(sharedFile1).isPresent()).toBe(true, 'Item is not in trash'))
.then(() => apis.user.trashcan.restore(sharedFile1Id));
});
it('delete multiple files and check notification', () => {
dataTable.selectMultipleItemsRow([sharedFile2, sharedFile3])
dataTable.selectMultipleItems([sharedFile2, sharedFile3])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`Deleted 2 items`);
expect(dataTable.getRowName(sharedFile2).isPresent()).toBe(false, `${sharedFile2} was not removed from list`);
expect(dataTable.getRowName(sharedFile3).isPresent()).toBe(false, `${sharedFile3} was not removed from list`);
expect(dataTable.getRowByName(sharedFile2).isPresent()).toBe(false, `${sharedFile2} was not removed from list`);
expect(dataTable.getRowByName(sharedFile3).isPresent()).toBe(false, `${sharedFile3} was not removed from list`);
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(sharedFile2).isPresent()).toBe(true, `${sharedFile2} is not in trash`);
expect(dataTable.getRowName(sharedFile3).isPresent()).toBe(true, `${sharedFile3} is not in trash`);
expect(dataTable.getRowByName(sharedFile2).isPresent()).toBe(true, `${sharedFile2} is not in trash`);
expect(dataTable.getRowByName(sharedFile3).isPresent()).toBe(true, `${sharedFile3} is not in trash`);
})
.then(() => apis.user.trashcan.restore(sharedFile2Id))
@@ -324,18 +324,18 @@ describe('Delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnItemNameRow(favoriteFile1)
dataTable.clickOnRowByName(favoriteFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`${favoriteFile1} deleted`);
expect(dataTable.getRowName(favoriteFile1).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(false, 'Item was not removed from list');
items--;
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => expect(dataTable.getRowName(favoriteFile1).isPresent()).toBe(true, 'Item is not in trash'))
.then(() => expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, 'Item is not in trash'))
.then(() => apis.user.trashcan.restore(favoriteFile1Id));
});
@@ -344,21 +344,21 @@ describe('Delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.selectMultipleItemsRow([favoriteFile1, favoriteFile2])
dataTable.selectMultipleItems([favoriteFile1, favoriteFile2])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`Deleted 2 items`);
expect(dataTable.getRowName(favoriteFile1).isPresent()).toBe(false, `${favoriteFile1} was not removed from list`);
expect(dataTable.getRowName(favoriteFile2).isPresent()).toBe(false, `${favoriteFile2} was not removed from list`);
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(false, `${favoriteFile1} was not removed from list`);
expect(dataTable.getRowByName(favoriteFile2).isPresent()).toBe(false, `${favoriteFile2} was not removed from list`);
items = items - 2;
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(favoriteFile1).isPresent()).toBe(true, `${favoriteFile1} is not in trash`);
expect(dataTable.getRowName(favoriteFile2).isPresent()).toBe(true, `${favoriteFile2} is not in trash`);
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, `${favoriteFile1} is not in trash`);
expect(dataTable.getRowByName(favoriteFile2).isPresent()).toBe(true, `${favoriteFile2} is not in trash`);
})
.then(() => apis.user.trashcan.restore(favoriteFile1Id))
@@ -368,41 +368,41 @@ describe('Delete content', () => {
it('delete a folder with content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnItemNameRow(favoriteFolder1)
dataTable.clickOnRowByName(favoriteFolder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => {
expect(dataTable.getRowName(favoriteFolder1).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(false, 'Item was not removed from list');
items--;
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(favoriteFolder1).isPresent()).toBe(true, 'Item is not in trash');
expect(dataTable.getRowName(favoriteFile3).isPresent()).toBe(false, 'Item is in trash');
expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(true, 'Item is not in trash');
expect(dataTable.getRowByName(favoriteFile3).isPresent()).toBe(false, 'Item is in trash');
})
.then(() => apis.user.trashcan.restore(favoriteFolder1Id));
});
it('delete a folder containing locked files', () => {
dataTable.clickOnItemNameRow(favoriteFolder2)
dataTable.clickOnRowByName(favoriteFolder2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`${favoriteFolder2} couldn't be deleted`);
expect(dataTable.getRowName(favoriteFolder2).isPresent()).toBe(true, 'Item was removed from list');
expect(dataTable.getRowByName(favoriteFolder2).isPresent()).toBe(true, 'Item was removed from list');
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(favoriteFolder2).isPresent()).toBe(false, 'Item is in trash');
expect(dataTable.getRowName(favoriteFile4).isPresent()).toBe(false, 'Item is in trash');
expect(dataTable.getRowByName(favoriteFolder2).isPresent()).toBe(false, 'Item is in trash');
expect(dataTable.getRowByName(favoriteFile4).isPresent()).toBe(false, 'Item is in trash');
});
});
it('notification on multiple items deletion - some items fail to delete', () => {
dataTable.selectMultipleItemsRow([favoriteFile1, favoriteFolder2])
dataTable.selectMultipleItems([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.selectMultipleItemsRow([favoriteFileLocked1, favoriteFolder2])
dataTable.selectMultipleItems([favoriteFileLocked1, favoriteFolder2])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
@@ -467,34 +467,34 @@ describe('Delete content', () => {
});
xit('delete a file and check notification', () => {
dataTable.clickOnItemNameRow(recentFile1)
dataTable.clickOnRowByName(recentFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`${recentFile1} deleted`);
expect(dataTable.getRowName(recentFile1).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(recentFile1).isPresent()).toBe(false, 'Item was not removed from list');
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => expect(dataTable.getRowName(recentFile1).isPresent()).toBe(true, 'Item is not in trash'))
.then(() => expect(dataTable.getRowByName(recentFile1).isPresent()).toBe(true, 'Item is not in trash'))
.then(() => apis.user.trashcan.restore(recentFile1Id));
});
xit('delete multiple files and check notification', () => {
dataTable.selectMultipleItemsRow([recentFile2, recentFile3])
dataTable.selectMultipleItems([recentFile2, recentFile3])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`Deleted 2 items`);
expect(dataTable.getRowName(recentFile2).isPresent()).toBe(false, `${recentFile2} was not removed from list`);
expect(dataTable.getRowName(recentFile3).isPresent()).toBe(false, `${recentFile3} was not removed from list`);
expect(dataTable.getRowByName(recentFile2).isPresent()).toBe(false, `${recentFile2} was not removed from list`);
expect(dataTable.getRowByName(recentFile3).isPresent()).toBe(false, `${recentFile3} was not removed from list`);
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(recentFile2).isPresent()).toBe(true, `${recentFile2} is not in trash`);
expect(dataTable.getRowName(recentFile3).isPresent()).toBe(true, `${recentFile3} is not in trash`);
expect(dataTable.getRowByName(recentFile2).isPresent()).toBe(true, `${recentFile2} is not in trash`);
expect(dataTable.getRowByName(recentFile3).isPresent()).toBe(true, `${recentFile3} is not in trash`);
})
.then(() => apis.user.trashcan.restore(recentFile2Id))

View File

@@ -74,7 +74,7 @@ describe('Edit folder', () => {
beforeEach(done => {
personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => dataTable.waitForHeader())
.then(() => dataTable.doubleClickOnItemNameRow(parent))
.then(() => dataTable.doubleClickOnRowByName(parent))
.then(() => dataTable.waitForHeader())
.then(done);
});
@@ -94,7 +94,7 @@ describe('Edit folder', () => {
});
it('dialog UI defaults', () => {
dataTable.clickOnItemNameRow(folderName)
dataTable.clickOnRowByName(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.clickOnItemNameRow(folderNameToEdit)
dataTable.clickOnRowByName(folderNameToEdit)
.then(() => editButton.click())
.then(() => editDialog.waitForDialogToOpen())
.then(() => editDialog.enterDescription(folderDescriptionEdited))
@@ -114,13 +114,13 @@ describe('Edit folder', () => {
.then(() => editDialog.clickUpdate())
.then(() => editDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.then(() => expect(dataTable.getRowName(folderNameEdited).isPresent()).toBe(true, 'Folder not displayed'))
.then(() => expect(dataTable.getRowByName(folderNameEdited).isPresent()).toBe(true, 'Folder not displayed'))
.then(() => apis.user.nodes.getNodeDescription(folderNameEdited, parent))
.then(desc => expect(desc).toEqual(folderDescriptionEdited));
});
it('with empty folder name', () => {
dataTable.clickOnItemNameRow(folderName)
dataTable.clickOnRowByName(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', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
dataTable.clickOnItemNameRow(folderName)
dataTable.clickOnRowByName(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.clickOnItemNameRow(folderName)
dataTable.clickOnRowByName(folderName)
.then(() => editButton.click())
.then(() => editDialog.nameInput.sendKeys('.'))
.then(() => {
@@ -153,7 +153,7 @@ describe('Edit folder', () => {
});
it('Cancel button', () => {
dataTable.clickOnItemNameRow(folderName)
dataTable.clickOnRowByName(folderName)
.then(() => editButton.click())
.then(() => editDialog.clickCancel())
.then(() => {
@@ -162,7 +162,7 @@ describe('Edit folder', () => {
});
it('with duplicate folder name', () => {
dataTable.clickOnItemNameRow(folderName)
dataTable.clickOnRowByName(folderName)
.then(() => editButton.click())
.then(() => editDialog.enterName(duplicateFolderName))
.then(() => editDialog.clickUpdate())
@@ -174,14 +174,14 @@ describe('Edit folder', () => {
});
it('trim ending spaces', () => {
dataTable.clickOnItemNameRow(folderName)
dataTable.clickOnRowByName(folderName)
.then(() => editButton.click())
.then(() => editDialog.nameInput.sendKeys(' '))
.then(() => editDialog.clickUpdate())
.then(() => editDialog.waitForDialogToClose())
.then(() => {
expect(personalFilesPage.snackBar.isPresent()).not.toBe(true, 'notification appears');
expect(dataTable.getRowName(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
expect(dataTable.getRowByName(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
});
});
});

View File

@@ -61,6 +61,9 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.addFavoriteById('file', file3Id))
.then(() => apis.user.favorites.addFavoriteById('file', file4Id))
.then(() => apis.user.search.waitForApi(username, { expect: 4 }))
.then(() => apis.user.favorites.waitForApi({ expect: 2 }))
.then(() => loginPage.loginWith(username))
.then(done);
});
@@ -82,31 +85,30 @@ describe('Mark items as favorites', () => {
.then(done);
});
afterEach(done => {
// browser.actions().sendKeys(protractor.Key.ESCAPE).perform().then(done);
browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
beforeEach(done => {
toolbar.actions.closeMoreMenu().then(done);
});
it('Favorite action has empty star icon for an item not marked as favorite', () => {
dataTable.clickOnItemNameRow(file1NotFav)
dataTable.clickOnRowByName(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.selectMultipleItemsRow([ file1NotFav, file3Fav ])
dataTable.selectMultipleItems([ 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.clickOnItemNameRow(file3Fav)
dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star'));
});
it('favorite a file', () => {
dataTable.clickOnItemNameRow(file1NotFav)
dataTable.clickOnRowByName(file1NotFav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
@@ -117,7 +119,7 @@ describe('Mark items as favorites', () => {
});
it('favorite a folder', () => {
dataTable.clickOnItemNameRow(folder1)
dataTable.clickOnRowByName(folder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
@@ -128,7 +130,7 @@ describe('Mark items as favorites', () => {
});
it('unfavorite an item', () => {
dataTable.clickOnItemNameRow(file3Fav)
dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 1 }))
@@ -139,7 +141,7 @@ describe('Mark items as favorites', () => {
});
it('favorite multiple items - all unfavorite', () => {
dataTable.selectMultipleItemsRow([ file1NotFav, file2NotFav ])
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 4 }))
@@ -157,7 +159,7 @@ describe('Mark items as favorites', () => {
});
it('favorite multiple items - some favorite and some unfavorite', () => {
dataTable.selectMultipleItemsRow([ file1NotFav, file3Fav ])
dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
@@ -174,7 +176,7 @@ describe('Mark items as favorites', () => {
});
it('unfavorite multiple items', () => {
dataTable.selectMultipleItemsRow([ file3Fav, file4Fav ])
dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => browser.sleep(2000))
@@ -199,13 +201,12 @@ describe('Mark items as favorites', () => {
.then(done);
});
afterEach(done => {
// browser.actions().sendKeys(protractor.Key.ESCAPE).perform().then(done);
browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
beforeEach(done => {
toolbar.actions.closeMoreMenu().then(done);
});
it('favorite a file', () => {
dataTable.clickOnItemNameRow(file1NotFav)
dataTable.clickOnRowByName(file1NotFav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
@@ -216,7 +217,7 @@ describe('Mark items as favorites', () => {
});
it('unfavorite an item', () => {
dataTable.clickOnItemNameRow(file3Fav)
dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 1 }))
@@ -227,7 +228,7 @@ describe('Mark items as favorites', () => {
});
it('favorite multiple items - all unfavorite', () => {
dataTable.selectMultipleItemsRow([ file1NotFav, file2NotFav ])
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 4 }))
@@ -245,7 +246,7 @@ describe('Mark items as favorites', () => {
});
it('favorite multiple items - some favorite and some unfavorite', () => {
dataTable.selectMultipleItemsRow([ file1NotFav, file3Fav ])
dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
@@ -262,7 +263,7 @@ describe('Mark items as favorites', () => {
});
it('unfavorite multiple items', () => {
dataTable.selectMultipleItemsRow([ file3Fav, file4Fav ])
dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => browser.sleep(2000))
@@ -295,7 +296,7 @@ describe('Mark items as favorites', () => {
});
it('favorite a file', () => {
dataTable.clickOnItemNameRow(file1NotFav)
dataTable.clickOnRowByName(file1NotFav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
@@ -306,7 +307,7 @@ describe('Mark items as favorites', () => {
});
it('unfavorite an item', () => {
dataTable.clickOnItemNameRow(file3Fav)
dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 1 }))
@@ -317,7 +318,7 @@ describe('Mark items as favorites', () => {
});
it('favorite multiple items - all unfavorite', () => {
dataTable.selectMultipleItemsRow([ file1NotFav, file2NotFav ])
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 4 }))
@@ -335,7 +336,7 @@ describe('Mark items as favorites', () => {
});
it('favorite multiple items - some favorite and some unfavorite', () => {
dataTable.selectMultipleItemsRow([ file1NotFav, file3Fav ])
dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
@@ -352,7 +353,7 @@ describe('Mark items as favorites', () => {
});
it('unfavorite multiple items', () => {
dataTable.selectMultipleItemsRow([ file3Fav, file4Fav ])
dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => browser.sleep(2000))
@@ -382,33 +383,33 @@ describe('Mark items as favorites', () => {
});
it('unfavorite an item', () => {
dataTable.clickOnItemNameRow(file3Fav)
dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 1 }))
.then(() => apis.user.favorites.isFavorite(file3Id))
.then(isFavorite => {
expect(isFavorite).toBe(false, 'item is marked as favorite');
expect(dataTable.getRowName(file3Fav).isPresent()).toBe(false, 'item still displayed');
expect(dataTable.getRowByName(file3Fav).isPresent()).toBe(false, 'item still displayed');
})
.then(() => apis.user.favorites.addFavoriteById('file', file3Id));
});
it('unfavorite multiple items', () => {
dataTable.selectMultipleItemsRow([ file3Fav, file4Fav ])
dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
.then(() => browser.sleep(2000))
.then(() => apis.user.favorites.isFavorite(file3Id))
.then(resp => {
expect(resp).toBe(false, 'file3 marked as favorite');
expect(dataTable.getRowName(file3Fav).isPresent()).toBe(false, 'file3 still displayed');
expect(dataTable.getRowByName(file3Fav).isPresent()).toBe(false, 'file3 still displayed');
})
.then(() => apis.user.favorites.isFavorite(file4Id))
.then(resp => {
expect(resp).toBe(false, 'file4 marked as favorite');
expect(dataTable.getRowName(file4Fav).isPresent()).toBe(false, 'file4 still displayed');
expect(dataTable.getRowByName(file4Fav).isPresent()).toBe(false, 'file4 still displayed');
})
.then(() => apis.user.favorites.addFavoriteById('file', file3Id))

View File

@@ -78,7 +78,7 @@ describe('Permanently delete from Trash', () => {
});
it('delete file [C217094] [C217091] [C217092]', () => {
dataTable.clickOnItemNameRow(file1)
dataTable.clickOnRowByName(file1)
.then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click())
.then(() => trashPage.waitForDialog())
.then(() => trashPage.getDialogActionByLabel('Delete'))
@@ -87,12 +87,12 @@ describe('Permanently delete from Trash', () => {
.then(() => trashPage.getSnackBarMessage())
.then(text => {
expect(text).toEqual(`${file1} deleted`);
expect(dataTable.getRowName(file1).isPresent()).toBe(false, 'Item was not deleted');
expect(dataTable.getRowByName(file1).isPresent()).toBe(false, 'Item was not deleted');
});
});
it('delete folder [C217091] [C217092]', () => {
dataTable.clickOnItemNameRow(folder1)
dataTable.clickOnRowByName(folder1)
.then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click())
.then(() => trashPage.waitForDialog())
.then(() => trashPage.getDialogActionByLabel('Delete'))
@@ -101,12 +101,12 @@ describe('Permanently delete from Trash', () => {
.then(() => trashPage.getSnackBarMessage())
.then(text => {
expect(text).toEqual(`${folder1} deleted`);
expect(dataTable.getRowName(folder1).isPresent()).toBe(false, 'Item was not deleted');
expect(dataTable.getRowByName(folder1).isPresent()).toBe(false, 'Item was not deleted');
});
});
it('delete multiple items [C217093]', () => {
dataTable.selectMultipleItemsRow([ file2, folder2 ])
dataTable.selectMultipleItems([ file2, folder2 ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click())
.then(() => trashPage.waitForDialog())
.then(() => trashPage.getDialogActionByLabel('Delete'))
@@ -115,8 +115,8 @@ describe('Permanently delete from Trash', () => {
.then(() => trashPage.getSnackBarMessage())
.then(text => {
expect(text).toEqual(`2 items deleted`);
expect(dataTable.getRowName(file2).isPresent()).toBe(false, 'Item was not deleted');
expect(dataTable.getRowName(folder2).isPresent()).toBe(false, 'Item was not deleted');
expect(dataTable.getRowByName(file2).isPresent()).toBe(false, 'Item was not deleted');
expect(dataTable.getRowByName(folder2).isPresent()).toBe(false, 'Item was not deleted');
});
});
});

View File

@@ -80,63 +80,63 @@ describe('Restore from Trash', () => {
});
it('restore file', () => {
dataTable.clickOnItemNameRow(file)
dataTable.clickOnRowByName(file)
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage())
.then(text => {
expect(text).toContain(`${file} restored`);
expect(text).toContain(`View`);
expect(dataTable.getRowName(file).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(file).isPresent()).toBe(false, 'Item was not removed from list');
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
.then(() => page.dataTable.waitForHeader())
.then(() => {
expect(page.dataTable.getRowName(file).isPresent()).toBe(true, 'Item not displayed in list');
expect(page.dataTable.getRowByName(file).isPresent()).toBe(true, 'Item not displayed in list');
})
.then(() => apis.user.nodes.deleteNodeById(fileId, false));
});
it('restore folder', () => {
dataTable.clickOnItemNameRow(folder)
dataTable.clickOnRowByName(folder)
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage())
.then(text => {
expect(text).toContain(`${folder} restored`);
expect(text).toContain(`View`);
expect(dataTable.getRowName(folder).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(folder).isPresent()).toBe(false, 'Item was not removed from list');
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
.then(() => page.dataTable.waitForHeader())
.then(() => {
expect(page.dataTable.getRowName(folder).isPresent()).toBe(true, 'Item not displayed in list');
expect(page.dataTable.getRowByName(folder).isPresent()).toBe(true, 'Item not displayed in list');
})
.then(() => apis.user.nodes.deleteNodeById(folderId, false));
});
it('restore multiple items', () => {
dataTable.selectMultipleItemsRow([ file, folder ])
dataTable.selectMultipleItems([ file, folder ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage())
.then(text => {
expect(text).toContain(`Restore successful`);
expect(text).not.toContain(`View`);
expect(dataTable.getRowName(file).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowName(folder).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(file).isPresent()).toBe(false, 'Item was not removed from list');
expect(dataTable.getRowByName(folder).isPresent()).toBe(false, 'Item was not removed from list');
})
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
.then(() => page.dataTable.waitForHeader())
.then(() => {
expect(page.dataTable.getRowName(file).isPresent()).toBe(true, 'Item not displayed in list');
expect(page.dataTable.getRowName(folder).isPresent()).toBe(true, 'Item not displayed in list');
expect(page.dataTable.getRowByName(file).isPresent()).toBe(true, 'Item not displayed in list');
expect(page.dataTable.getRowByName(folder).isPresent()).toBe(true, 'Item not displayed in list');
})
.then(() => apis.user.nodes.deleteNodesById([ fileId, folderId ], false));
});
it('View from notification', () => {
dataTable.clickOnItemNameRow(file)
dataTable.clickOnRowByName(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.clickOnItemNameRow(file1))
.then(() => dataTable.clickOnRowByName(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.clickOnItemNameRow(file2))
.then(() => dataTable.clickOnRowByName(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.selectMultipleItemsRow([ file1, file2 ])
dataTable.selectMultipleItems([ 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.selectMultipleItemsRow([ file3, file4, file5 ])
dataTable.selectMultipleItems([ 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'));

View File

@@ -25,7 +25,7 @@
import { browser, protractor } from 'protractor';
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
import { SITE_VISIBILITY, SITE_ROLES, SIDEBAR_LABELS, APP_ROUTES } from '../../configs';
import { SITE_VISIBILITY, SITE_ROLES, SIDEBAR_LABELS } from '../../configs';
import { RepoClient } from '../../utilities/repo-client/repo-client';
import { Utils } from '../../utilities/utils';
@@ -77,9 +77,11 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => apis.user.nodes.createFolders([ folderForDelete2 ]).then(resp => folderForDelete2Id = resp.data.entry.id))
.then(() => apis.user.shared.shareFilesByIds([ file1Id, file2Id ]))
.then(() => apis.user.shared.waitForApi({ expect: 2 }))
.then(() => apis.user.favorites.addFavoritesByIds('file', [ file1Id, file2Id ]))
.then(() => apis.user.favorites.addFavoritesByIds('folder', [ folder1Id, folder2Id ]))
.then(() => apis.user.favorites.waitForApi({ expect: 4 }))
.then(() => apis.user.nodes.deleteNodesById([
fileForDelete1Id, fileForDelete2Id, folderForDelete1Id, folderForDelete2Id
@@ -115,26 +117,26 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('unselect selected items - single click', () => {
dataTable.selectMultipleItemsRow([ file1, file2, folder1, folder2 ])
dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ])
.then(() => expect(dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number'))
.then(() => dataTable.clickOnItemNameRow(file1))
.then(() => dataTable.clickOnRowByName(file1))
.then(() => expect(dataTable.countSelectedRows()).toEqual(1, 'incorrect selected rows number'))
.then(() => dataTable.clearSelection());
});
it('unselect selected items - CMD+click', () => {
dataTable.selectMultipleItemsRow([ file1, file2, folder1, folder2 ])
dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ])
.then(() => expect(dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number'))
.then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform())
.then(() => dataTable.clickOnItemNameRow(file1))
.then(() => dataTable.clickOnItemNameRow(file2))
.then(() => dataTable.clickOnRowByName(file1))
.then(() => dataTable.clickOnRowByName(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.selectMultipleItemsRow([file1, file2])
dataTable.selectMultipleItems([file1, file2])
.then(() => toolbar.actions.openMoreMenu())
.then(menu => {
expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
@@ -142,13 +144,12 @@ describe('Toolbar actions - multiple selection : ', () => {
expect(menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
expect(menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
})
// .then(() => browser.$('body').click())
.then(() => browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform())
.then(() => browser.actions().sendKeys(protractor.Key.ESCAPE).perform())
.then(() => dataTable.clearSelection());
});
it('correct actions appear when multiple folders are selected', () => {
dataTable.selectMultipleItemsRow([folder1, folder2])
dataTable.selectMultipleItems([folder1, folder2])
.then(() => toolbar.actions.openMoreMenu())
.then(menu => {
expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
@@ -156,55 +157,54 @@ describe('Toolbar actions - multiple selection : ', () => {
expect(menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
expect(menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
})
// .then(() => browser.$('body').click())
.then(() => browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform())
.then(() => browser.actions().sendKeys(protractor.Key.ESCAPE).perform())
.then(() => dataTable.clearSelection());
});
it('should not display View action when multiple entries selected', async () => {
await dataTable.selectMultipleItemsRow([folder1, file1, folder2]);
await dataTable.selectMultipleItems([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.selectMultipleItemsRow([file1]);
await dataTable.selectMultipleItems([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.selectMultipleItemsRow([folder1, folder2]);
await dataTable.selectMultipleItems([folder1, folder2]);
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'Action is displayed');
});
it('should display Download action for selected items', async () => {
await dataTable.selectMultipleItemsRow([folder1, file1, folder2]);
await dataTable.selectMultipleItems([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.selectMultipleItemsRow([folder1, file1, folder2]);
await dataTable.selectMultipleItems([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.selectMultipleItemsRow([folder1]);
await dataTable.selectMultipleItems([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.selectMultipleItemsRow([folder1, file1, folder2]);
await dataTable.selectMultipleItems([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.selectMultipleItemsRow([file1, file2]);
await dataTable.selectMultipleItems([file1, file2]);
expect(toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Action is displayed');
});
it('correct actions appear when both files and folders are selected', () => {
dataTable.selectMultipleItemsRow([file1, file2, folder1, folder2])
dataTable.selectMultipleItems([file1, file2, folder1, folder2])
.then(() => toolbar.actions.openMoreMenu())
.then(menu => {
expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
@@ -212,8 +212,7 @@ describe('Toolbar actions - multiple selection : ', () => {
expect(menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
expect(menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
})
// .then(() => browser.$('body').click())
.then(() => browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform())
.then(() => browser.actions().sendKeys(protractor.Key.ESCAPE).perform())
.then(() => dataTable.clearSelection());
});
});
@@ -232,7 +231,7 @@ describe('Toolbar actions - multiple selection : ', () => {
beforeEach(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => dataTable.waitForHeader())
.then(() => dataTable.doubleClickOnItemNameRow(siteName))
.then(() => dataTable.doubleClickOnRowByName(siteName))
.then(() => dataTable.waitForHeader())
.then(done);
});
@@ -253,7 +252,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple files are selected', () => {
dataTable.selectMultipleItemsRow([file1Admin, file2Admin])
dataTable.selectMultipleItems([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 +271,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple folders are selected', () => {
dataTable.selectMultipleItemsRow([folder1Admin, folder2Admin])
dataTable.selectMultipleItems([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 +290,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when both files and folders are selected', () => {
dataTable.selectMultipleItemsRow([file1Admin, file2Admin, folder1Admin, folder2Admin])
dataTable.selectMultipleItems([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 +319,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple files are selected', () => {
dataTable.selectMultipleItemsRow([file1Admin, file2Admin])
dataTable.selectMultipleItems([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 +338,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple folders are selected', () => {
dataTable.selectMultipleItemsRow([folder1Admin, folder2Admin])
dataTable.selectMultipleItems([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 +357,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when both files and folders are selected', () => {
dataTable.selectMultipleItemsRow([file1Admin, file2Admin, folder1Admin, folder2Admin])
dataTable.selectMultipleItems([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');
@@ -384,8 +383,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
beforeEach(done => {
// page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
browser.get(APP_ROUTES.SHARED_FILES)
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => dataTable.waitForHeader())
.then(done);
});
@@ -395,7 +393,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple files are selected', () => {
dataTable.selectMultipleItemsRow([file1, file2])
dataTable.selectMultipleItems([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');
@@ -408,7 +406,6 @@ describe('Toolbar actions - multiple selection : ', () => {
expect(menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
expect(menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
})
// .then(() => browser.$('body').click())
.then(() => browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform())
.then(() => dataTable.clearSelection());
});
@@ -430,7 +427,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple files are selected', () => {
dataTable.selectMultipleItemsRow([file1, file2])
dataTable.selectMultipleItems([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 +462,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple files are selected', () => {
dataTable.selectMultipleItemsRow([file1, file2])
dataTable.selectMultipleItems([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 +481,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple folders are selected', () => {
dataTable.selectMultipleItemsRow([folder1, folder2])
dataTable.selectMultipleItems([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 +500,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when both files and folders are selected', () => {
dataTable.selectMultipleItemsRow([file1, file2, folder1, folder2])
dataTable.selectMultipleItems([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 +536,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple files are selected', () => {
dataTable.selectMultipleItemsRow([fileForDelete1, fileForDelete2])
dataTable.selectMultipleItems([fileForDelete1, fileForDelete2])
.then(() => {
expect(toolbar.actions.isButtonPresent('Permanently delete'))
.toBe(true, 'Permanently delete is displayed for selected files');
@@ -549,7 +546,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when multiple folders are selected', () => {
dataTable.selectMultipleItemsRow([folderForDelete1, folderForDelete2])
dataTable.selectMultipleItems([folderForDelete1, folderForDelete2])
.then(() => {
expect(toolbar.actions.isButtonPresent('Permanently delete'))
.toBe(true, 'Permanently delete is displayed for selected files');
@@ -559,7 +556,7 @@ describe('Toolbar actions - multiple selection : ', () => {
});
it('correct actions appear when both files and folders are selected', () => {
dataTable.selectMultipleItemsRow([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2])
dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2])
.then(() => {
expect(toolbar.actions.isButtonPresent('Permanently delete'))
.toBe(true, 'Permanently delete is displayed for selected files');

File diff suppressed because it is too large Load Diff

View File

@@ -95,7 +95,7 @@ describe('Undo delete content', () => {
});
it('Successful delete notification shows Undo action', () => {
dataTable.clickOnItemNameRow(file1)
dataTable.clickOnRowByName(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.clickOnItemNameRow(folder2)
dataTable.clickOnRowByName(folder2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
@@ -120,12 +120,12 @@ describe('Undo delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnItemNameRow(file1)
dataTable.clickOnRowByName(file1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowName(file1).isPresent()).toBe(true, 'Item was not restored');
expect(dataTable.getRowByName(file1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
@@ -134,17 +134,17 @@ describe('Undo delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnItemNameRow(folder1)
dataTable.clickOnRowByName(folder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowName(folder1).isPresent()).toBe(true, 'Item was not restored');
expect(dataTable.getRowByName(folder1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => dataTable.doubleClickOnItemNameRow(folder1))
.then(() => dataTable.doubleClickOnRowByName(folder1))
.then(() => {
expect(dataTable.getRowName(file4).isPresent()).toBe(true, 'file from folder not restored');
expect(dataTable.getRowByName(file4).isPresent()).toBe(true, 'file from folder not restored');
});
});
@@ -152,13 +152,13 @@ describe('Undo delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.selectMultipleItemsRow([file2, file3])
dataTable.selectMultipleItems([file2, file3])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowName(file2).isPresent()).toBe(true, `${file2} was not removed from list`);
expect(dataTable.getRowName(file3).isPresent()).toBe(true, `${file3} was not removed from list`);
expect(dataTable.getRowByName(file2).isPresent()).toBe(true, `${file2} was not removed from list`);
expect(dataTable.getRowByName(file3).isPresent()).toBe(true, `${file3} was not removed from list`);
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
@@ -201,7 +201,7 @@ describe('Undo delete content', () => {
});
it('Successful delete notification shows Undo action', () => {
dataTable.clickOnItemNameRow(sharedFile1)
dataTable.clickOnRowByName(sharedFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
@@ -209,23 +209,23 @@ describe('Undo delete content', () => {
});
it('Undo delete of file', () => {
dataTable.clickOnItemNameRow(sharedFile2)
dataTable.clickOnRowByName(sharedFile2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => expect(dataTable.getRowName(sharedFile2).isPresent()).toBe(false, 'Item was not restored'));
.then(() => expect(dataTable.getRowByName(sharedFile2).isPresent()).toBe(false, 'Item was not restored'));
});
it('undo delete of multiple files', () => {
dataTable.selectMultipleItemsRow([sharedFile3, sharedFile4])
dataTable.selectMultipleItems([sharedFile3, sharedFile4])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(sharedFile3).isPresent()).toBe(false, `${sharedFile3} was not restored`);
expect(dataTable.getRowName(sharedFile4).isPresent()).toBe(false, `${sharedFile4} was not restored`);
expect(dataTable.getRowByName(sharedFile3).isPresent()).toBe(false, `${sharedFile3} was not restored`);
expect(dataTable.getRowByName(sharedFile4).isPresent()).toBe(false, `${sharedFile4} was not restored`);
});
});
});
@@ -276,7 +276,7 @@ describe('Undo delete content', () => {
});
it('Successful delete notification shows Undo action', () => {
dataTable.clickOnItemNameRow(favoriteFile1)
dataTable.clickOnRowByName(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.clickOnItemNameRow(favoriteFolder2)
dataTable.clickOnRowByName(favoriteFolder2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
@@ -297,12 +297,12 @@ describe('Undo delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnItemNameRow(favoriteFile1)
dataTable.clickOnRowByName(favoriteFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowName(favoriteFile1).isPresent()).toBe(true, 'Item was not restored');
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
@@ -311,29 +311,29 @@ describe('Undo delete content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnItemNameRow(favoriteFolder1)
dataTable.clickOnRowByName(favoriteFolder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowName(favoriteFolder1).isPresent()).toBe(true, 'Item was not restored');
expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => dataTable.doubleClickOnItemNameRow(favoriteFolder1))
.then(() => expect(dataTable.getRowName(favoriteFile4).isPresent()).toBe(true, 'file from folder not restored'));
.then(() => dataTable.doubleClickOnRowByName(favoriteFolder1))
.then(() => expect(dataTable.getRowByName(favoriteFile4).isPresent()).toBe(true, 'file from folder not restored'));
});
it('undo delete of multiple files', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.selectMultipleItemsRow([favoriteFile1, favoriteFile2])
dataTable.selectMultipleItems([favoriteFile1, favoriteFile2])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowName(favoriteFile1).isPresent()).toBe(true, `${favoriteFile1} was not removed from list`);
expect(dataTable.getRowName(favoriteFile2).isPresent()).toBe(true, `${favoriteFile2} was not removed from list`);
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, `${favoriteFile1} was not removed from list`);
expect(dataTable.getRowByName(favoriteFile2).isPresent()).toBe(true, `${favoriteFile2} was not removed from list`);
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
@@ -384,7 +384,7 @@ describe('Undo delete content', () => {
});
xit('Successful delete notification shows Undo action', () => {
dataTable.clickOnItemNameRow(recentFile1)
dataTable.clickOnRowByName(recentFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
@@ -396,12 +396,12 @@ 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.clickOnItemNameRow(recentFile2)
dataTable.clickOnRowByName(recentFile2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => expect(dataTable.getRowName(recentFile2).isPresent()).toBe(false, 'Item is in Trash'));
.then(() => expect(dataTable.getRowByName(recentFile2).isPresent()).toBe(false, 'Item is in Trash'));
});
// due to the fact that the search api is slow to update,
@@ -409,14 +409,14 @@ 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.selectMultipleItemsRow([recentFile3, recentFile4])
dataTable.selectMultipleItems([recentFile3, recentFile4])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => {
expect(dataTable.getRowName(recentFile3).isPresent()).toBe(false, `${recentFile3} is in Trash`);
expect(dataTable.getRowName(recentFile4).isPresent()).toBe(false, `${recentFile4} is in Trash`);
expect(dataTable.getRowByName(recentFile3).isPresent()).toBe(false, `${recentFile3} is in Trash`);
expect(dataTable.getRowByName(recentFile4).isPresent()).toBe(false, `${recentFile4} is in Trash`);
});
});
});

View File

@@ -67,7 +67,7 @@ describe('Upload files', () => {
});
it('Upload a file', () => {
dataTable.doubleClickOnItemNameRow(folder1)
dataTable.doubleClickOnRowByName(folder1)
.then(() => page.sidenav.openNewMenu())
.then(() => page.sidenav.menu.uploadFile().sendKeys(`${__dirname}/create-folder.test.ts`));
});

View File

@@ -33,11 +33,12 @@ describe('Favorites', () => {
const password = username;
const siteName = `site-${Utils.random()}`;
const folderName = `folder-${Utils.random()}`;
const favFolderName = `favFolder-${Utils.random()}`;
const parentFolder = `parent-${Utils.random()}`;
const fileName1 = `file1-${Utils.random()}.txt`;
const fileName2 = `file2-${Utils.random()}.txt`;
const fileName3 = `file3-${Utils.random()}.txt`; let file3Id;
const fileName4 = `file4-${Utils.random()}.txt`; let file4Id;
const fileName3 = `file3-${Utils.random()}.txt`;
const fileName4 = `file4-${Utils.random()}.txt`;
const apis = {
admin: new RepoClient(),
@@ -50,107 +51,109 @@ describe('Favorites', () => {
const { dataTable } = favoritesPage;
const { breadcrumb } = favoritesPage.toolbar;
beforeAll(done => {
apis.admin.people.createUser(username)
beforeAll(async (done) => {
await apis.admin.people.createUser(username);
.then(() => apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC))
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER))
.then(() => apis.admin.nodes.createFiles([ fileName1 ], `Sites/${siteName}/documentLibrary`)
.then(resp => apis.user.favorites.addFavoriteById('file', resp.data.entry.id)))
.then(() => apis.user.nodes.createFolders([ folderName ])
.then(resp => apis.user.favorites.addFavoriteById('folder', resp.data.entry.id)))
.then(() => apis.user.nodes.createFiles([ fileName2 ], folderName)
.then(resp => apis.user.favorites.addFavoriteById('file', resp.data.entry.id)))
.then(() => apis.user.nodes.createFiles([ fileName3 ], folderName)
.then(resp => file3Id = resp.data.entry.id)
.then(() => apis.user.favorites.addFavoriteById('file', file3Id))
.then(() => apis.user.nodes.deleteNodeById(file3Id, false)))
.then(() => apis.user.nodes.createFiles([ fileName4 ], folderName)
.then(resp => file4Id = resp.data.entry.id)
.then(() => apis.user.favorites.addFavoriteById('file', file4Id))
.then(() => apis.user.nodes.deleteNodeById(file4Id, false))
.then(() => apis.user.trashcan.restore(file4Id)))
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
const docLibId = await apis.admin.sites.getDocLibId(siteName);
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER);
.then(() => loginPage.loginWith(username))
.then(done);
const file1Id = (await apis.admin.nodes.createFile(fileName1, docLibId)).data.entry.id;
await apis.user.favorites.addFavoriteById('file', file1Id);
const folderId = (await apis.user.nodes.createFolder(favFolderName)).data.entry.id;
await apis.user.favorites.addFavoriteById('folder', folderId);
const parentId = (await apis.user.nodes.createFolder(parentFolder)).data.entry.id;
const file2Id = (await apis.user.nodes.createFile(fileName2, parentId)).data.entry.id;
await apis.user.favorites.addFavoriteById('file', file2Id);
const file3Id = (await apis.user.nodes.createFile(fileName3, parentId)).data.entry.id;
await apis.user.favorites.addFavoriteById('file', file3Id);
await apis.user.nodes.deleteNodeById(file3Id, false);
const file4Id = (await apis.user.nodes.createFile(fileName4, parentId)).data.entry.id;
await apis.user.favorites.addFavoriteById('file', file4Id);
await apis.user.nodes.deleteNodeById(file4Id, false);
await apis.user.trashcan.restore(file4Id);
await loginPage.loginWith(username);
done();
});
beforeEach(done => {
favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => dataTable.waitForHeader())
.then(done);
beforeEach(async (done) => {
await favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
await dataTable.waitForHeader();
done();
});
afterAll(done => {
Promise.all([
afterAll(async (done) => {
await Promise.all([
apis.admin.sites.deleteSite(siteName),
apis.user.nodes.deleteNodes([ folderName ]),
apis.user.nodes.deleteNodes([ favFolderName, parentFolder ]),
apis.admin.trashcan.emptyTrash(),
logoutPage.load()
])
.then(done);
]);
done();
});
it('has the correct columns', () => {
it('has the correct columns', async () => {
const labels = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by' ];
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
expect(dataTable.getColumnHeaders().count()).toBe(5 + 1, 'Incorrect number of columns');
expect(await dataTable.getColumnHeaders().count()).toBe(5 + 1, 'Incorrect number of columns');
elements.forEach((element, index) => {
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
await elements.forEach(async (element, index) => {
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
});
});
it('displays the favorite files and folders [C213226]', () => {
expect(dataTable.countRows()).toEqual(4, 'Incorrect number of items displayed');
expect(dataTable.getRowName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
expect(dataTable.getRowName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
expect(dataTable.getRowName(folderName).isPresent()).toBe(true, `${folderName} not displayed`);
it('displays the favorite files and folders [C213226]', async () => {
expect(await dataTable.countRows()).toEqual(4, 'Incorrect number of items displayed');
expect(await dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
expect(await dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
expect(await dataTable.getRowByName(favFolderName).isPresent()).toBe(true, `${favFolderName} not displayed`);
});
it(`file not displayed if it's in the Trashcan [C213228]`, () => {
expect(dataTable.getRowName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
it(`file not displayed if it's in the Trashcan [C213228]`, async () => {
expect(await dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
});
it(`file is displayed after it is restored from Trashcan [C213229]`, () => {
expect(dataTable.getRowName(fileName4).isPresent()).toBe(true, `${fileName4} not displayed`);
it(`file is displayed after it is restored from Trashcan [C213229]`, async () => {
expect(await dataTable.getRowByName(fileName4).isPresent()).toBe(true, `${fileName4} not displayed`);
});
it('Location column displays the parent folder of the files [C213231]', () => {
expect(dataTable.getItemLocation(fileName1).getText()).toEqual(siteName);
expect(dataTable.getItemLocation(fileName2).getText()).toEqual(folderName);
expect(dataTable.getItemLocation(folderName).getText()).toEqual('Personal Files');
it('Location column displays the parent folder of the files [C213231]', async () => {
expect(await dataTable.getItemLocation(fileName1).getText()).toEqual(siteName);
expect(await dataTable.getItemLocation(fileName2).getText()).toEqual(parentFolder);
expect(await dataTable.getItemLocation(favFolderName).getText()).toEqual('Personal Files');
});
it('Location column displays a tooltip with the entire path of the file [C213671]', () => {
it('Location column displays a tooltip with the entire path of the file [C213671]', async () => {
expect(dataTable.getItemLocationTooltip(fileName1)).toEqual(`File Libraries/${siteName}`);
expect(dataTable.getItemLocationTooltip(fileName2)).toEqual(`Personal Files/${folderName}`);
expect(dataTable.getItemLocationTooltip(folderName)).toEqual('Personal Files');
expect(dataTable.getItemLocationTooltip(fileName2)).toEqual(`Personal Files/${parentFolder}`);
expect(dataTable.getItemLocationTooltip(favFolderName)).toEqual('Personal Files');
});
it('Location column redirect - item in user Home [C213650] [C260968]', () => {
dataTable.clickItemLocation(folderName)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
it('Location column redirect - item in user Home [C213650] [C260968]', async () => {
await dataTable.clickItemLocation(favFolderName);
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
});
it('Location column redirect - file in folder [C213650] [C260968]', () => {
dataTable.clickItemLocation(fileName2)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderName ]));
it('Location column redirect - file in folder [C213650] [C260968]', async () => {
await dataTable.clickItemLocation(fileName2);
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', parentFolder ]);
});
it('Location column redirect - file in site [C213650] [C260969]', () => {
dataTable.clickItemLocation(fileName1)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]));
it('Location column redirect - file in site [C213650] [C260969]', async () => {
await dataTable.clickItemLocation(fileName1);
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]);
});
it('Navigate into folder from Favorites [C213230]', () => {
dataTable.doubleClickOnItemNameRow(folderName)
.then(() => dataTable.waitForHeader())
.then(() => breadcrumb.getCurrentItemName())
.then(name => {
expect(name).toBe(folderName);
it('Navigate into folder from Favorites [C213230]', async () => {
await dataTable.doubleClickOnRowByName(favFolderName);
await dataTable.waitForEmptyState();
expect(await breadcrumb.getCurrentItemName()).toBe(favFolderName);
});
});
});

View File

@@ -23,8 +23,6 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { by } from 'protractor';
import { SITE_VISIBILITY, SITE_ROLES, SIDEBAR_LABELS } from '../../configs';
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
import { Utils } from '../../utilities/utils';
@@ -117,7 +115,7 @@ describe('File Libraries', () => {
};
expect(sitesCount).toEqual(5, 'Incorrect number of sites displayed');
expect(dataTable.getRowName(adminSite).isPresent()).toBe(false, 'Incorrect site appears in list');
expect(dataTable.getRowByName(adminSite).isPresent()).toBe(false, 'Incorrect site appears in list');
dataTable.getRows()
.map((row) => {

View File

@@ -86,11 +86,11 @@ describe('Personal Files', () => {
});
it('has "Data Dictionary" folder [C213241]', () => {
expect(dataTable.getRowName('Data Dictionary').isPresent()).toBe(true);
expect(dataTable.getRowByName('Data Dictionary').isPresent()).toBe(true);
});
it('has created content', () => {
expect(dataTable.getRowName(adminFolder).isPresent()).toBe(true);
expect(dataTable.getRowByName(adminFolder).isPresent()).toBe(true);
});
});
@@ -125,7 +125,7 @@ describe('Personal Files', () => {
});
it('has user created content [C213242]', () => {
expect(dataTable.getRowName(userFolder).isPresent())
expect(dataTable.getRowByName(userFolder).isPresent())
.toBe(true);
});
@@ -135,7 +135,7 @@ describe('Personal Files', () => {
.then(response => response.data.entry.id);
const navigatePromise = dataTable
.doubleClickOnItemNameRow(userFolder)
.doubleClickOnRowByName(userFolder)
.then(() => dataTable.waitForHeader());
Promise
@@ -147,13 +147,13 @@ describe('Personal Files', () => {
expect(browser.getCurrentUrl())
.toContain(nodeId, 'Node ID is not in the URL');
expect(dataTable.getRowName(userFile).isPresent())
expect(dataTable.getRowByName(userFile).isPresent())
.toBe(true, 'user file is missing');
});
});
it('redirects to Personal Files on clicking the link from sidebar [C213245]', () => {
personalFilesPage.dataTable.doubleClickOnItemNameRow(userFolder)
personalFilesPage.dataTable.doubleClickOnRowByName(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'));

View File

@@ -103,13 +103,13 @@ describe('Recent Files', () => {
it('displays the files added by the current user in the last 30 days [C213170]', () => {
expect(dataTable.countRows()).toEqual(3, 'Incorrect number of files displayed');
expect(dataTable.getRowName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
expect(dataTable.getRowName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
expect(dataTable.getRowName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
expect(dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
expect(dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
});
it(`file not displayed if it's in the Trashcan [C213174]`, () => {
expect(dataTable.getRowName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
expect(dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
});
it('Location column displays the parent folder of the file [C213175]', () => {

View File

@@ -108,16 +108,16 @@ describe('Shared Files', () => {
});
it('displays the files shared by everyone [C213114]', () => {
expect(dataTable.getRowName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
expect(dataTable.getRowName(file1User).isPresent()).toBe(true, `${file1User} not displayed`);
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
expect(dataTable.getRowByName(file1User).isPresent()).toBe(true, `${file1User} not displayed`);
});
it(`file not displayed if it's in the Trashcan [C213117]`, () => {
expect(dataTable.getRowName(file2User).isPresent()).toBe(false, `${file2User} is displayed`);
expect(dataTable.getRowByName(file2User).isPresent()).toBe(false, `${file2User} is displayed`);
});
xit('unshared file is not displayed [C213118]', () => {
expect(dataTable.getRowName(file3User).isPresent()).toBe(false, `${file3User} is displayed`);
expect(dataTable.getRowByName(file3User).isPresent()).toBe(false, `${file3User} is displayed`);
});
it('Location column displays the parent folder of the file [C213665]', () => {

View File

@@ -100,7 +100,7 @@ describe('File / folder tooltips', () => {
describe('on Personal Files', () => {
beforeAll(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => dataTable.doubleClickOnItemNameRow(parent))
.then(() => dataTable.doubleClickOnRowByName(parent))
.then(done);
});

View File

@@ -108,11 +108,11 @@ describe('Trash', () => {
it('displays the files and folders deleted by everyone [C213217]', () => {
expect(dataTable.countRows()).toEqual(5, 'Incorrect number of deleted items displayed');
expect(dataTable.getRowName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
expect(dataTable.getRowName(folderAdmin).isPresent()).toBe(true, `${folderAdmin} not displayed`);
expect(dataTable.getRowName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
expect(dataTable.getRowName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
expect(dataTable.getRowName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
expect(dataTable.getRowByName(folderAdmin).isPresent()).toBe(true, `${folderAdmin} not displayed`);
expect(dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
expect(dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
});
});
@@ -145,10 +145,10 @@ describe('Trash', () => {
it('displays the files and folders deleted by the user [C213218]', () => {
expect(dataTable.countRows()).toEqual(3, 'Incorrect number of deleted items displayed');
expect(dataTable.getRowName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
expect(dataTable.getRowName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
expect(dataTable.getRowName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
expect(dataTable.getRowName(fileAdmin).isPresent()).toBe(false, `${fileAdmin} is displayed`);
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
expect(dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
expect(dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(false, `${fileAdmin} is displayed`);
});
it('default sorting column [C213219]', () => {

View File

@@ -136,9 +136,9 @@ describe('Breadcrumb', () => {
it('Personal Files breadcrumb for a folder hierarchy [C260965]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnItemName(parent))
.then(() => page.dataTable.doubleClickOnItemName(subFolder1))
.then(() => page.dataTable.doubleClickOnItemName(subFolder2))
.then(() => page.dataTable.doubleClickOnRowByName(parent))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder1))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder2))
.then(() => {
const expectedBreadcrumb = [ 'Personal Files', parent, subFolder1, subFolder2 ];
expect(breadcrumb.getAllItems()).toEqual(expectedBreadcrumb);
@@ -148,10 +148,10 @@ describe('Breadcrumb', () => {
it('File Libraries breadcrumb for a folder hierarchy [C260967]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnItemName(siteName))
.then(() => page.dataTable.doubleClickOnItemName(parent))
.then(() => page.dataTable.doubleClickOnItemName(subFolder1))
.then(() => page.dataTable.doubleClickOnItemName(subFolder2))
.then(() => page.dataTable.doubleClickOnRowByName(siteName))
.then(() => page.dataTable.doubleClickOnRowByName(parent))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder1))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder2))
.then(() => {
const expectedItems = [ 'File Libraries', siteName, parent, subFolder1, subFolder2 ];
expect(breadcrumb.getAllItems()).toEqual(expectedItems);
@@ -161,9 +161,9 @@ describe('Breadcrumb', () => {
it('User can navigate to any location by clicking on a step from the breadcrumb [C213235]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnItemName(parent))
.then(() => page.dataTable.doubleClickOnItemName(subFolder1))
.then(() => page.dataTable.doubleClickOnItemName(subFolder2))
.then(() => page.dataTable.doubleClickOnRowByName(parent))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder1))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder2))
.then(() => breadcrumb.clickItem(subFolder1))
.then(() => {
const expectedBreadcrumb = [ 'Personal Files', parent, subFolder1 ];
@@ -174,9 +174,9 @@ describe('Breadcrumb', () => {
it('Tooltip appears on hover on a step in breadcrumb [C213237]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnItemName(parent))
.then(() => page.dataTable.doubleClickOnItemName(subFolder1))
.then(() => page.dataTable.doubleClickOnItemName(subFolder2))
.then(() => page.dataTable.doubleClickOnRowByName(parent))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder1))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder2))
.then(() => {
expect(breadcrumb.getNthItemTooltip(3)).toEqual(subFolder1);
});
@@ -185,8 +185,8 @@ describe('Breadcrumb', () => {
it('Breadcrumb updates correctly when folder is renamed [C213238]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnItemName(parent2))
.then(() => page.dataTable.doubleClickOnItemName(folder1))
.then(() => page.dataTable.doubleClickOnRowByName(parent2))
.then(() => page.dataTable.doubleClickOnRowByName(folder1))
.then(() => page.dataTable.wait())
.then(() => apis.user.nodes.renameNode(folder1Id, folder1Renamed).then(done => done))
.then(() => page.refresh())
@@ -199,9 +199,9 @@ describe('Breadcrumb', () => {
it('Browser back navigates to previous location regardless of breadcrumb steps [C213240]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnItemName(parent))
.then(() => page.dataTable.doubleClickOnItemName(subFolder1))
.then(() => page.dataTable.doubleClickOnItemName(subFolder2))
.then(() => page.dataTable.doubleClickOnRowByName(parent))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder1))
.then(() => page.dataTable.doubleClickOnRowByName(subFolder2))
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => page.dataTable.waitForEmptyState())
.then(() => browser.navigate().back())
@@ -234,10 +234,10 @@ describe('Breadcrumb', () => {
});
it(`Breadcrumb on navigation to a user's home [C260970]`, () => {
page.dataTable.doubleClickOnItemName('User Homes')
.then(() => page.dataTable.doubleClickOnItemName(user2))
page.dataTable.doubleClickOnRowByName('User Homes')
.then(() => page.dataTable.doubleClickOnRowByName(user2))
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', 'User Homes', user2 ]))
.then(() => page.dataTable.doubleClickOnItemName(userFolder))
.then(() => page.dataTable.doubleClickOnRowByName(userFolder))
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', 'User Homes', user2, userFolder ]));
});
});

View File

@@ -181,7 +181,7 @@ describe('Pagination on Favorites', () => {
expect(pagination.getText(pagination.currentPage)).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
});
@@ -191,7 +191,7 @@ describe('Pagination on Favorites', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
});
@@ -204,7 +204,7 @@ describe('Pagination on Favorites', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-88.txt').isPresent())
expect(dataTable.getRowByName('file-88.txt').isPresent())
.toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());

View File

@@ -110,7 +110,7 @@ describe('Pagination on Personal Files', () => {
beforeEach(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => dataTable.waitForHeader())
.then(() => dataTable.doubleClickOnItemNameRow(parent))
.then(() => dataTable.doubleClickOnRowByName(parent))
.then(done);
});
@@ -179,7 +179,7 @@ describe('Pagination on Personal Files', () => {
expect(pagination.currentPage.getText()).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-60.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-60.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -190,7 +190,7 @@ describe('Pagination on Personal Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-30.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-30.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -204,7 +204,7 @@ describe('Pagination on Personal Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-12.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-12.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());

View File

@@ -181,7 +181,7 @@ describe('Pagination on Recent Files', () => {
expect(pagination.currentPage.getText()).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -192,7 +192,7 @@ describe('Pagination on Recent Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -206,7 +206,7 @@ describe('Pagination on Recent Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());

View File

@@ -186,7 +186,7 @@ describe('Pagination on Shared Files', () => {
expect(pagination.currentPage.getText()).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-40.txt').isPresent())
expect(dataTable.getRowByName('file-40.txt').isPresent())
.toBe(true, 'File not found on page');
})
@@ -198,7 +198,7 @@ describe('Pagination on Shared Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -212,7 +212,7 @@ describe('Pagination on Shared Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());

View File

@@ -184,7 +184,7 @@ describe('Pagination on Trash', () => {
expect(pagination.currentPage.getText()).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -195,7 +195,7 @@ describe('Pagination on Trash', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -209,7 +209,7 @@ describe('Pagination on Trash', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());