[ACA-1653] add testrail ids to e2e tests (#557)

* add testrail ids - WIP

* add TestRail ids to tooltips tests

* added more TestRail ids

* separate tests from Create folder to correct sub-suites

* add more TestRail ids to automated tests

* added more TestRail ids

* added more ids and some missing tests

* combined delete and undo delete tests and added TestRail ids

* decrease protractor timeouts to try and speed up the execution when tests fail

* disable some tests that are incomplete in order to match numbers from TestRail
This commit is contained in:
Adina Parpalita 2018-08-09 14:03:57 +03:00 committed by Denys Vuika
parent f91608fe78
commit b8cc5422f4
29 changed files with 953 additions and 1072 deletions

View File

@ -64,16 +64,6 @@ describe('Create folder', () => {
.then(done); .then(done);
}); });
beforeEach(done => {
personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => dataTable.waitForHeader())
.then(done);
});
afterEach(done => {
browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
});
afterAll(done => { afterAll(done => {
Promise Promise
.all([ .all([
@ -84,195 +74,217 @@ describe('Create folder', () => {
.then(done); .then(done);
}); });
it('option is enabled when having enough permissions', () => { describe('on Personal Files', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent) beforeEach(done => {
.then(() => personalFilesPage.sidenav.openNewMenu()) personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(menu => { .then(() => dataTable.waitForHeader())
const isEnabled = menu.getItemByLabel('Create folder').isEnabled(); .then(done);
expect(isEnabled).toBe(true, 'Create folder is not enabled'); });
});
afterEach(done => {
browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
});
it('option is enabled when having enough permissions - [C216339]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openNewMenu())
.then(menu => {
const isEnabled = menu.getItemByLabel('Create folder').isEnabled();
expect(isEnabled).toBe(true, 'Create folder is not enabled');
});
});
it('creates new folder with name - [C216341]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(folderName1))
.then(() => createDialog.clickCreate())
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.then(() => {
const isPresent = dataTable.getRowByName(folderName1).isPresent();
expect(isPresent).toBe(true, 'Folder not displayed in list view');
});
});
it('creates new folder with name and description - [C216340]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(folderName2))
.then(() => createDialog.enterDescription(folderDescription))
.then(() => createDialog.clickCreate())
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.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 - [C216342]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openNewMenu())
.then(menu => browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform()
.then(() => menu))
.then(menu => {
expect(menu.getItemTooltip('Create folder')).toContain('Create new folder');
});
});
it('dialog UI elements - [C216345]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => {
const dialogTitle = createDialog.getTitle();
const isFolderNameDisplayed = createDialog.nameInput.isDisplayed();
const isDescriptionDisplayed = createDialog.descriptionTextArea.isDisplayed();
const isCreateEnabled = createDialog.createButton.isEnabled();
const isCancelEnabled = createDialog.cancelButton.isEnabled();
expect(dialogTitle).toMatch('Create new folder');
expect(isFolderNameDisplayed).toBe(true, 'Name input is not displayed');
expect(isDescriptionDisplayed).toBe(true, 'Description field is not displayed');
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
expect(isCancelEnabled).toBe(true, 'Cancel button is not enabled');
});
});
it('with empty folder name - [C216346]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.deleteNameWithBackspace())
.then(() => {
const isCreateEnabled = createDialog.createButton.isEnabled();
const validationMessage = createDialog.getValidationMessage();
expect(isCreateEnabled).toBe(false, 'Create button is enabled');
expect(validationMessage).toMatch('Folder name is required');
});
});
it('with folder name ending with a dot "." - [C216348]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName('folder-name.'))
.then(() => {
const isCreateEnabled = createDialog.createButton.isEnabled();
const validationMessage = createDialog.getValidationMessage();
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
expect(validationMessage).toMatch(`Folder name can't end with a period .`);
});
});
it('with folder name containing special characters - [C216347]', () => {
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => namesWithSpecialChars.forEach(name => {
createDialog.enterName(name);
const isCreateEnabled = createDialog.createButton.isEnabled();
const validationMessage = createDialog.getValidationMessage();
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
expect(validationMessage).toContain(`Folder name can't contain these characters`);
}));
});
it('with folder name containing only spaces - [C280406]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(' '))
.then(() => {
const isCreateEnabled = createDialog.createButton.isEnabled();
const validationMessage = createDialog.getValidationMessage();
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
expect(validationMessage).toMatch(`Folder name can't contain only spaces`);
});
});
it('cancel folder creation - [C216349]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName('test'))
.then(() => createDialog.enterDescription('test description'))
.then(() => createDialog.clickCancel())
.then(() => {
expect(createDialog.component.isPresent()).not.toBe(true, 'dialog is not closed');
});
});
it('duplicate folder name - [C216350]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(duplicateFolderName))
.then(() => createDialog.clickCreate())
.then(() => personalFilesPage.getSnackBarMessage())
.then(message => {
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
expect(createDialog.component.isPresent()).toBe(true, 'dialog is not present');
});
});
it('trim ending spaces from folder name - [C216351]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(nameWithSpaces))
.then(() => createDialog.clickCreate())
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.then(() => {
const isPresent = dataTable.getRowByName(nameWithSpaces.trim()).isPresent();
expect(isPresent).toBe(true, 'Folder not displayed in list view');
});
});
}); });
it('creates new folder with name', () => { describe('on File Libraries', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(folderName1))
.then(() => createDialog.clickCreate())
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.then(() => {
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.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(folderName2))
.then(() => createDialog.enterDescription(folderDescription))
.then(() => createDialog.clickCreate())
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.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.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openNewMenu())
.then(menu => browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform()
.then(() => menu))
.then(menu => {
expect(menu.getItemTooltip('Create folder')).toContain('Create new folder');
});
});
it('option is disabled when not enough permissions', () => {
const fileLibrariesPage = new BrowsingPage(); const fileLibrariesPage = new BrowsingPage();
fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) beforeEach(done => {
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName)) fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1)) .then(() => dataTable.waitForHeader())
.then(() => fileLibrariesPage.sidenav.openNewMenu()) .then(done);
.then(menu => { });
const isEnabled = menu.getItemByLabel('Create folder').isEnabled();
expect(isEnabled).toBe(false, 'Create folder is not disabled'); afterEach(done => {
}); browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
});
it('option is disabled when not enough permissions - [C280397]', () => {
fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName)
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1))
.then(() => fileLibrariesPage.sidenav.openNewMenu())
.then(menu => {
const isEnabled = menu.getItemByLabel('Create folder').isEnabled();
expect(isEnabled).toBe(false, 'Create folder is not disabled');
});
});
it('disabled option tooltip - [C280398]', () => {
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))
.then(menu => {
const tooltip = menu.getItemTooltip('Create folder');
expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items.`);
});
});
}); });
it('disabled option tooltip', () => { xit('');
const fileLibrariesPage = new BrowsingPage();
fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.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))
.then(menu => {
const tooltip = menu.getItemTooltip('Create folder');
expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items.`);
});
});
it('dialog UI elements', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => {
const dialogTitle = createDialog.getTitle();
const isFolderNameDisplayed = createDialog.nameInput.isDisplayed();
const isDescriptionDisplayed = createDialog.descriptionTextArea.isDisplayed();
const isCreateEnabled = createDialog.createButton.isEnabled();
const isCancelEnabled = createDialog.cancelButton.isEnabled();
expect(dialogTitle).toMatch('Create new folder');
expect(isFolderNameDisplayed).toBe(true, 'Name input is not displayed');
expect(isDescriptionDisplayed).toBe(true, 'Description field is not displayed');
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
expect(isCancelEnabled).toBe(true, 'Cancel button is not enabled');
});
});
it('with empty folder name', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.deleteNameWithBackspace())
.then(() => {
const isCreateEnabled = createDialog.createButton.isEnabled();
const validationMessage = createDialog.getValidationMessage();
expect(isCreateEnabled).toBe(false, 'Create button is enabled');
expect(validationMessage).toMatch('Folder name is required');
});
});
it('with folder name ending with a dot "."', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName('folder-name.'))
.then(() => {
const isCreateEnabled = createDialog.createButton.isEnabled();
const validationMessage = createDialog.getValidationMessage();
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
expect(validationMessage).toMatch(`Folder name can't end with a period .`);
});
});
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.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => namesWithSpecialChars.forEach(name => {
createDialog.enterName(name);
const isCreateEnabled = createDialog.createButton.isEnabled();
const validationMessage = createDialog.getValidationMessage();
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
expect(validationMessage).toContain(`Folder name can't contain these characters`);
}));
});
it('with folder name containing only spaces', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(' '))
.then(() => {
const isCreateEnabled = createDialog.createButton.isEnabled();
const validationMessage = createDialog.getValidationMessage();
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
expect(validationMessage).toMatch(`Folder name can't contain only spaces`);
});
});
it('cancel folder creation', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName('test'))
.then(() => createDialog.enterDescription('test description'))
.then(() => createDialog.clickCancel())
.then(() => {
expect(createDialog.component.isPresent()).not.toBe(true, 'dialog is not closed');
});
});
it('duplicate folder name', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(duplicateFolderName))
.then(() => createDialog.clickCreate())
.then(() => personalFilesPage.getSnackBarMessage())
.then(message => {
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
expect(createDialog.component.isPresent()).toBe(true, 'dialog is not present');
});
});
it('trim ending spaces from folder name', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
.then(() => personalFilesPage.sidenav.openCreateDialog())
.then(() => createDialog.waitForDialogToOpen())
.then(() => createDialog.enterName(nameWithSpaces))
.then(() => createDialog.clickCreate())
.then(() => createDialog.waitForDialogToClose())
.then(() => dataTable.waitForHeader())
.then(() => {
const isPresent = dataTable.getRowByName(nameWithSpaces.trim()).isPresent();
expect(isPresent).toBe(true, 'Folder not displayed in list view');
});
});
}); });

View File

@ -29,7 +29,7 @@ import { SIDEBAR_LABELS } from '../../configs';
import { RepoClient } from '../../utilities/repo-client/repo-client'; import { RepoClient } from '../../utilities/repo-client/repo-client';
import { Utils } from '../../utilities/utils'; import { Utils } from '../../utilities/utils';
describe('Delete content', () => { describe('Delete and undo delete', () => {
const username = `user-${Utils.random()}`; const username = `user-${Utils.random()}`;
const apis = { const apis = {
@ -94,10 +94,11 @@ describe('Delete content', () => {
.then(() => apis.user.nodes.unlockFile(fileLocked1Id)) .then(() => apis.user.nodes.unlockFile(fileLocked1Id))
.then(() => apis.user.nodes.deleteNodesById([file1Id, file2Id, folder1Id, folder2Id, fileLocked1Id])) .then(() => apis.user.nodes.deleteNodesById([file1Id, file2Id, folder1Id, folder2Id, fileLocked1Id]))
]) ])
.then(() => apis.user.search.waitForApi(username, {expect: 0}))
.then(done); .then(done);
}); });
it('delete a file and check notification', () => { it('delete a file and check notification - [C217125]', () => {
let items: number; let items: number;
page.dataTable.countRows().then(number => { items = number; }); page.dataTable.countRows().then(number => { items = number; });
@ -117,7 +118,7 @@ describe('Delete content', () => {
.then(() => apis.user.trashcan.restore(file1Id)); .then(() => apis.user.trashcan.restore(file1Id));
}); });
it('delete multiple files and check notification', () => { it('delete multiple files and check notification - [C280502]', () => {
let items: number; let items: number;
page.dataTable.countRows().then(number => { items = number; }); page.dataTable.countRows().then(number => { items = number; });
@ -142,7 +143,7 @@ describe('Delete content', () => {
.then(() => apis.user.trashcan.restore(file2Id)); .then(() => apis.user.trashcan.restore(file2Id));
}); });
it('delete a folder with content', () => { it('delete a folder with content - [C217126]', () => {
let items: number; let items: number;
page.dataTable.countRows().then(number => { items = number; }); page.dataTable.countRows().then(number => { items = number; });
@ -163,7 +164,7 @@ describe('Delete content', () => {
.then(() => apis.user.trashcan.restore(folder1Id)); .then(() => apis.user.trashcan.restore(folder1Id));
}); });
it('delete a folder containing locked files', () => { it('delete a folder containing locked files - [C217127]', () => {
dataTable.clickOnRowByName(folder2) dataTable.clickOnRowByName(folder2)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -179,7 +180,7 @@ describe('Delete content', () => {
}); });
}); });
it('notification on multiple items deletion - some items fail to delete', () => { it('notification on multiple items deletion - some items fail to delete - [C217129]', () => {
dataTable.selectMultipleItems([file1, folder2]) dataTable.selectMultipleItems([file1, folder2])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -189,27 +190,97 @@ describe('Delete content', () => {
.then(() => apis.user.trashcan.restore(file1Id)); .then(() => apis.user.trashcan.restore(file1Id));
}); });
// TODO: needs to operate on two folders containing locked items it('notification on multiple items deletion - all items fail to delete - [C217130]', () => {
xit('Notification on multiple items deletion - all items fail to delete', () => {
dataTable.selectMultipleItems([fileLocked1, folder2]) dataTable.selectMultipleItems([fileLocked1, folder2])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
.then(message => expect(message).toEqual(`2 items couldn't be deleted`)); .then(message => expect(message).toEqual(`2 items couldn't be deleted`));
}); });
it('successful delete notification shows Undo action - [C217131]', () => {
dataTable.clickOnRowByName(file1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`Undo`);
})
.then(() => apis.user.trashcan.restore(file1Id));
});
it('unsuccessful delete notification does not show Undo action - [C217134]', () => {
dataTable.clickOnRowByName(folder2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).not.toContain(`Undo`);
});
});
it('undo delete of file - [C217132]', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(file1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(file1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
it('undo delete of folder with content - [C280503]', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(folder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(folder1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => dataTable.doubleClickOnRowByName(folder1))
.then(() => {
expect(dataTable.getRowByName(file3).isPresent()).toBe(true, 'file from folder not restored');
});
});
it('undo delete of multiple files - [C280504]', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.selectMultipleItems([file1, file2])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(file1).isPresent()).toBe(true, `${file1} was not removed from list`);
expect(dataTable.getRowByName(file2).isPresent()).toBe(true, `${file2} was not removed from list`);
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
}); });
describe('on Shared Files', () => { describe('on Shared Files', () => {
const sharedFile1 = `sharedFile1-${Utils.random()}.txt`; let sharedFile1Id; const sharedFile1 = `sharedFile1-${Utils.random()}.txt`; let sharedFile1Id;
const sharedFile2 = `sharedFile2-${Utils.random()}.txt`; let sharedFile2Id; const sharedFile2 = `sharedFile2-${Utils.random()}.txt`; let sharedFile2Id;
const sharedFile3 = `sharedFile3-${Utils.random()}.txt`; let sharedFile3Id; const sharedFile3 = `sharedFile3-${Utils.random()}.txt`; let sharedFile3Id;
const sharedFile4 = `sharedFile4-${Utils.random()}.txt`; let sharedFile4Id;
beforeAll(done => { beforeAll(done => {
apis.user.nodes.createFile(sharedFile1).then(resp => sharedFile1Id = resp.data.entry.id) apis.user.nodes.createFile(sharedFile1).then(resp => sharedFile1Id = resp.data.entry.id)
.then(() => apis.user.nodes.createFile(sharedFile2).then(resp => sharedFile2Id = resp.data.entry.id)) .then(() => apis.user.nodes.createFile(sharedFile2).then(resp => sharedFile2Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(sharedFile3).then(resp => sharedFile3Id = resp.data.entry.id)) .then(() => apis.user.nodes.createFile(sharedFile3).then(resp => sharedFile3Id = resp.data.entry.id))
.then(() => apis.user.shared.shareFilesByIds([sharedFile1Id, sharedFile2Id, sharedFile3Id])) .then(() => apis.user.nodes.createFile(sharedFile4).then(resp => sharedFile4Id = resp.data.entry.id))
.then(() => apis.user.shared.waitForApi({ expect: 3 })) .then(() => apis.user.shared.shareFilesByIds([sharedFile1Id, sharedFile2Id, sharedFile3Id, sharedFile4Id]))
.then(() => apis.user.shared.waitForApi({ expect: 4 }))
.then(() => loginPage.loginWith(username)) .then(() => loginPage.loginWith(username))
.then(done); .then(done);
@ -228,12 +299,13 @@ describe('Delete content', () => {
afterAll(done => { afterAll(done => {
Promise.all([ Promise.all([
logoutPage.load(), logoutPage.load(),
apis.user.nodes.deleteNodesById([sharedFile1Id, sharedFile2Id, sharedFile3Id]) apis.user.nodes.deleteNodesById([sharedFile1Id, sharedFile2Id, sharedFile3Id, sharedFile4Id])
]) ])
.then(() => apis.user.search.waitForApi(username, {expect: 0}))
.then(done); .then(done);
}); });
it('delete a file and check notification', () => { it('delete a file and check notification - [C280316]', () => {
dataTable.clickOnRowByName(sharedFile1) dataTable.clickOnRowByName(sharedFile1)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -245,10 +317,12 @@ describe('Delete content', () => {
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)) .then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => expect(dataTable.getRowByName(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)); .then(() => apis.user.trashcan.restore(sharedFile1Id))
.then(() => apis.user.shared.shareFilesByIds([ sharedFile1Id ]))
.then(() => apis.user.shared.waitForApi({ expect: 4 }));
}); });
it('delete multiple files and check notification', () => { it('delete multiple files and check notification - [C280513]', () => {
dataTable.selectMultipleItems([sharedFile2, sharedFile3]) dataTable.selectMultipleItems([sharedFile2, sharedFile3])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -265,7 +339,40 @@ describe('Delete content', () => {
}) })
.then(() => apis.user.trashcan.restore(sharedFile2Id)) .then(() => apis.user.trashcan.restore(sharedFile2Id))
.then(() => apis.user.trashcan.restore(sharedFile3Id)); .then(() => apis.user.trashcan.restore(sharedFile3Id))
.then(() => apis.user.shared.shareFilesByIds([ sharedFile2Id, sharedFile3Id ]))
.then(() => apis.user.shared.waitForApi({ expect: 4 }));
});
it('successful delete notification shows Undo action - [C280323]', () => {
dataTable.clickOnRowByName(sharedFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => expect(message).toContain(`Undo`))
.then(() => apis.user.trashcan.restore(sharedFile1Id));
});
it('undo delete of file - [C280324]', () => {
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.getRowByName(sharedFile2).isPresent()).toBe(false, 'Item was not restored'));
});
it('undo delete of multiple files - [C280514]', () => {
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.getRowByName(sharedFile3).isPresent()).toBe(false, `${sharedFile3} was not restored`);
expect(dataTable.getRowByName(sharedFile4).isPresent()).toBe(false, `${sharedFile4} was not restored`);
});
}); });
}); });
@ -317,10 +424,11 @@ describe('Delete content', () => {
favoriteFile1Id, favoriteFile2Id, favoriteFolder1Id, favoriteFolder2Id, favoriteFileLocked1Id favoriteFile1Id, favoriteFile2Id, favoriteFolder1Id, favoriteFolder2Id, favoriteFileLocked1Id
])) ]))
]) ])
.then(() => apis.user.search.waitForApi(username, {expect: 0}))
.then(done); .then(done);
}); });
it('delete a file and check notification', () => { it('delete a file and check notification - [C280516]', () => {
let items: number; let items: number;
page.dataTable.countRows().then(number => { items = number; }); page.dataTable.countRows().then(number => { items = number; });
@ -340,7 +448,7 @@ describe('Delete content', () => {
.then(() => apis.user.trashcan.restore(favoriteFile1Id)); .then(() => apis.user.trashcan.restore(favoriteFile1Id));
}); });
it('delete multiple files and check notification', () => { it('delete multiple files and check notification - [C280517]', () => {
let items: number; let items: number;
page.dataTable.countRows().then(number => { items = number; }); page.dataTable.countRows().then(number => { items = number; });
@ -365,7 +473,7 @@ describe('Delete content', () => {
.then(() => apis.user.trashcan.restore(favoriteFile2Id)); .then(() => apis.user.trashcan.restore(favoriteFile2Id));
}); });
it('delete a folder with content', () => { it('delete a folder with content - [C280518]', () => {
let items: number; let items: number;
page.dataTable.countRows().then(number => { items = number; }); page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(favoriteFolder1) dataTable.clickOnRowByName(favoriteFolder1)
@ -385,7 +493,7 @@ describe('Delete content', () => {
.then(() => apis.user.trashcan.restore(favoriteFolder1Id)); .then(() => apis.user.trashcan.restore(favoriteFolder1Id));
}); });
it('delete a folder containing locked files', () => { it('delete a folder containing locked files - [C280519]', () => {
dataTable.clickOnRowByName(favoriteFolder2) dataTable.clickOnRowByName(favoriteFolder2)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -401,7 +509,7 @@ describe('Delete content', () => {
}); });
}); });
it('notification on multiple items deletion - some items fail to delete', () => { it('notification on multiple items deletion - some items fail to delete - [C280520]', () => {
dataTable.selectMultipleItems([favoriteFile1, favoriteFolder2]) dataTable.selectMultipleItems([favoriteFile1, favoriteFolder2])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -413,7 +521,7 @@ describe('Delete content', () => {
.then(() => apis.user.trashcan.restore(favoriteFile1Id)); .then(() => apis.user.trashcan.restore(favoriteFile1Id));
}); });
it('Notification on multiple items deletion - all items fail to delete', () => { it('notification on multiple items deletion - all items fail to delete - [C280521]', () => {
dataTable.selectMultipleItems([favoriteFileLocked1, favoriteFolder2]) dataTable.selectMultipleItems([favoriteFileLocked1, favoriteFolder2])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -422,18 +530,84 @@ describe('Delete content', () => {
expect(message).toEqual(`2 items couldn't be deleted`); expect(message).toEqual(`2 items couldn't be deleted`);
}); });
}); });
it('successful delete notification shows Undo action - [C280522]', () => {
dataTable.clickOnRowByName(favoriteFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => expect(message).toContain(`Undo`))
.then(() => apis.user.trashcan.restore(favoriteFile1Id));
});
it('unsuccessful delete notification does not show Undo action - [C280523]', () => {
dataTable.clickOnRowByName(favoriteFolder2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => expect(message).not.toContain(`Undo`));
});
it('undo delete of file - [C280524]', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(favoriteFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
it('undo delete of folder with content - [C280526]', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(favoriteFolder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => dataTable.doubleClickOnRowByName(favoriteFolder1))
.then(() => expect(dataTable.getRowByName(favoriteFile3).isPresent()).toBe(true, 'file from folder not restored'));
});
it('undo delete of multiple files - [C280525]', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.selectMultipleItems([favoriteFile1, favoriteFile2])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
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}`);
});
});
}); });
describe('on Recent Files', () => { // TODO: try to change search.waitForApi to wait for exact number of items
xdescribe('on Recent Files', () => {
const recentFile1 = `recentFile1-${Utils.random()}.txt`; let recentFile1Id; const recentFile1 = `recentFile1-${Utils.random()}.txt`; let recentFile1Id;
const recentFile2 = `recentFile2-${Utils.random()}.txt`; let recentFile2Id; const recentFile2 = `recentFile2-${Utils.random()}.txt`; let recentFile2Id;
const recentFile3 = `recentFile3-${Utils.random()}.txt`; let recentFile3Id; const recentFile3 = `recentFile3-${Utils.random()}.txt`; let recentFile3Id;
const recentFile4 = `recentFile4-${Utils.random()}.txt`; let recentFile4Id;
beforeAll(done => { beforeAll(done => {
apis.user.nodes.createFile(recentFile1).then(resp => recentFile1Id = resp.data.entry.id) apis.user.nodes.createFile(recentFile1).then(resp => recentFile1Id = resp.data.entry.id)
.then(() => apis.user.nodes.createFile(recentFile2).then(resp => recentFile2Id = resp.data.entry.id)) .then(() => apis.user.nodes.createFile(recentFile2).then(resp => recentFile2Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(recentFile3).then(resp => recentFile3Id = resp.data.entry.id)) .then(() => apis.user.nodes.createFile(recentFile3).then(resp => recentFile3Id = resp.data.entry.id))
.then(() => apis.user.search.waitForApi(username, { expect: 3 })) .then(() => apis.user.nodes.createFile(recentFile4).then(resp => recentFile4Id = resp.data.entry.id))
.then(() => apis.user.search.waitForApi(username, { expect: 4 }))
.then(() => loginPage.loginWith(username)) .then(() => loginPage.loginWith(username))
@ -461,12 +635,12 @@ describe('Delete content', () => {
afterAll(done => { afterAll(done => {
Promise.all([ Promise.all([
logoutPage.load(), logoutPage.load(),
apis.user.nodes.deleteNodesById([recentFile1Id, recentFile2Id, recentFile3Id]) apis.user.nodes.deleteNodesById([recentFile1Id, recentFile2Id, recentFile3Id, recentFile4Id])
]) ])
.then(done); .then(done);
}); });
xit('delete a file and check notification', () => { it('delete a file and check notification - [C280528]', () => {
dataTable.clickOnRowByName(recentFile1) dataTable.clickOnRowByName(recentFile1)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -478,10 +652,11 @@ describe('Delete content', () => {
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)) .then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => expect(dataTable.getRowByName(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)); .then(() => apis.user.trashcan.restore(recentFile1Id))
.then(() => apis.user.search.waitForApi(username, { expect: 4 }));
}); });
xit('delete multiple files and check notification', () => { it('delete multiple files and check notification - [C280529]', () => {
dataTable.selectMultipleItems([recentFile2, recentFile3]) dataTable.selectMultipleItems([recentFile2, recentFile3])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete')) .then(() => toolbar.actions.menu.clickMenuItem('Delete'))
@ -498,7 +673,48 @@ describe('Delete content', () => {
}) })
.then(() => apis.user.trashcan.restore(recentFile2Id)) .then(() => apis.user.trashcan.restore(recentFile2Id))
.then(() => apis.user.trashcan.restore(recentFile3Id)); .then(() => apis.user.trashcan.restore(recentFile3Id))
.then(() => apis.user.search.waitForApi(username, { expect: 4 }));
});
it('successful delete notification shows Undo action - [C280534]', () => {
dataTable.clickOnRowByName(recentFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => expect(message).toContain(`Undo`))
.then(() => apis.user.trashcan.restore(recentFile1Id))
.then(() => apis.user.search.waitForApi(username, { expect: 4 }));
});
// due to the fact that the search api is slow to update,
// we cannot test that the restored file is displayed in the Recent Files list
// without adding a very big browser.sleep followed by a page.refresh
// so for the moment we're testing that the restored file is not displayed in the Trash
it('undo delete of file - [C280536]', () => {
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.getRowByName(recentFile2).isPresent()).toBe(false, 'Item is in Trash'));
});
// due to the fact that the search api is slow to update,
// we cannot test that the restored file is displayed in the Recent Files list
// without adding a very big browser.sleep followed by a page.refresh
// so for the moment we're testing that the restored file is not displayed in the Trash
it('undo delete of multiple files - [C280537]', () => {
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.getRowByName(recentFile3).isPresent()).toBe(false, `${recentFile3} is in Trash`);
expect(dataTable.getRowByName(recentFile4).isPresent()).toBe(false, `${recentFile4} is in Trash`);
});
}); });
}); });
}); });

View File

@ -93,7 +93,7 @@ describe('Edit folder', () => {
.then(done); .then(done);
}); });
it('dialog UI defaults', () => { it('dialog UI defaults - [C216331]', () => {
dataTable.clickOnRowByName(folderName) dataTable.clickOnRowByName(folderName)
.then(() => editButton.click()) .then(() => editButton.click())
.then(() => { .then(() => {
@ -105,7 +105,7 @@ describe('Edit folder', () => {
}); });
}); });
it('properties are modified when pressing OK', () => { it('properties are modified when pressing OK - [C216335]', () => {
dataTable.clickOnRowByName(folderNameToEdit) dataTable.clickOnRowByName(folderNameToEdit)
.then(() => editButton.click()) .then(() => editButton.click())
.then(() => editDialog.waitForDialogToOpen()) .then(() => editDialog.waitForDialogToOpen())
@ -119,7 +119,7 @@ describe('Edit folder', () => {
.then(desc => expect(desc).toEqual(folderDescriptionEdited)); .then(desc => expect(desc).toEqual(folderDescriptionEdited));
}); });
it('with empty folder name', () => { it('with empty folder name - [C216332]', () => {
dataTable.clickOnRowByName(folderName) dataTable.clickOnRowByName(folderName)
.then(() => editButton.click()) .then(() => editButton.click())
.then(() => editDialog.deleteNameWithBackspace()) .then(() => editDialog.deleteNameWithBackspace())
@ -129,7 +129,7 @@ describe('Edit folder', () => {
}); });
}); });
it('with name with special characters', () => { it('with name with special characters - [C216333]', () => {
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ]; const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
dataTable.clickOnRowByName(folderName) dataTable.clickOnRowByName(folderName)
@ -142,7 +142,7 @@ describe('Edit folder', () => {
})); }));
}); });
it('with name ending with a dot', () => { it('with name ending with a dot - [C216334]', () => {
dataTable.clickOnRowByName(folderName) dataTable.clickOnRowByName(folderName)
.then(() => editButton.click()) .then(() => editButton.click())
.then(() => editDialog.nameInput.sendKeys('.')) .then(() => editDialog.nameInput.sendKeys('.'))
@ -152,7 +152,7 @@ describe('Edit folder', () => {
}); });
}); });
it('Cancel button', () => { it('Cancel button - [C216336]', () => {
dataTable.clickOnRowByName(folderName) dataTable.clickOnRowByName(folderName)
.then(() => editButton.click()) .then(() => editButton.click())
.then(() => editDialog.clickCancel()) .then(() => editDialog.clickCancel())
@ -161,7 +161,7 @@ describe('Edit folder', () => {
}); });
}); });
it('with duplicate folder name', () => { it('with duplicate folder name - [C216337]', () => {
dataTable.clickOnRowByName(folderName) dataTable.clickOnRowByName(folderName)
.then(() => editButton.click()) .then(() => editButton.click())
.then(() => editDialog.enterName(duplicateFolderName)) .then(() => editDialog.enterName(duplicateFolderName))
@ -173,7 +173,7 @@ describe('Edit folder', () => {
}); });
}); });
it('trim ending spaces', () => { it('trim ending spaces - [C216338]', () => {
dataTable.clickOnRowByName(folderName) dataTable.clickOnRowByName(folderName)
.then(() => editButton.click()) .then(() => editButton.click())
.then(() => editDialog.nameInput.sendKeys(' ')) .then(() => editDialog.nameInput.sendKeys(' '))

View File

@ -89,25 +89,25 @@ describe('Mark items as favorites', () => {
toolbar.actions.closeMoreMenu().then(done); toolbar.actions.closeMoreMenu().then(done);
}); });
it('Favorite action has empty star icon for an item not marked as favorite', () => { it('Favorite action has empty star icon for an item not marked as favorite - [C217186]', () => {
dataTable.clickOnRowByName(file1NotFav) dataTable.clickOnRowByName(file1NotFav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border')); .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', () => { it('Favorite action has empty star icon for multiple selection of items when some are not favorite - [C217187]', () => {
dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border')); .then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border'));
}); });
it('Favorite action has full star icon for items marked as favorite', () => { it('Favorite action has full star icon for items marked as favorite - [C217188]', () => {
dataTable.clickOnRowByName(file3Fav) dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star')); .then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star'));
}); });
it('favorite a file', () => { it('favorite a file - [C217189]', () => {
dataTable.clickOnRowByName(file1NotFav) dataTable.clickOnRowByName(file1NotFav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -118,7 +118,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file1Id)); .then(() => apis.user.favorites.removeFavoriteById(file1Id));
}); });
it('favorite a folder', () => { it('favorite a folder - [C280390]', () => {
dataTable.clickOnRowByName(folder1) dataTable.clickOnRowByName(folder1)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -129,7 +129,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(folder1Id)); .then(() => apis.user.favorites.removeFavoriteById(folder1Id));
}); });
it('unfavorite an item', () => { it('unfavorite an item - [C217190]', () => {
dataTable.clickOnRowByName(file3Fav) dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -140,7 +140,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.addFavoriteById('file', file3Id)); .then(() => apis.user.favorites.addFavoriteById('file', file3Id));
}); });
it('favorite multiple items - all unfavorite', () => { it('favorite multiple items - all unfavorite - [C217192]', () => {
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -158,7 +158,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file2Id)); .then(() => apis.user.favorites.removeFavoriteById(file2Id));
}); });
it('favorite multiple items - some favorite and some unfavorite', () => { it('favorite multiple items - some favorite and some unfavorite - [C217194]', () => {
dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -175,7 +175,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file1Id)); .then(() => apis.user.favorites.removeFavoriteById(file1Id));
}); });
it('unfavorite multiple items', () => { it('unfavorite multiple items - [C217193]', () => {
dataTable.selectMultipleItems([ file3Fav, file4Fav ]) dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -205,7 +205,7 @@ describe('Mark items as favorites', () => {
toolbar.actions.closeMoreMenu().then(done); toolbar.actions.closeMoreMenu().then(done);
}); });
it('favorite a file', () => { it('favorite a file - [C280352]', () => {
dataTable.clickOnRowByName(file1NotFav) dataTable.clickOnRowByName(file1NotFav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -216,7 +216,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file1Id)); .then(() => apis.user.favorites.removeFavoriteById(file1Id));
}); });
it('unfavorite an item', () => { it('unfavorite an item - [C280353]', () => {
dataTable.clickOnRowByName(file3Fav) dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -227,7 +227,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.addFavoriteById('file', file3Id)); .then(() => apis.user.favorites.addFavoriteById('file', file3Id));
}); });
it('favorite multiple items - all unfavorite', () => { it('favorite multiple items - all unfavorite - [C280355]', () => {
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -245,7 +245,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file2Id)); .then(() => apis.user.favorites.removeFavoriteById(file2Id));
}); });
it('favorite multiple items - some favorite and some unfavorite', () => { it('favorite multiple items - some favorite and some unfavorite - [C280357]', () => {
dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -262,7 +262,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file1Id)); .then(() => apis.user.favorites.removeFavoriteById(file1Id));
}); });
it('unfavorite multiple items', () => { it('unfavorite multiple items - [C280356]', () => {
dataTable.selectMultipleItems([ file3Fav, file4Fav ]) dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -295,7 +295,7 @@ describe('Mark items as favorites', () => {
browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done); browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
}); });
it('favorite a file', () => { it('favorite a file - [C280362]', () => {
dataTable.clickOnRowByName(file1NotFav) dataTable.clickOnRowByName(file1NotFav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -306,7 +306,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file1Id)); .then(() => apis.user.favorites.removeFavoriteById(file1Id));
}); });
it('unfavorite an item', () => { it('unfavorite an item - [C280363]', () => {
dataTable.clickOnRowByName(file3Fav) dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -317,7 +317,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.addFavoriteById('file', file3Id)); .then(() => apis.user.favorites.addFavoriteById('file', file3Id));
}); });
it('favorite multiple items - all unfavorite', () => { it('favorite multiple items - all unfavorite - [C280365]', () => {
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -335,7 +335,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file2Id)); .then(() => apis.user.favorites.removeFavoriteById(file2Id));
}); });
it('favorite multiple items - some favorite and some unfavorite', () => { it('favorite multiple items - some favorite and some unfavorite - [C280367]', () => {
dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -352,7 +352,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.removeFavoriteById(file1Id)); .then(() => apis.user.favorites.removeFavoriteById(file1Id));
}); });
it('unfavorite multiple items', () => { it('unfavorite multiple items - [C280366]', () => {
dataTable.selectMultipleItems([ file3Fav, file4Fav ]) dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -382,7 +382,7 @@ describe('Mark items as favorites', () => {
page.refresh().then(done); page.refresh().then(done);
}); });
it('unfavorite an item', () => { it('unfavorite an item - [C280368]', () => {
dataTable.clickOnRowByName(file3Fav) dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -396,7 +396,7 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.addFavoriteById('file', file3Id)); .then(() => apis.user.favorites.addFavoriteById('file', file3Id));
}); });
it('unfavorite multiple items', () => { it('unfavorite multiple items - [C280374]', () => {
dataTable.selectMultipleItems([ file3Fav, file4Fav ]) dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
@ -415,6 +415,12 @@ describe('Mark items as favorites', () => {
.then(() => apis.user.favorites.addFavoriteById('file', file3Id)) .then(() => apis.user.favorites.addFavoriteById('file', file3Id))
.then(() => apis.user.favorites.addFavoriteById('file', file4Id)); .then(() => apis.user.favorites.addFavoriteById('file', file4Id));
}); });
it('Favorite action has full star icon for items marked as favorite - [C280371]', () => {
dataTable.clickOnRowByName(file3Fav)
.then(() => toolbar.actions.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star'));
});
}); });
}); });

View File

@ -77,7 +77,7 @@ describe('Permanently delete from Trash', () => {
.then(done); .then(done);
}); });
it('delete file [C217094] [C217091] [C217092]', () => { it('delete file - [C217091]', () => {
dataTable.clickOnRowByName(file1) dataTable.clickOnRowByName(file1)
.then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click())
.then(() => trashPage.waitForDialog()) .then(() => trashPage.waitForDialog())
@ -91,7 +91,7 @@ describe('Permanently delete from Trash', () => {
}); });
}); });
it('delete folder [C217091] [C217092]', () => { it('delete folder - [C280416]', () => {
dataTable.clickOnRowByName(folder1) dataTable.clickOnRowByName(folder1)
.then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click())
.then(() => trashPage.waitForDialog()) .then(() => trashPage.waitForDialog())
@ -105,7 +105,7 @@ describe('Permanently delete from Trash', () => {
}); });
}); });
it('delete multiple items [C217093]', () => { it('delete multiple items - [C280417]', () => {
dataTable.selectMultipleItems([ file2, folder2 ]) dataTable.selectMultipleItems([ file2, folder2 ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Permanently delete').click())
.then(() => trashPage.waitForDialog()) .then(() => trashPage.waitForDialog())

View File

@ -79,7 +79,7 @@ describe('Restore from Trash', () => {
apis.user.trashcan.emptyTrash().then(done); apis.user.trashcan.emptyTrash().then(done);
}); });
it('restore file', () => { it('restore file - [C217177]', () => {
dataTable.clickOnRowByName(file) dataTable.clickOnRowByName(file)
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
@ -97,7 +97,7 @@ describe('Restore from Trash', () => {
.then(() => apis.user.nodes.deleteNodeById(fileId, false)); .then(() => apis.user.nodes.deleteNodeById(fileId, false));
}); });
it('restore folder', () => { it('restore folder - [C280438]', () => {
dataTable.clickOnRowByName(folder) dataTable.clickOnRowByName(folder)
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
@ -115,7 +115,7 @@ describe('Restore from Trash', () => {
.then(() => apis.user.nodes.deleteNodeById(folderId, false)); .then(() => apis.user.nodes.deleteNodeById(folderId, false));
}); });
it('restore multiple items', () => { it('restore multiple items - [C217182]', () => {
dataTable.selectMultipleItems([ file, folder ]) dataTable.selectMultipleItems([ file, folder ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
@ -135,7 +135,7 @@ describe('Restore from Trash', () => {
.then(() => apis.user.nodes.deleteNodesById([ fileId, folderId ], false)); .then(() => apis.user.nodes.deleteNodesById([ fileId, folderId ], false));
}); });
it('View from notification', () => { it('View from notification - [C217181]', () => {
dataTable.clickOnRowByName(file) dataTable.clickOnRowByName(file)
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.clickSnackBarAction()) .then(() => page.clickSnackBarAction())
@ -184,7 +184,7 @@ describe('Restore from Trash', () => {
.then(done); .then(done);
}); });
it('Restore a file when another file with same name exists on the restore location', () => { it('Restore a file when another file with same name exists on the restore location - [C217178]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
.then(() => dataTable.clickOnRowByName(file1)) .then(() => dataTable.clickOnRowByName(file1))
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
@ -192,7 +192,7 @@ describe('Restore from Trash', () => {
.then(text => expect(text).toEqual(`Can't restore, ${file1} already exists`)); .then(text => expect(text).toEqual(`Can't restore, ${file1} already exists`));
}); });
it('Restore a file when original location no longer exists', () => { it('Restore a file when original location no longer exists - [C217179]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
.then(() => dataTable.clickOnRowByName(file2)) .then(() => dataTable.clickOnRowByName(file2))
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
@ -251,14 +251,14 @@ describe('Restore from Trash', () => {
.then(done); .then(done);
}); });
it('one failure', () => { it('one failure - [C217183]', () => {
dataTable.selectMultipleItems([ file1, file2 ]) dataTable.selectMultipleItems([ file1, file2 ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
.then(text => expect(text).toEqual(`Can't restore ${file1}, the original location no longer exists`)); .then(text => expect(text).toEqual(`Can't restore ${file1}, the original location no longer exists`));
}); });
it('multiple failures', () => { it('multiple failures - [C217184]', () => {
dataTable.selectMultipleItems([ file3, file4, file5 ]) dataTable.selectMultipleItems([ file3, file4, file5 ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())

View File

@ -116,7 +116,7 @@ describe('Toolbar actions - multiple selection : ', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('unselect selected items - single click', () => { it('Unselect items with single click - [C280458]', () => {
dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ]) dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ])
.then(() => expect(dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number')) .then(() => expect(dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number'))
.then(() => dataTable.clickOnRowByName(file1)) .then(() => dataTable.clickOnRowByName(file1))
@ -124,8 +124,13 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('unselect selected items - CMD+click', () => { it('Select / unselect selected items by CMD+click - [C217110]', () => {
dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ]) browser.actions().sendKeys(protractor.Key.COMMAND).perform()
.then(() => dataTable.clickOnRowByName(file1))
.then(() => dataTable.clickOnRowByName(file2))
.then(() => dataTable.clickOnRowByName(folder1))
.then(() => dataTable.clickOnRowByName(folder2))
.then(() => browser.actions().sendKeys(protractor.Key.NULL).perform())
.then(() => expect(dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number')) .then(() => expect(dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number'))
.then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform()) .then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform())
.then(() => dataTable.clickOnRowByName(file1)) .then(() => dataTable.clickOnRowByName(file1))
@ -135,8 +140,13 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when multiple files are selected', () => { it('correct actions appear when multiple files are selected - [C217112]', () => {
dataTable.selectMultipleItems([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');
expect(toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
})
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(menu => { .then(menu => {
expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
@ -148,8 +158,13 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when multiple folders are selected', () => { it('correct actions appear when multiple folders are selected - [C280459]', () => {
dataTable.selectMultipleItems([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');
expect(toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
})
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(menu => { .then(menu => {
expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
@ -161,50 +176,13 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('should not display View action when multiple entries selected', async () => { it('correct actions appear when both files and folders are selected - [C280460]', () => {
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.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.selectMultipleItems([folder1, folder2]);
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'Action is displayed');
});
it('should display Download action for selected items', async () => {
await dataTable.selectMultipleItems([folder1, file1, folder2]);
expect(toolbar.actions.isButtonPresent('Download')).toBe(true, 'Action is not displayed');
});
it('should not display Download action for empty selection', async () => {
await dataTable.selectMultipleItems([folder1, file1, folder2]);
await dataTable.clearSelection();
expect(toolbar.actions.isButtonPresent('Download')).toBe(false, 'Action is displayed');
});
it('should display Edit action when single folder selected', async () => {
await dataTable.selectMultipleItems([folder1]);
expect(toolbar.actions.isButtonPresent('Edit')).toBe(true, 'Action is not displayed');
});
it('should not display Edit action when multiple folders selected', async () => {
await dataTable.selectMultipleItems([folder1, file1, folder2]);
expect(toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Action is displayed');
});
it('should not display Edit action if no folders selected', async () => {
await dataTable.selectMultipleItems([file1, file2]);
expect(toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Action is displayed');
});
it('correct actions appear when both files and folders are selected', () => {
dataTable.selectMultipleItems([file1, file2, folder1, folder2]) dataTable.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');
expect(toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
})
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.actions.openMoreMenu())
.then(menu => { .then(menu => {
expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
@ -251,7 +229,7 @@ describe('Toolbar actions - multiple selection : ', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('correct actions appear when multiple files are selected', () => { it('correct actions appear when multiple files are selected - [C280461]', () => {
dataTable.selectMultipleItems([file1Admin, file2Admin]) dataTable.selectMultipleItems([file1Admin, file2Admin])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files');
@ -270,7 +248,7 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when multiple folders are selected', () => { it('correct actions appear when multiple folders are selected - [C280462]', () => {
dataTable.selectMultipleItems([folder1Admin, folder2Admin]) dataTable.selectMultipleItems([folder1Admin, folder2Admin])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -289,7 +267,7 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when both files and folders are selected', () => { it('correct actions appear when both files and folders are selected - [C280463]', () => {
dataTable.selectMultipleItems([file1Admin, file2Admin, folder1Admin, folder2Admin]) dataTable.selectMultipleItems([file1Admin, file2Admin, folder1Admin, folder2Admin])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -318,7 +296,7 @@ describe('Toolbar actions - multiple selection : ', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('correct actions appear when multiple files are selected', () => { it('correct actions appear when multiple files are selected - [C280464]', () => {
dataTable.selectMultipleItems([file1Admin, file2Admin]) dataTable.selectMultipleItems([file1Admin, file2Admin])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files');
@ -337,7 +315,7 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when multiple folders are selected', () => { it('correct actions appear when multiple folders are selected - [C280465]', () => {
dataTable.selectMultipleItems([folder1Admin, folder2Admin]) dataTable.selectMultipleItems([folder1Admin, folder2Admin])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -356,7 +334,7 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when both files and folders are selected', () => { it('correct actions appear when both files and folders are selected - [C280466]', () => {
dataTable.selectMultipleItems([file1Admin, file2Admin, folder1Admin, folder2Admin]) dataTable.selectMultipleItems([file1Admin, file2Admin, folder1Admin, folder2Admin])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -392,7 +370,7 @@ describe('Toolbar actions - multiple selection : ', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('correct actions appear when multiple files are selected', () => { it('correct actions appear when multiple files are selected - [C280467]', () => {
dataTable.selectMultipleItems([file1, file2]) dataTable.selectMultipleItems([file1, file2])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -426,7 +404,7 @@ describe('Toolbar actions - multiple selection : ', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('correct actions appear when multiple files are selected', () => { it('correct actions appear when multiple files are selected - [C280468]', () => {
dataTable.selectMultipleItems([file1, file2]) dataTable.selectMultipleItems([file1, file2])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -461,7 +439,7 @@ describe('Toolbar actions - multiple selection : ', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('correct actions appear when multiple files are selected', () => { it('correct actions appear when multiple files are selected - [C280469]', () => {
dataTable.selectMultipleItems([file1, file2]) dataTable.selectMultipleItems([file1, file2])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -480,7 +458,7 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when multiple folders are selected', () => { it('correct actions appear when multiple folders are selected - [C280470]', () => {
dataTable.selectMultipleItems([folder1, folder2]) dataTable.selectMultipleItems([folder1, folder2])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -499,7 +477,7 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when both files and folders are selected', () => { it('correct actions appear when both files and folders are selected - [C280471]', () => {
dataTable.selectMultipleItems([file1, file2, folder1, folder2]) dataTable.selectMultipleItems([file1, file2, folder1, folder2])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
@ -519,7 +497,6 @@ describe('Toolbar actions - multiple selection : ', () => {
}); });
}); });
// [C217090]
describe('Trash', () => { describe('Trash', () => {
beforeAll(done => { beforeAll(done => {
loginPage.loginWith(user1).then(done); loginPage.loginWith(user1).then(done);
@ -535,7 +512,7 @@ describe('Toolbar actions - multiple selection : ', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('correct actions appear when multiple files are selected', () => { it('correct actions appear when multiple files are selected - [C280472]', () => {
dataTable.selectMultipleItems([fileForDelete1, fileForDelete2]) dataTable.selectMultipleItems([fileForDelete1, fileForDelete2])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('Permanently delete')) expect(toolbar.actions.isButtonPresent('Permanently delete'))
@ -545,7 +522,7 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when multiple folders are selected', () => { it('correct actions appear when multiple folders are selected - [C280473]', () => {
dataTable.selectMultipleItems([folderForDelete1, folderForDelete2]) dataTable.selectMultipleItems([folderForDelete1, folderForDelete2])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('Permanently delete')) expect(toolbar.actions.isButtonPresent('Permanently delete'))
@ -555,7 +532,7 @@ describe('Toolbar actions - multiple selection : ', () => {
.then(() => dataTable.clearSelection()); .then(() => dataTable.clearSelection());
}); });
it('correct actions appear when both files and folders are selected', () => { it('correct actions appear when both files and folders are selected - [C280474]', () => {
dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]) dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2])
.then(() => { .then(() => {
expect(toolbar.actions.isButtonPresent('Permanently delete')) expect(toolbar.actions.isButtonPresent('Permanently delete'))

View File

@ -99,14 +99,14 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('actions not displayed for top level of File Libraries', async () => { it('actions not displayed for top level of File Libraries - [C213135]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.clickOnRowByName(userSite); await dataTable.clickOnRowByName(userSite);
expect(await toolbar.actions.isEmpty()).toBe(true, 'toolbar not empty'); expect(await toolbar.actions.isEmpty()).toBe(true, 'toolbar not empty');
}); });
it('selected row is marked with a check circle icon', async () => { it('selected row is marked with a check circle icon - [C213134]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.clickOnRowByName(fileUser); await dataTable.clickOnRowByName(fileUser);
@ -156,7 +156,7 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('on File Libraries', async () => { it('on File Libraries - [C280455]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.doubleClickOnRowByName(site); await dataTable.doubleClickOnRowByName(site);
@ -186,7 +186,7 @@ describe('Toolbar actions - single selection : ', () => {
await toolbar.actions.closeMoreMenu(); await toolbar.actions.closeMoreMenu();
}); });
it('on Shared Files', async () => { it('on Shared Files - [C280456]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
await page.dataTable.waitForHeader(); await page.dataTable.waitForHeader();
await page.dataTable.clickOnRowByName(file1); await page.dataTable.clickOnRowByName(file1);
@ -215,7 +215,7 @@ describe('Toolbar actions - single selection : ', () => {
}); });
// disabled until ACA-1184 is done // disabled until ACA-1184 is done
xit('on Favorites', async () => { xit('on Favorites - [C213121]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.clickOnRowByName(file1); await dataTable.clickOnRowByName(file1);
@ -248,7 +248,7 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('on File Libraries', async () => { it('on File Libraries - [C280476]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.doubleClickOnRowByName(site); await dataTable.doubleClickOnRowByName(site);
@ -265,7 +265,7 @@ describe('Toolbar actions - single selection : ', () => {
await toolbar.actions.closeMoreMenu(); await toolbar.actions.closeMoreMenu();
}); });
xit('on Shared Files', async () => { it('on Shared Files - [C280477]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectMultipleItems([ file1, file2 ]); await dataTable.selectMultipleItems([ file1, file2 ]);
@ -281,7 +281,7 @@ describe('Toolbar actions - single selection : ', () => {
}); });
// disabled until ACA-1184 is done // disabled until ACA-1184 is done
xit('on Favorites', async () => { xit('on Favorites - [C280478]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectMultipleItems([ file1, file2 ]); await dataTable.selectMultipleItems([ file1, file2 ]);
@ -318,11 +318,11 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('actions are not displayed when no item is selected', async () => { it('actions are not displayed when no item is selected - [C213120]', async () => {
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`); expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected', async () => { it('correct actions appear when a file is selected - [C213122]', async () => {
await dataTable.clickOnRowByName(fileUser); await dataTable.clickOnRowByName(fileUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
@ -336,7 +336,7 @@ describe('Toolbar actions - single selection : ', () => {
await toolbar.actions.closeMoreMenu(); await toolbar.actions.closeMoreMenu();
}); });
it('correct actions appear when a folder is selected', async () => { it('correct actions appear when a folder is selected - [C213123]', async () => {
await dataTable.clickOnRowByName(folderUser); await dataTable.clickOnRowByName(folderUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
@ -392,11 +392,11 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('actions are not displayed when no item is selected', async () => { it('actions are not displayed when no item is selected - [C280439]', async () => {
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`); expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected', async () => { it('correct actions appear when a file is selected - [C280440]', async () => {
await dataTable.clickOnRowByName(fileAdmin); await dataTable.clickOnRowByName(fileAdmin);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileAdmin}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileAdmin}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileAdmin}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileAdmin}`);
@ -410,7 +410,7 @@ describe('Toolbar actions - single selection : ', () => {
await toolbar.actions.closeMoreMenu(); await toolbar.actions.closeMoreMenu();
}); });
it('correct actions appear when a folder is selected', async () => { it('correct actions appear when a folder is selected - [C280441]', async () => {
await dataTable.clickOnRowByName(folderAdmin); await dataTable.clickOnRowByName(folderAdmin);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderAdmin}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderAdmin}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderAdmin}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderAdmin}`);
@ -445,11 +445,11 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('actions are not displayed when no item is selected', async () => { it('actions are not displayed when no item is selected - [C280442]', async () => {
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`); expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected', async () => { it('correct actions appear when a file is selected - [C280443]', async () => {
await dataTable.clickOnRowByName(fileAdmin); await dataTable.clickOnRowByName(fileAdmin);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileAdmin}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileAdmin}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileAdmin}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileAdmin}`);
@ -463,7 +463,7 @@ describe('Toolbar actions - single selection : ', () => {
await toolbar.actions.closeMoreMenu(); await toolbar.actions.closeMoreMenu();
}); });
it('correct actions appear when a folder is selected', async () => { it('correct actions appear when a folder is selected - [C280444]', async () => {
await dataTable.clickOnRowByName(folderAdmin); await dataTable.clickOnRowByName(folderAdmin);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderAdmin}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderAdmin}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderAdmin}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderAdmin}`);
@ -497,11 +497,11 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('actions are not displayed when no item is selected', async () => { it('actions are not displayed when no item is selected - [C280445]', async () => {
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`); expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected', async () => { it('correct actions appear when a file is selected - [C280446]', async () => {
await page.dataTable.clickOnRowByName(fileUser); await page.dataTable.clickOnRowByName(fileUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
@ -534,11 +534,11 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('actions are not displayed when no item is selected', async () => { it('actions are not displayed when no item is selected - [C280447]', async () => {
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`); expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected', async () => { it('correct actions appear when a file is selected - [C280448]', async () => {
await dataTable.clickOnRowByName(fileUser); await dataTable.clickOnRowByName(fileUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
@ -571,11 +571,11 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('actions are not displayed when no item is selected', async () => { it('actions are not displayed when no item is selected - [C280449]', async () => {
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`); expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected', async () => { it('correct actions appear when a file is selected - [C280450]', async () => {
await dataTable.clickOnRowByName(fileUser); await dataTable.clickOnRowByName(fileUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
@ -589,7 +589,7 @@ describe('Toolbar actions - single selection : ', () => {
await toolbar.actions.closeMoreMenu(); await toolbar.actions.closeMoreMenu();
}); });
it('correct actions appear when a folder is selected', async () => { it('correct actions appear when a folder is selected - [C280451]', async () => {
await dataTable.clickOnRowByName(folderUser); await dataTable.clickOnRowByName(folderUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`); expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
@ -604,7 +604,6 @@ describe('Toolbar actions - single selection : ', () => {
}); });
}); });
// [C217090]
describe('Trash', () => { describe('Trash', () => {
beforeAll(async (done) => { beforeAll(async (done) => {
await apis.user.nodes.deleteNodeById(fileForDeleteId, false); await apis.user.nodes.deleteNodeById(fileForDeleteId, false);
@ -629,18 +628,18 @@ describe('Toolbar actions - single selection : ', () => {
done(); done();
}); });
it('actions are not displayed when no item is selected', async () => { it('actions are not displayed when no item is selected - [C280452]', async () => {
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`); expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected', async () => { it('correct actions appear when a file is selected - [C280453]', async () => {
await dataTable.clickOnRowByName(fileForDelete); await dataTable.clickOnRowByName(fileForDelete);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileForDelete}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileForDelete}`);
expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is not displayed for file`); expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is not displayed for file`);
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, `Restore is not displayed for file`); expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, `Restore is not displayed for file`);
}); });
it('correct actions appear when a folder is selected', async () => { it('correct actions appear when a folder is selected - [C280454]', async () => {
await dataTable.clickOnRowByName(folderForDelete); await dataTable.clickOnRowByName(folderForDelete);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderForDelete}`); expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderForDelete}`);
expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is displayed for folder`); expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is displayed for folder`);

View File

@ -1,423 +0,0 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2018 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { browser } from 'protractor';
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
import { SIDEBAR_LABELS } from '../../configs';
import { RepoClient } from '../../utilities/repo-client/repo-client';
import { Utils } from '../../utilities/utils';
describe('Undo delete content', () => {
const username = `user-${Utils.random()}`;
const apis = {
admin: new RepoClient(),
user: new RepoClient(username, username)
};
const loginPage = new LoginPage();
const logoutPage = new LogoutPage();
const page = new BrowsingPage();
const { dataTable, toolbar } = page;
beforeAll(done => {
apis.admin.people.createUser(username).then(done);
});
afterAll(done => {
apis.admin.trashcan.emptyTrash().then(done);
});
xit('');
describe('on Personal Files', () => {
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
const file4 = `file4-${Utils.random()}.txt`;
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
const folder2 = `folder2-${Utils.random()}`; let folder2Id;
const fileLocked2 = `fileLocked2-${Utils.random()}.txt`; let fileLocked2Id;
beforeAll(done => {
apis.user.nodes.createFile(file1).then(resp => file1Id = resp.data.entry.id)
.then(() => apis.user.nodes.createFile(file2).then(resp => file2Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(file3).then(resp => file3Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFolder(folder1).then(resp => folder1Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(file4, folder1Id))
.then(() => apis.user.nodes.createFolder(folder2).then(resp => folder2Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(fileLocked2, folder2Id).then(resp => fileLocked2Id = resp.data.entry.id))
.then(() => apis.user.nodes.lockFile(fileLocked2Id))
.then(() => loginPage.loginWith(username))
.then(done);
});
beforeEach(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => dataTable.waitForHeader())
.then(done);
});
afterEach(done => {
page.refresh().then(done);
});
afterAll(done => {
Promise.all([
logoutPage.load(),
apis.user.nodes.unlockFile(fileLocked2Id)
.then(() => apis.user.nodes.deleteNodesById([file1Id, file2Id, file3Id, folder1Id, folder2Id]))
])
.then(done);
});
it('Successful delete notification shows Undo action', () => {
dataTable.clickOnRowByName(file1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).toContain(`Undo`);
})
.then(() => apis.user.trashcan.restore(file1Id));
});
it('Unsuccessful delete notification does not show Undo action', () => {
dataTable.clickOnRowByName(folder2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => {
expect(message).not.toContain(`Undo`);
});
});
it('Undo delete of file', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(file1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(file1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
it('Undo delete of folder with content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(folder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(folder1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.then(() => dataTable.doubleClickOnRowByName(folder1))
.then(() => {
expect(dataTable.getRowByName(file4).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.selectMultipleItems([file2, file3])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
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}`);
});
});
});
describe('on Shared Files', () => {
const sharedFile1 = `sharedFile1-${Utils.random()}`; let sharedFile1Id;
const sharedFile2 = `sharedFile2-${Utils.random()}`; let sharedFile2Id;
const sharedFile3 = `sharedFile3-${Utils.random()}`; let sharedFile3Id;
const sharedFile4 = `sharedFile4-${Utils.random()}`; let sharedFile4Id;
beforeAll(done => {
apis.user.nodes.createFile(sharedFile1).then(resp => sharedFile1Id = resp.data.entry.id)
.then(() => apis.user.nodes.createFile(sharedFile2).then(resp => sharedFile2Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(sharedFile3).then(resp => sharedFile3Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(sharedFile4).then(resp => sharedFile4Id = resp.data.entry.id))
.then(() => apis.user.shared.shareFilesByIds([sharedFile1Id, sharedFile2Id, sharedFile3Id, sharedFile4Id]))
.then(() => apis.user.shared.waitForApi({ expect: 4 }))
.then(() => loginPage.loginWith(username))
.then(done);
});
beforeEach(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => dataTable.waitForHeader())
.then(done);
});
afterEach(done => {
page.refresh().then(done);
});
afterAll(done => {
Promise.all([
logoutPage.load(),
apis.user.nodes.deleteNodesById([sharedFile2Id, sharedFile3Id, sharedFile4Id])
])
.then(done);
});
it('Successful delete notification shows Undo action', () => {
dataTable.clickOnRowByName(sharedFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => expect(message).toContain(`Undo`));
});
it('Undo delete of file', () => {
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.getRowByName(sharedFile2).isPresent()).toBe(false, 'Item was not restored'));
});
it('undo delete of multiple files', () => {
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.getRowByName(sharedFile3).isPresent()).toBe(false, `${sharedFile3} was not restored`);
expect(dataTable.getRowByName(sharedFile4).isPresent()).toBe(false, `${sharedFile4} was not restored`);
});
});
});
describe('on Favorites', () => {
const favoriteFile1 = `favFile1-${Utils.random()}.txt`; let favoriteFile1Id;
const favoriteFile2 = `favFile2-${Utils.random()}.txt`; let favoriteFile2Id;
const favoriteFile4 = `favFile4-${Utils.random()}.txt`;
const favoriteFileLocked2 = `favFileLocked2-${Utils.random()}.txt`; let favoriteFileLocked2Id;
const favoriteFolder1 = `favFolder1-${Utils.random()}`; let favoriteFolder1Id;
const favoriteFolder2 = `favFolder2-${Utils.random()}`; let favoriteFolder2Id;
beforeAll(done => {
apis.user.nodes.createFile(favoriteFile1).then(resp => favoriteFile1Id = resp.data.entry.id)
.then(() => apis.user.nodes.createFile(favoriteFile2).then(resp => favoriteFile2Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFolder(favoriteFolder1).then(resp => favoriteFolder1Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(favoriteFile4, favoriteFolder1Id))
.then(() => apis.user.nodes.createFolder(favoriteFolder2).then(resp => favoriteFolder2Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(favoriteFileLocked2, favoriteFolder2Id)
.then(resp => favoriteFileLocked2Id = resp.data.entry.id))
.then(() => apis.user.nodes.lockFile(favoriteFileLocked2Id))
.then(() => apis.user.favorites.addFavoritesByIds('file', [favoriteFile1Id, favoriteFile2Id]))
.then(() => apis.user.favorites.addFavoritesByIds('folder', [favoriteFolder1Id, favoriteFolder2Id]))
.then(() => apis.user.favorites.waitForApi({ expect: 4 }))
.then(() => loginPage.loginWith(username))
.then(done);
});
beforeEach(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => dataTable.waitForHeader())
.then(done);
});
afterEach(done => {
page.refresh().then(done);
});
afterAll(done => {
Promise.all([
logoutPage.load(),
apis.user.nodes.unlockFile(favoriteFileLocked2Id)
.then(() => apis.user.nodes.deleteNodesById([favoriteFile1Id, favoriteFile2Id, favoriteFolder1Id, favoriteFolder2Id]))
])
.then(done);
});
it('Successful delete notification shows Undo action', () => {
dataTable.clickOnRowByName(favoriteFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => expect(message).toContain(`Undo`))
.then(() => apis.user.trashcan.restore(favoriteFile1Id));
});
it('Unsuccessful delete notification does not show Undo action', () => {
dataTable.clickOnRowByName(favoriteFolder2)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => expect(message).not.toContain(`Undo`));
});
it('Undo delete of file', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(favoriteFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
});
});
it('Undo delete of folder with content', () => {
let items: number;
page.dataTable.countRows().then(number => { items = number; });
dataTable.clickOnRowByName(favoriteFolder1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
})
.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.selectMultipleItems([favoriteFile1, favoriteFile2])
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.clickSnackBarAction())
.then(() => {
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}`);
});
});
});
describe('on Recent Files', () => {
const recentFile1 = `recentFile1-${Utils.random()}.txt`; let recentFile1Id;
const recentFile2 = `recentFile2-${Utils.random()}.txt`; let recentFile2Id;
const recentFile3 = `recentFile3-${Utils.random()}.txt`; let recentFile3Id;
const recentFile4 = `recentFile4-${Utils.random()}.txt`; let recentFile4Id;
beforeAll(done => {
apis.user.nodes.createFile(recentFile1).then(resp => recentFile1Id = resp.data.entry.id)
.then(() => apis.user.nodes.createFile(recentFile2).then(resp => recentFile2Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(recentFile3).then(resp => recentFile3Id = resp.data.entry.id))
.then(() => apis.user.nodes.createFile(recentFile4).then(resp => recentFile4Id = resp.data.entry.id))
.then(() => apis.user.search.waitForApi(username, { expect: 4 }))
.then(() => loginPage.loginWith(username))
.then((): any => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => dataTable.isEmptyList())
.then(empty => {
if (empty) {
browser.sleep(6000).then(() => page.refresh());
}
})
)
.then(done);
});
beforeEach(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => dataTable.waitForHeader())
.then(done);
});
afterEach(done => {
page.refresh().then(done);
});
afterAll(done => {
Promise.all([
logoutPage.load(),
apis.user.nodes.deleteNodesById([recentFile2Id, recentFile3Id, recentFile4Id])
])
.then(done);
});
xit('Successful delete notification shows Undo action', () => {
dataTable.clickOnRowByName(recentFile1)
.then(() => toolbar.actions.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Delete'))
.then(() => page.getSnackBarMessage())
.then(message => expect(message).toContain(`Undo`));
});
// due to the fact that the search api is slow to update,
// we cannot test that the restored file is displayed in the Recent Files list
// without adding a very big browser.sleep followed by a page.refresh
// so for the moment we're testing that the restored file is not displayed in the Trash
xit('Undo delete of file', () => {
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.getRowByName(recentFile2).isPresent()).toBe(false, 'Item is in Trash'));
});
// due to the fact that the search api is slow to update,
// we cannot test that the restored file is displayed in the Recent Files list
// without adding a very big browser.sleep followed by a page.refresh
// so for the moment we're testing that the restored file is not displayed in the Trash
xit('undo delete of multiple files', () => {
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.getRowByName(recentFile3).isPresent()).toBe(false, `${recentFile3} is in Trash`);
expect(dataTable.getRowByName(recentFile4).isPresent()).toBe(false, `${recentFile4} is in Trash`);
});
});
});
});

View File

@ -36,14 +36,14 @@ describe('Page titles', () => {
xit(''); xit('');
describe('on Login / Logout pages', () => { describe('on Login / Logout pages', () => {
it('on Login page', () => { it('on Login page - [C217155]', () => {
loginPage.load() loginPage.load()
.then(() => { .then(() => {
expect(browser.getTitle()).toContain('Sign in'); expect(browser.getTitle()).toContain('Sign in');
}); });
}); });
it('after logout', () => { it('after logout - [C217156]', () => {
loginPage.loginWithAdmin() loginPage.loginWithAdmin()
.then(() => page.signOut()) .then(() => page.signOut())
.then(() => { .then(() => {
@ -51,7 +51,7 @@ describe('Page titles', () => {
}); });
}); });
it('when pressing Back after Logout', () => { it('when pressing Back after Logout - [C280414]', () => {
loginPage.loginWithAdmin() loginPage.loginWithAdmin()
.then(() => page.signOut()) .then(() => page.signOut())
.then(() => browser.navigate().back()) .then(() => browser.navigate().back())
@ -71,7 +71,7 @@ describe('Page titles', () => {
.then(done); .then(done);
}); });
it('Personal Files page', () => { it('Personal Files page - [C217157]', () => {
const label = SIDEBAR_LABELS.PERSONAL_FILES; const label = SIDEBAR_LABELS.PERSONAL_FILES;
page.sidenav.navigateToLinkByLabel(label) page.sidenav.navigateToLinkByLabel(label)
@ -80,7 +80,7 @@ describe('Page titles', () => {
}); });
}); });
it('File Libraries page', () => { it('File Libraries page - [C217158]', () => {
const label = SIDEBAR_LABELS.FILE_LIBRARIES; const label = SIDEBAR_LABELS.FILE_LIBRARIES;
page.sidenav.navigateToLinkByLabel(label) page.sidenav.navigateToLinkByLabel(label)
@ -89,7 +89,7 @@ describe('Page titles', () => {
}); });
}); });
it('Shared Files page', () => { it('Shared Files page - [C217159]', () => {
const label = SIDEBAR_LABELS.SHARED_FILES; const label = SIDEBAR_LABELS.SHARED_FILES;
page.sidenav.navigateToLinkByLabel(label) page.sidenav.navigateToLinkByLabel(label)
@ -98,7 +98,7 @@ describe('Page titles', () => {
}); });
}); });
it('Recent Files page', () => { it('Recent Files page - [C217160]', () => {
const label = SIDEBAR_LABELS.RECENT_FILES; const label = SIDEBAR_LABELS.RECENT_FILES;
page.sidenav.navigateToLinkByLabel(label) page.sidenav.navigateToLinkByLabel(label)
@ -107,7 +107,7 @@ describe('Page titles', () => {
}); });
}); });
it('Favorites page', () => { it('Favorites page - [C217161]', () => {
const label = SIDEBAR_LABELS.FAVORITES; const label = SIDEBAR_LABELS.FAVORITES;
page.sidenav.navigateToLinkByLabel(label) page.sidenav.navigateToLinkByLabel(label)
@ -116,7 +116,7 @@ describe('Page titles', () => {
}); });
}); });
it('Trash page', () => { it('Trash page - [C217162]', () => {
const label = SIDEBAR_LABELS.TRASH; const label = SIDEBAR_LABELS.TRASH;
page.sidenav.navigateToLinkByLabel(label) page.sidenav.navigateToLinkByLabel(label)

View File

@ -86,14 +86,14 @@ describe('Login', () => {
loginPage.load().then(done); loginPage.load().then(done);
}); });
it('login page default values', () => { it('login page layout - [C213089]', () => {
expect(loginPage.login.usernameInput.isEnabled()).toBe(true, 'username input is not enabled'); expect(loginPage.login.usernameInput.isEnabled()).toBe(true, 'username input is not enabled');
expect(loginPage.login.passwordInput.isEnabled()).toBe(true, 'password input is not enabled'); expect(loginPage.login.passwordInput.isEnabled()).toBe(true, 'password input is not enabled');
expect(loginPage.login.submitButton.isEnabled()).toBe(false, 'SIGN IN button is enabled'); expect(loginPage.login.submitButton.isEnabled()).toBe(false, 'SIGN IN button is enabled');
expect(loginPage.login.getPasswordVisibility()).toBe(false, 'Password is not hidden by default'); expect(loginPage.login.getPasswordVisibility()).toBe(false, 'Password is not hidden by default');
}); });
it('change password visibility', () => { it('change password visibility - [C213091]', () => {
loginPage.login.enterPassword('some password'); loginPage.login.enterPassword('some password');
expect(loginPage.login.isPasswordShown()).toBe(false, 'password is visible'); expect(loginPage.login.isPasswordShown()).toBe(false, 'password is visible');
loginPage.login.passwordVisibility.click() loginPage.login.passwordVisibility.click()
@ -105,7 +105,7 @@ describe('Login', () => {
}); });
describe('with valid credentials', () => { describe('with valid credentials', () => {
it('navigate to "Personal Files"', () => { it('navigate to "Personal Files" - [C213092]', () => {
const { username } = johnDoe; const { username } = johnDoe;
loginPage.loginWith(username) loginPage.loginWith(username)
@ -114,7 +114,7 @@ describe('Login', () => {
}); });
}); });
it(`displays user's name in header`, () => { it(`displays user's name in header - [C213108]`, () => {
const { userInfo } = new BrowsingPage(APP_ROUTES.PERSONAL_FILES).header; const { userInfo } = new BrowsingPage(APP_ROUTES.PERSONAL_FILES).header;
const { username, firstName, lastName } = johnDoe; const { username, firstName, lastName } = johnDoe;
@ -124,7 +124,7 @@ describe('Login', () => {
}); });
}); });
it(`logs in with user having username containing "@"`, () => { it(`logs in with user having username containing "@" - [C213096]`, () => {
loginPage loginPage
.loginWith(testUser) .loginWith(testUser)
.then(() => { .then(() => {
@ -132,7 +132,7 @@ describe('Login', () => {
}); });
}); });
it('logs in with user with non-latin characters', () => { it('logs in with user with non-latin characters - [C213097]', () => {
const { username, password } = russianUser; const { username, password } = russianUser;
loginPage loginPage
@ -142,7 +142,7 @@ describe('Login', () => {
}); });
}); });
it('redirects to Home Page when navigating to the Login page while already logged in', () => { it('redirects to Home Page when navigating to the Login page while already logged in - [C213107]', () => {
const { username } = johnDoe; const { username } = johnDoe;
loginPage loginPage
@ -154,7 +154,7 @@ describe('Login', () => {
); );
}); });
it('redirects to Personal Files when pressing browser Back while already logged in ', () => { it('redirects to Personal Files when pressing browser Back while already logged in - [C213109]', () => {
const { username } = johnDoe; const { username } = johnDoe;
loginPage loginPage
@ -165,7 +165,7 @@ describe('Login', () => {
}); });
}); });
it('user is able to login after changing his password', () => { it('user is able to login after changing his password - [C213104]', () => {
loginPage.loginWith(testUser2.username, testUser2.password) loginPage.loginWith(testUser2.username, testUser2.password)
.then(() => logoutPage.load()) .then(() => logoutPage.load())
.then(() => peopleApi.changePassword(testUser2.username, newPassword)) .then(() => peopleApi.changePassword(testUser2.username, newPassword))
@ -184,21 +184,17 @@ describe('Login', () => {
loginPage.load().then(done); loginPage.load().then(done);
}); });
it('disabled submit button when no credentials are entered', () => { it('disabled submit button when password is empty - [C280072]', () => {
expect(submitButton.isEnabled()).toBe(false);
});
it('disabled submit button when password is empty', () => {
loginComponent.enterUsername('any-username'); loginComponent.enterUsername('any-username');
expect(submitButton.isEnabled()).toBe(false); expect(submitButton.isEnabled()).toBe(false);
}); });
it('disabled submit button when username is empty', () => { it('disabled submit button when username is empty - [C280070]', () => {
loginPage.login.enterPassword('any-password'); loginPage.login.enterPassword('any-password');
expect(submitButton.isEnabled()).toBe(false); expect(submitButton.isEnabled()).toBe(false);
}); });
it('shows error when entering nonexistent user', () => { it('shows error when entering nonexistent user - [C213093]', () => {
loginPage loginPage
.tryLoginWith('nonexistent-user', 'any-password') .tryLoginWith('nonexistent-user', 'any-password')
.then(() => { .then(() => {
@ -208,7 +204,7 @@ describe('Login', () => {
}); });
}); });
it('shows error when entering invalid password', () => { it('shows error when entering invalid password - [C280071]', () => {
const { username } = johnDoe; const { username } = johnDoe;
loginPage loginPage
@ -220,14 +216,14 @@ describe('Login', () => {
}); });
}); });
it('unauthenticated user is redirected to Login page', () => { it('unauthenticated user is redirected to Login page - [C213106]', () => {
browser.get(APP_ROUTES.PERSONAL_FILES) browser.get(APP_ROUTES.PERSONAL_FILES)
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
}); });
}); });
it('disabled user is not logged in', () => { it('disabled user is not logged in - [C213100]', () => {
loginPage.tryLoginWith(disabledUser) loginPage.tryLoginWith(disabledUser)
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);

View File

@ -52,19 +52,19 @@ describe('Logout', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('Sign out option is available [C213143]', () => { it('Sign out option is available - [C213143]', () => {
page.header.userInfo.openMenu() page.header.userInfo.openMenu()
.then(() => expect(page.header.userInfo.menu.isMenuItemPresent('Sign out')).toBe(true, 'Sign out option not displayed')); .then(() => expect(page.header.userInfo.menu.isMenuItemPresent('Sign out')).toBe(true, 'Sign out option not displayed'));
}); });
it('redirects to Login page on sign out [C213144]', () => { it('redirects to Login page on sign out - [C213144]', () => {
page.signOut() page.signOut()
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
}); });
}); });
it('redirects to Login page when pressing browser Back after logout [C213145]', () => { it('redirects to Login page when pressing browser Back after logout - [C213145]', () => {
page.signOut() page.signOut()
.then(() => browser.navigate().back()) .then(() => browser.navigate().back())
.then(() => { .then(() => {
@ -72,7 +72,7 @@ describe('Logout', () => {
}); });
}); });
it('redirects to Login page when trying to access a part of the app after logout [C213146]', () => { it('redirects to Login page when trying to access a part of the app after logout - [C213146]', () => {
page.signOut() page.signOut()
.then(() => page.load('/favorites')) .then(() => page.load('/favorites'))
.then(() => { .then(() => {

View File

@ -52,7 +52,7 @@ describe('Empty list views', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('empty Personal Files', () => { it('empty Personal Files - [C280131]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => { .then(() => {
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty'); expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
@ -60,7 +60,7 @@ describe('Empty list views', () => {
}); });
}); });
it('empty File Libraries [C217099]', () => { it('empty File Libraries - [C217099]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => { .then(() => {
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty'); expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
@ -69,7 +69,7 @@ describe('Empty list views', () => {
}); });
}); });
it('empty Shared Files', () => { it('empty Shared Files - [C280132]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => { .then(() => {
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty'); expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
@ -78,7 +78,7 @@ describe('Empty list views', () => {
}); });
}); });
it('empty Recent Files [C213169]', () => { it('empty Recent Files - [C213169]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => { .then(() => {
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty'); expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
@ -87,7 +87,7 @@ describe('Empty list views', () => {
}); });
}); });
it('empty Favorites', () => { it('empty Favorites - [C280133]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => { .then(() => {
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty'); expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
@ -96,7 +96,7 @@ describe('Empty list views', () => {
}); });
}); });
it('empty Trash', () => { it('empty Trash - [C280134]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
.then(() => { .then(() => {
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty'); expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');

View File

@ -98,7 +98,7 @@ describe('Favorites', () => {
done(); done();
}); });
it('has the correct columns', async () => { it('has the correct columns - [C280482]', async () => {
const labels = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by' ]; const labels = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by' ];
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
@ -109,49 +109,49 @@ describe('Favorites', () => {
}); });
}); });
it('displays the favorite files and folders [C213226]', async () => { it('displays the favorite files and folders - [C213226]', async () => {
expect(await dataTable.countRows()).toEqual(4, 'Incorrect number of items displayed'); 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(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
expect(await dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`); expect(await dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
expect(await dataTable.getRowByName(favFolderName).isPresent()).toBe(true, `${favFolderName} not displayed`); expect(await dataTable.getRowByName(favFolderName).isPresent()).toBe(true, `${favFolderName} not displayed`);
}); });
it(`file not displayed if it's in the Trashcan [C213228]`, async () => { it(`deleted favorite file does not appear - [C213228]`, async () => {
expect(await dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`); expect(await dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
}); });
it(`file is displayed after it is restored from Trashcan [C213229]`, async () => { it(`file is displayed after it is restored from Trashcan - [C213229]`, async () => {
expect(await dataTable.getRowByName(fileName4).isPresent()).toBe(true, `${fileName4} not displayed`); expect(await dataTable.getRowByName(fileName4).isPresent()).toBe(true, `${fileName4} not displayed`);
}); });
it('Location column displays the parent folder of the files [C213231]', async () => { it('Location column displays the parent folder of the files - [C213231]', async () => {
expect(await dataTable.getItemLocation(fileName1).getText()).toEqual(siteName); expect(await dataTable.getItemLocation(fileName1).getText()).toEqual(siteName);
expect(await dataTable.getItemLocation(fileName2).getText()).toEqual(parentFolder); expect(await dataTable.getItemLocation(fileName2).getText()).toEqual(parentFolder);
expect(await dataTable.getItemLocation(favFolderName).getText()).toEqual('Personal Files'); expect(await dataTable.getItemLocation(favFolderName).getText()).toEqual('Personal Files');
}); });
it('Location column displays a tooltip with the entire path of the file [C213671]', async () => { it('Location column displays a tooltip with the entire path of the file - [C213671]', async () => {
expect(dataTable.getItemLocationTileAttr(fileName1)).toEqual(`File Libraries/${siteName}`); expect(dataTable.getItemLocationTileAttr(fileName1)).toEqual(`File Libraries/${siteName}`);
expect(dataTable.getItemLocationTileAttr(fileName2)).toEqual(`Personal Files/${parentFolder}`); expect(dataTable.getItemLocationTileAttr(fileName2)).toEqual(`Personal Files/${parentFolder}`);
expect(dataTable.getItemLocationTileAttr(favFolderName)).toEqual('Personal Files'); expect(dataTable.getItemLocationTileAttr(favFolderName)).toEqual('Personal Files');
}); });
it('Location column redirect - item in user Home [C213650] [C260968]', async () => { it('Location column redirect - item in user Home - [C213650]', async () => {
await dataTable.clickItemLocation(favFolderName); await dataTable.clickItemLocation(favFolderName);
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]); expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
}); });
it('Location column redirect - file in folder [C213650] [C260968]', async () => { it('Location column redirect - file in folder - [C280484]', async () => {
await dataTable.clickItemLocation(fileName2); await dataTable.clickItemLocation(fileName2);
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', parentFolder ]); expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', parentFolder ]);
}); });
it('Location column redirect - file in site [C213650] [C260969]', async () => { it('Location column redirect - file in site - [C280485]', async () => {
await dataTable.clickItemLocation(fileName1); await dataTable.clickItemLocation(fileName1);
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]); expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]);
}); });
it('Navigate into folder from Favorites [C213230]', async () => { it('Navigate into folder from Favorites - [C213230]', async () => {
await dataTable.doubleClickOnRowByName(favFolderName); await dataTable.doubleClickOnRowByName(favFolderName);
await dataTable.waitForEmptyState(); await dataTable.waitForEmptyState();
expect(await breadcrumb.getCurrentItemName()).toBe(favFolderName); expect(await breadcrumb.getCurrentItemName()).toBe(favFolderName);

View File

@ -94,7 +94,7 @@ describe('File Libraries', () => {
.then(done); .then(done);
}); });
it('has the correct columns', () => { it('has the correct columns - [C217095]', () => {
const labels = [ 'Title', 'Status' ]; const labels = [ 'Title', 'Status' ];
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
@ -105,7 +105,7 @@ describe('File Libraries', () => {
}); });
}); });
it('User can see only the sites he is a member of [C217095]', () => { it('User can see only the sites he is a member of - [C280501]', () => {
const sitesCount = dataTable.countRows(); const sitesCount = dataTable.countRows();
const expectedSites = { const expectedSites = {
@ -134,7 +134,7 @@ describe('File Libraries', () => {
}); });
}); });
it('Site ID is displayed when two sites have the same name [C217098]', () => { it('Site ID is displayed when two sites have the same name - [C217098]', () => {
const expectedSites = [ const expectedSites = [
`${siteName} (${siteId1})`, `${siteName} (${siteId1})`,
`${siteName} (${siteId2})` `${siteName} (${siteId2})`
@ -147,12 +147,12 @@ describe('File Libraries', () => {
}); });
}); });
it('Tooltip for sites without description [C217096]', () => { it('Tooltip for sites without description - [C217096]', () => {
const tooltip = dataTable.getItemNameTooltip(sitePrivate); const tooltip = dataTable.getItemNameTooltip(sitePrivate);
expect(tooltip).toBe(`${sitePrivate}`); expect(tooltip).toBe(`${sitePrivate}`);
}); });
it('Tooltip for sites with description [C217097]', () => { it('Tooltip for sites with description - [C217097]', () => {
const tooltip = dataTable.getItemNameTooltip(siteModerated); const tooltip = dataTable.getItemNameTooltip(siteModerated);
expect(tooltip).toBe(`${siteDescription}`); expect(tooltip).toBe(`${siteDescription}`);
}); });

View File

@ -83,7 +83,7 @@ describe('Special permissions', () => {
.then(done); .then(done);
}); });
it('on Recent Files [C213173]', () => { it('on Recent Files - [C213173]', () => {
recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES) recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -96,7 +96,7 @@ describe('Special permissions', () => {
}); });
}); });
it('on Favorites [C213227]', () => { it('on Favorites - [C213227]', () => {
favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -109,7 +109,7 @@ describe('Special permissions', () => {
}); });
}); });
it('on Shared Files [C213116]', () => { it('on Shared Files - [C213116]', () => {
sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -151,7 +151,7 @@ describe('Special permissions', () => {
.then(done); .then(done);
}); });
it(`on Recent Files [C213178]`, () => { it(`on Recent Files - [C213178]`, () => {
recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES) recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -160,7 +160,7 @@ describe('Special permissions', () => {
}); });
}); });
it(`on Favorites [C213672]`, () => { it(`on Favorites - [C213672]`, () => {
favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -169,7 +169,7 @@ describe('Special permissions', () => {
}); });
}); });
it(`on Shared Files [C213668]`, () => { it(`on Shared Files - [C213668]`, () => {
sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {

View File

@ -85,11 +85,8 @@ describe('Personal Files', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('has "Data Dictionary" folder [C213241]', () => { it('has Data Dictionary and created content - [C213241]', () => {
expect(dataTable.getRowByName('Data Dictionary').isPresent()).toBe(true); expect(dataTable.getRowByName('Data Dictionary').isPresent()).toBe(true);
});
it('has created content', () => {
expect(dataTable.getRowByName(adminFolder).isPresent()).toBe(true); expect(dataTable.getRowByName(adminFolder).isPresent()).toBe(true);
}); });
}); });
@ -109,7 +106,7 @@ describe('Personal Files', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('has the correct columns [C217142]', () => { it('has the correct columns - [C217142]', () => {
const labels = [ 'Name', 'Size', 'Modified', 'Modified by' ]; const labels = [ 'Name', 'Size', 'Modified', 'Modified by' ];
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
@ -120,16 +117,16 @@ describe('Personal Files', () => {
}); });
}); });
it('has default sorted column [C217143]', () => { it('has default sorted column - [C217143]', () => {
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified'); expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
}); });
it('has user created content [C213242]', () => { it('has user created content - [C213242]', () => {
expect(dataTable.getRowByName(userFolder).isPresent()) expect(dataTable.getRowByName(userFolder).isPresent())
.toBe(true); .toBe(true);
}); });
it('navigates to folder [C213244]', () => { it('navigates to folder - [C213244]', () => {
const getNodeIdPromise = apis.user.nodes const getNodeIdPromise = apis.user.nodes
.getNodeByPath(`/${userFolder}`) .getNodeByPath(`/${userFolder}`)
.then(response => response.data.entry.id); .then(response => response.data.entry.id);
@ -152,19 +149,19 @@ describe('Personal Files', () => {
}); });
}); });
it('redirects to Personal Files on clicking the link from sidebar [C213245]', () => { it('redirects to Personal Files on clicking the link from sidebar - [C213245]', () => {
personalFilesPage.dataTable.doubleClickOnRowByName(userFolder) personalFilesPage.dataTable.doubleClickOnRowByName(userFolder)
.then(() => personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)) .then(() => personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
.then(() => browser.getCurrentUrl()) .then(() => browser.getCurrentUrl())
.then(url => expect(url.endsWith(APP_ROUTES.PERSONAL_FILES)).toBe(true, 'incorrect url')); .then(url => expect(url.endsWith(APP_ROUTES.PERSONAL_FILES)).toBe(true, 'incorrect url'));
}); });
it('page loads correctly after browser refresh [C213246]', () => { it('page loads correctly after browser refresh - [C213246]', () => {
personalFilesPage.refresh() personalFilesPage.refresh()
.then(() => expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES)); .then(() => expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES));
}); });
it('page load by URL [C213247]', () => { it('page load by URL - [C213247]', () => {
let url; let url;
browser.getCurrentUrl() browser.getCurrentUrl()
.then(resp => url = resp) .then(resp => url = resp)

View File

@ -85,7 +85,7 @@ describe('Recent Files', () => {
.then(done); .then(done);
}); });
it('has the correct columns [C213168]', () => { it('has the correct columns - [C213168]', () => {
const labels = [ 'Name', 'Location', 'Size', 'Modified' ]; const labels = [ 'Name', 'Location', 'Size', 'Modified' ];
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
@ -96,45 +96,45 @@ describe('Recent Files', () => {
}); });
}); });
it('default sorting column [C213171]', () => { it('default sorting column - [C213171]', () => {
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified'); expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
expect(dataTable.getSortingOrder()).toBe('desc'); expect(dataTable.getSortingOrder()).toBe('desc');
}); });
it('displays the files added by the current user in the last 30 days [C213170]', () => { 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.countRows()).toEqual(3, 'Incorrect number of files displayed');
expect(dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} 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(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`); expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
}); });
it(`file not displayed if it's in the Trashcan [C213174]`, () => { it(`file not displayed if it's been deleted - [C213174]`, () => {
expect(dataTable.getRowByName(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]', () => { it('Location column displays the parent folder of the file - [C213175]', () => {
expect(dataTable.getItemLocation(fileName1).getText()).toEqual(folderName); expect(dataTable.getItemLocation(fileName1).getText()).toEqual(folderName);
expect(dataTable.getItemLocation(fileName2).getText()).toEqual('Personal Files'); expect(dataTable.getItemLocation(fileName2).getText()).toEqual('Personal Files');
expect(dataTable.getItemLocation(fileSite).getText()).toEqual(folderSite); expect(dataTable.getItemLocation(fileSite).getText()).toEqual(folderSite);
}); });
it('Location column displays a tooltip with the entire path of the file [C213177]', () => { it('Location column displays a tooltip with the entire path of the file - [C213177]', () => {
expect(dataTable.getItemLocationTileAttr(fileName1)).toEqual(`Personal Files/${folderName}`); expect(dataTable.getItemLocationTileAttr(fileName1)).toEqual(`Personal Files/${folderName}`);
expect(dataTable.getItemLocationTileAttr(fileName2)).toEqual('Personal Files'); expect(dataTable.getItemLocationTileAttr(fileName2)).toEqual('Personal Files');
expect(dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}/${folderSite}`); expect(dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}/${folderSite}`);
}); });
it('Location column redirect - file in user Home [C213176] [C260968]', () => { it('Location column redirect - file in user Home - [C213176]', () => {
dataTable.clickItemLocation(fileName2) dataTable.clickItemLocation(fileName2)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ])); .then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
}); });
it('Location column redirect - file in folder [C213176] [C260968]', () => { it('Location column redirect - file in folder - [C280486]', () => {
dataTable.clickItemLocation(fileName1) dataTable.clickItemLocation(fileName1)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderName ])); .then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderName ]));
}); });
it('Location column redirect - file in site [C213176] [C260969]', () => { it('Location column redirect - file in site - [C280487]', () => {
dataTable.clickItemLocation(fileSite) dataTable.clickItemLocation(fileSite)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName, folderSite ])); .then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName, folderSite ]));
}); });

View File

@ -39,6 +39,7 @@ describe('Shared Files', () => {
const file1User = `file1-${Utils.random()}.txt`; let file1Id; const file1User = `file1-${Utils.random()}.txt`; let file1Id;
const file2User = `file2-${Utils.random()}.txt`; let file2Id; const file2User = `file2-${Utils.random()}.txt`; let file2Id;
const file3User = `file3-${Utils.random()}.txt`; let file3Id; const file3User = `file3-${Utils.random()}.txt`; let file3Id;
const file4User = `file4-${Utils.random()}.txt`; let file4Id;
const apis = { const apis = {
admin: new RepoClient(), admin: new RepoClient(),
@ -62,9 +63,10 @@ describe('Shared Files', () => {
.then(() => apis.user.nodes.createFiles([ file1User ], folderUser)).then(resp => file1Id = resp.data.entry.id) .then(() => apis.user.nodes.createFiles([ file1User ], folderUser)).then(resp => file1Id = resp.data.entry.id)
.then(() => apis.user.nodes.createFile(file2User)).then(resp => file2Id = resp.data.entry.id) .then(() => apis.user.nodes.createFile(file2User)).then(resp => file2Id = resp.data.entry.id)
.then(() => apis.user.nodes.createFile(file3User)).then(resp => file3Id = resp.data.entry.id) .then(() => apis.user.nodes.createFile(file3User)).then(resp => file3Id = resp.data.entry.id)
.then(() => apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id])) .then(() => apis.user.nodes.createFile(file4User)).then(resp => file4Id = resp.data.entry.id)
.then(() => apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id]))
.then(() => apis.user.shared.waitForApi({ expect: 4 })) .then(() => apis.user.shared.waitForApi({ expect: 5 }))
.then(() => apis.user.nodes.deleteNodeById(file2Id)) .then(() => apis.user.nodes.deleteNodeById(file2Id))
.then(() => apis.user.shared.unshareFile(file3User)) .then(() => apis.user.shared.unshareFile(file3User))
@ -91,7 +93,7 @@ describe('Shared Files', () => {
.then(done); .then(done);
}); });
it('has the correct columns [C213113]', () => { it('has the correct columns - [C213113]', () => {
const labels = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ]; const labels = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ];
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
@ -102,40 +104,50 @@ describe('Shared Files', () => {
}); });
}); });
it('default sorting column [C213115]', () => { it('default sorting column - [C213115]', () => {
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified'); expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
expect(dataTable.getSortingOrder()).toBe('desc'); expect(dataTable.getSortingOrder()).toBe('desc');
}); });
it('displays the files shared by everyone [C213114]', () => { it('displays the files shared by everyone - [C213114]', () => {
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`); expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
expect(dataTable.getRowByName(file1User).isPresent()).toBe(true, `${file1User} not displayed`); expect(dataTable.getRowByName(file1User).isPresent()).toBe(true, `${file1User} not displayed`);
}); });
it(`file not displayed if it's in the Trashcan [C213117]`, () => { it(`file not displayed if it's been deleted - [C213117]`, () => {
expect(dataTable.getRowByName(file2User).isPresent()).toBe(false, `${file2User} is displayed`); expect(dataTable.getRowByName(file2User).isPresent()).toBe(false, `${file2User} is displayed`);
}); });
xit('unshared file is not displayed [C213118]', () => { // TODO: disabled cause the api is slow to update. Find a way to wait until the file is unshared
expect(dataTable.getRowByName(file3User).isPresent()).toBe(false, `${file3User} is displayed`); xit('unshared file is not displayed - [C213118]', async () => {
apis.user.shared.waitForApi({ expect: 4 })
.then(() => {
expect(dataTable.getRowByName(file3User).isPresent()).toBe(false, `${file3User} is displayed`);
});
}); });
it('Location column displays the parent folder of the file [C213665]', () => { it('Location column displays the parent folder of the file - [C213665]', () => {
expect(dataTable.getItemLocationTileAttr(file4User)).toEqual('Personal Files');
expect(dataTable.getItemLocation(fileAdmin).getText()).toEqual(siteName); expect(dataTable.getItemLocation(fileAdmin).getText()).toEqual(siteName);
expect(dataTable.getItemLocation(file1User).getText()).toEqual(folderUser); expect(dataTable.getItemLocation(file1User).getText()).toEqual(folderUser);
}); });
it('Location column redirect - file in user Home [C213666] [C260968]', () => { it('Location column redirect - file in user Home - [C213666]', () => {
dataTable.clickItemLocation(file4User)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
});
it('Location column redirect - file in folder - [C280490]', () => {
dataTable.clickItemLocation(file1User) dataTable.clickItemLocation(file1User)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderUser ])); .then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderUser ]));
}); });
it('Location column redirect - file in site [C213666] [C260969]', () => { it('Location column redirect - file in site - [C280491]', () => {
dataTable.clickItemLocation(fileAdmin) dataTable.clickItemLocation(fileAdmin)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ])); .then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]));
}); });
it('Location column displays a tooltip with the entire path of the file [C213667]', () => { it('Location column displays a tooltip with the entire path of the file - [C213667]', () => {
expect(dataTable.getItemLocationTileAttr(fileAdmin)).toEqual(`File Libraries/${siteName}`); expect(dataTable.getItemLocationTileAttr(fileAdmin)).toEqual(`File Libraries/${siteName}`);
expect(dataTable.getItemLocationTileAttr(file1User)).toEqual(`Personal Files/${folderUser}`); expect(dataTable.getItemLocationTileAttr(file1User)).toEqual(`Personal Files/${folderUser}`);
}); });

View File

@ -104,35 +104,35 @@ describe('File / folder tooltips', () => {
.then(done); .then(done);
}); });
it('File with name, no title, no description', () => { it('File with name, no title, no description - [C255871]', () => {
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`); expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
}); });
it('File with name and description, no title', () => { it('File with name and description, no title - [C255872]', () => {
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
}); });
it('File with name and title, no description', () => { it('File with name and title, no description - [C255873]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`); expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
}); });
it('File with name and title and description, all different', () => { it('File with name and title and description, all different - [C255874]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
}); });
it('File with name and title and description, all equal', () => { it('File with name and title and description, all equal - [C255875]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
}); });
it('File with name = title, different description', () => { it('File with name = title, different description - [C255876]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
}); });
it('File with name = description, different title', () => { it('File with name = description, different title - [C255877]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`); expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
}); });
it('File with title = description, different name', () => { it('File with title = description, different name - [C255878]', () => {
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`); expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
}); });
}); });
@ -144,35 +144,35 @@ describe('File / folder tooltips', () => {
.then(done); .then(done);
}); });
it('File with name, no title, no description', () => { it('File with name, no title, no description - [C280135]', () => {
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`); expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
}); });
it('File with name and description, no title', () => { it('File with name and description, no title - [C280136]', () => {
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
}); });
it('File with name and title, no description', () => { it('File with name and title, no description - [C280137]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`); expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
}); });
it('File with name and title and description, all different', () => { it('File with name and title and description, all different - [C280138]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
}); });
it('File with name and title and description, all equal', () => { it('File with name and title and description, all equal - [C280139]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
}); });
it('File with name = title, different description', () => { it('File with name = title, different description - [C280140]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
}); });
it('File with name = description, different title', () => { it('File with name = description, different title - [C280141]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`); expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
}); });
it('File with title = description, different name', () => { it('File with title = description, different name - [C280142]', () => {
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`); expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
}); });
}); });
@ -185,73 +185,75 @@ describe('File / folder tooltips', () => {
.then(done); .then(done);
}); });
it('File with name, no title, no description', () => { it('File with name, no title, no description - [C280143]', () => {
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`); expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
}); });
it('File with name and description, no title', () => { it('File with name and description, no title - [C280144]', () => {
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
}); });
it('File with name and title, no description', () => { it('File with name and title, no description - [C280145]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`); expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
}); });
it('File with name and title and description, all different', () => { it('File with name and title and description, all different - [C280146]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
}); });
it('File with name and title and description, all equal', () => { it('File with name and title and description, all equal - [C280147]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
}); });
it('File with name = title, different description', () => { it('File with name = title, different description - [C280148]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
}); });
it('File with name = description, different title', () => { it('File with name = description, different title - [C280149]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`); expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
}); });
it('File with title = description, different name', () => { it('File with title = description, different name - [C280150]', () => {
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`); expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
}); });
}); });
describe('on Favorites', () => { describe('on Favorites', () => {
beforeAll(done => { beforeAll(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES).then(done); page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => dataTable.waitForHeader())
.then(done);
}); });
it('File with name, no title, no description', () => { it('File with name, no title, no description - [C280151]', () => {
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`); expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
}); });
it('File with name and description, no title', () => { it('File with name and description, no title - [C280152]', () => {
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
}); });
it('File with name and title, no description', () => { it('File with name and title, no description - [C280153]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`); expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
}); });
it('File with name and title and description, all different', () => { it('File with name and title and description, all different - [C280154]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
}); });
it('File with name and title and description, all equal', () => { it('File with name and title and description, all equal - [C280155]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
}); });
it('File with name = title, different description', () => { it('File with name = title, different description - [C280156]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
}); });
it('File with name = description, different title', () => { it('File with name = description, different title - [C280157]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`); expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
}); });
it('File with title = description, different name', () => { it('File with title = description, different name - [C280158]', () => {
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`); expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
}); });
}); });
@ -288,6 +290,7 @@ describe('File / folder tooltips', () => {
], false)) ], false))
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)) .then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
.then(() => dataTable.waitForHeader())
.then(done); .then(done);
}); });
@ -295,35 +298,35 @@ describe('File / folder tooltips', () => {
apis.user.nodes.deleteNodes([ parentForTrash ]).then(done); apis.user.nodes.deleteNodes([ parentForTrash ]).then(done);
}); });
it('File with name, no title, no description', () => { it('File with name, no title, no description - [C280159]', () => {
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`); expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
}); });
it('File with name and description, no title', () => { it('File with name and description, no title - [C280160]', () => {
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
}); });
it('File with name and title, no description', () => { it('File with name and title, no description - [C280161]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`); expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
}); });
it('File with name and title and description, all different', () => { it('File with name and title and description, all different - [C280162]', () => {
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
}); });
it('File with name and title and description, all equal', () => { it('File with name and title and description, all equal - [C280163]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
}); });
it('File with name = title, different description', () => { it('File with name = title, different description - [C280164]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`); expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
}); });
it('File with name = description, different title', () => { it('File with name = description, different title - [C280165]', () => {
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`); expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
}); });
it('File with title = description, different name', () => { it('File with title = description, different name - [C280166]', () => {
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`); expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
}); });
}); });

View File

@ -41,6 +41,12 @@ describe('Trash', () => {
const folderUser = `folder-${Utils.random()}`; let folderUserId; const folderUser = `folder-${Utils.random()}`; let folderUserId;
const fileUser = `file-${Utils.random()}.txt`; let fileUserId; const fileUser = `file-${Utils.random()}.txt`; let fileUserId;
const folderDeleted = `folder-${Utils.random()}`; let folderDeletedId;
const fileDeleted = `file-${Utils.random()}.txt`; let fileDeletedId;
const folderNotDeleted = `folder-${Utils.random()}`; let folderNotDeletedId;
const fileInFolder = `file-${Utils.random()}.txt`; let fileInFolderId;
const apis = { const apis = {
admin: new RepoClient(), admin: new RepoClient(),
user: new RepoClient(username, username) user: new RepoClient(username, username)
@ -62,9 +68,15 @@ describe('Trash', () => {
.then(resp => fileSiteId = resp.data.entry.id)) .then(resp => fileSiteId = resp.data.entry.id))
.then(() => apis.user.nodes.createFiles([ fileUser ]).then(resp => fileUserId = resp.data.entry.id)) .then(() => apis.user.nodes.createFiles([ fileUser ]).then(resp => fileUserId = resp.data.entry.id))
.then(() => apis.user.nodes.createFolders([ folderUser ]).then(resp => folderUserId = resp.data.entry.id)) .then(() => apis.user.nodes.createFolders([ folderUser ]).then(resp => folderUserId = resp.data.entry.id))
.then(() => apis.user.nodes.createFolder(folderDeleted).then(resp => folderDeletedId = resp.data.entry.id))
.then(() => apis.user.nodes.createFiles([ fileDeleted ], folderDeleted).then(resp => fileDeletedId = resp.data.entry.id))
.then(() => apis.user.nodes.createFolder(folderNotDeleted).then(resp => folderNotDeletedId = resp.data.entry.id))
.then(() => apis.user.nodes.createFiles([ fileInFolder ], folderNotDeleted).then(resp => fileInFolderId = resp.data.entry.id))
.then(() => apis.admin.nodes.deleteNodesById([ fileAdminId, folderAdminId ], false)) .then(() => apis.admin.nodes.deleteNodesById([ fileAdminId, folderAdminId ], false))
.then(() => apis.user.nodes.deleteNodesById([ fileSiteId, fileUserId, folderUserId ], false)) .then(() => apis.user.nodes.deleteNodesById([ fileSiteId, fileUserId, folderUserId, fileInFolderId ], false))
.then(() => apis.user.nodes.deleteNodeById(fileDeletedId, false))
.then(() => apis.user.nodes.deleteNodeById(folderDeletedId, false))
.then(done); .then(done);
}); });
@ -72,6 +84,7 @@ describe('Trash', () => {
afterAll(done => { afterAll(done => {
Promise.all([ Promise.all([
apis.admin.sites.deleteSite(siteName), apis.admin.sites.deleteSite(siteName),
apis.user.nodes.deleteNodeById(folderNotDeletedId),
apis.admin.trashcan.emptyTrash() apis.admin.trashcan.emptyTrash()
]) ])
.then(done); .then(done);
@ -94,7 +107,7 @@ describe('Trash', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('has the correct columns', () => { it('has the correct columns - [C213217]', () => {
const labels = [ 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ]; const labels = [ 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ];
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
@ -105,8 +118,8 @@ describe('Trash', () => {
}); });
}); });
it('displays the files and folders deleted by everyone [C213217]', () => { it('displays the files and folders deleted by everyone - [C280493]', () => {
expect(dataTable.countRows()).toEqual(5, 'Incorrect number of deleted items displayed'); expect(dataTable.countRows()).toEqual(8, 'Incorrect number of deleted items displayed');
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} 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(folderAdmin).isPresent()).toBe(true, `${folderAdmin} not displayed`);
@ -131,7 +144,7 @@ describe('Trash', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('has the correct columns', () => { it('has the correct columns - [C280494]', () => {
const labels = [ 'Name', 'Location', 'Size', 'Deleted']; const labels = [ 'Name', 'Location', 'Size', 'Deleted'];
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label)); const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
@ -142,8 +155,8 @@ describe('Trash', () => {
}); });
}); });
it('displays the files and folders deleted by the user [C213218]', () => { it('displays the files and folders deleted by the user - [C213218]', () => {
expect(dataTable.countRows()).toEqual(3, 'Incorrect number of deleted items displayed'); expect(dataTable.countRows()).toEqual(6, 'Incorrect number of deleted items displayed');
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`); expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
expect(dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`); expect(dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
@ -151,17 +164,38 @@ describe('Trash', () => {
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(false, `${fileAdmin} is displayed`); expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(false, `${fileAdmin} is displayed`);
}); });
it('default sorting column [C213219]', () => { it('default sorting column - [C213219]', () => {
expect(dataTable.getSortedColumnHeader().getText()).toBe('Deleted'); expect(dataTable.getSortedColumnHeader().getText()).toBe('Deleted');
expect(dataTable.getSortingOrder()).toBe('desc'); expect(dataTable.getSortingOrder()).toBe('desc');
}); });
it('Location column redirect - file in user Home [C217144] [C260968]', () => { it('Location column displays the parent folder of the file - [C280498]', () => {
expect(dataTable.getItemLocation(fileInFolder).getText()).toEqual(folderNotDeleted);
expect(dataTable.getItemLocation(fileUser).getText()).toEqual('Personal Files');
expect(dataTable.getItemLocation(fileSite).getText()).toEqual(siteName);
});
it('Location column displays a tooltip with the entire path of the file - [C280499]', () => {
expect(dataTable.getItemLocationTileAttr(fileInFolder)).toEqual(`Personal Files/${folderNotDeleted}`);
expect(dataTable.getItemLocationTileAttr(fileUser)).toEqual('Personal Files');
expect(dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}`);
});
it('Location column is empty if parent folder no longer exists - [C280500]', () => {
expect(dataTable.getItemLocation(fileDeleted).getText()).toEqual('');
});
it('Location column redirect - file in user Home - [C217144]', () => {
dataTable.clickItemLocation(fileUser) dataTable.clickItemLocation(fileUser)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ])); .then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
}); });
it('Location column redirect - file in site [C217144] [C260969]', () => { it('Location column redirect - file in folder - [C280496]', () => {
dataTable.clickItemLocation(fileInFolder)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderNotDeleted ]));
});
it('Location column redirect - file in site - [C280497]', () => {
dataTable.clickItemLocation(fileSite) dataTable.clickItemLocation(fileSite)
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ])); .then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]));
}); });

View File

@ -85,7 +85,7 @@ describe('Breadcrumb', () => {
.then(done); .then(done);
}); });
it('Personal Files breadcrumb main node [C260964]', () => { it('Personal Files breadcrumb main node - [C260964]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => { .then(() => {
expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items'); expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items');
@ -93,7 +93,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('File Libraries breadcrumb main node [C260966]', () => { it('File Libraries breadcrumb main node - [C260966]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => { .then(() => {
expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items'); expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items');
@ -101,7 +101,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('Recent Files breadcrumb main node [C260971]', () => { it('Recent Files breadcrumb main node - [C260971]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => { .then(() => {
expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items'); expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items');
@ -109,7 +109,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('Shared Files breadcrumb main node [C260972]', () => { it('Shared Files breadcrumb main node - [C260972]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => { .then(() => {
expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items'); expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items');
@ -117,7 +117,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('Favorites breadcrumb main node [C260973]', () => { it('Favorites breadcrumb main node - [C260973]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => { .then(() => {
expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items'); expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items');
@ -125,7 +125,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('Trash breadcrumb main node [C260974]', () => { it('Trash breadcrumb main node - [C260974]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
.then(() => { .then(() => {
expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items'); expect(breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items');
@ -133,7 +133,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('Personal Files breadcrumb for a folder hierarchy [C260965]', () => { it('Personal Files breadcrumb for a folder hierarchy - [C260965]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader()) .then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnRowByName(parent)) .then(() => page.dataTable.doubleClickOnRowByName(parent))
@ -145,7 +145,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('File Libraries breadcrumb for a folder hierarchy [C260967]', () => { it('File Libraries breadcrumb for a folder hierarchy - [C260967]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => page.dataTable.waitForHeader()) .then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnRowByName(siteName)) .then(() => page.dataTable.doubleClickOnRowByName(siteName))
@ -158,7 +158,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('User can navigate to any location by clicking on a step from the breadcrumb [C213235]', () => { it('User can navigate to any location by clicking on a step from the breadcrumb - [C213235]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader()) .then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnRowByName(parent)) .then(() => page.dataTable.doubleClickOnRowByName(parent))
@ -171,7 +171,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('Tooltip appears on hover on a step in breadcrumb [C213237]', () => { it('Tooltip appears on hover on a step in breadcrumb - [C213237]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader()) .then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnRowByName(parent)) .then(() => page.dataTable.doubleClickOnRowByName(parent))
@ -182,7 +182,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('Breadcrumb updates correctly when folder is renamed [C213238]', () => { it('Breadcrumb updates correctly when folder is renamed - [C213238]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader()) .then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnRowByName(parent2)) .then(() => page.dataTable.doubleClickOnRowByName(parent2))
@ -196,7 +196,7 @@ describe('Breadcrumb', () => {
}); });
}); });
it('Browser back navigates to previous location regardless of breadcrumb steps [C213240]', () => { it('Browser back navigates to previous location regardless of breadcrumb steps - [C213240]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => page.dataTable.waitForHeader()) .then(() => page.dataTable.waitForHeader())
.then(() => page.dataTable.doubleClickOnRowByName(parent)) .then(() => page.dataTable.doubleClickOnRowByName(parent))
@ -233,7 +233,7 @@ describe('Breadcrumb', () => {
.then(done); .then(done);
}); });
it(`Breadcrumb on navigation to a user's home [C260970]`, () => { it(`Breadcrumb on navigation to a user's home - [C260970]`, () => {
page.dataTable.doubleClickOnRowByName('User Homes') page.dataTable.doubleClickOnRowByName('User Homes')
.then(() => page.dataTable.doubleClickOnRowByName(user2)) .then(() => page.dataTable.doubleClickOnRowByName(user2))
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', 'User Homes', user2 ])) .then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', 'User Homes', user2 ]))

View File

@ -42,12 +42,12 @@ describe('Sidebar', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('has "Personal Files" as default', () => { it('has "Personal Files" as default - [C217149]', () => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
expect(sidenav.isActiveByLabel('Personal Files')).toBe(true, 'Active link'); expect(sidenav.isActiveByLabel('Personal Files')).toBe(true, 'Active link');
}); });
it('navigates to "File Libraries"', () => { it('navigates to "File Libraries" - [C217150]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.FILE_LIBRARIES); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.FILE_LIBRARIES);
@ -55,7 +55,7 @@ describe('Sidebar', () => {
}); });
}); });
it('navigates to "Personal Files"', () => { it('navigates to "Personal Files" - [C280409]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
@ -63,7 +63,7 @@ describe('Sidebar', () => {
}); });
}); });
it('navigates to "Shared Files"', () => { it('navigates to "Shared Files" - [C213110]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.SHARED_FILES); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.SHARED_FILES);
@ -71,7 +71,7 @@ describe('Sidebar', () => {
}); });
}); });
it('navigates to "Recent Files"', () => { it('navigates to "Recent Files" - [C213166]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.RECENT_FILES); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.RECENT_FILES);
@ -79,7 +79,7 @@ describe('Sidebar', () => {
}); });
}); });
it('navigates to "Favorites"', () => { it('navigates to "Favorites" - [C213225]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.FAVORITES); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.FAVORITES);
@ -87,7 +87,7 @@ describe('Sidebar', () => {
}); });
}); });
it('navigates to "Trash"', () => { it('navigates to "Trash" - [C213216]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
.then(() => { .then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.TRASHCAN); expect(browser.getCurrentUrl()).toContain(APP_ROUTES.TRASHCAN);
@ -95,42 +95,48 @@ describe('Sidebar', () => {
}); });
}); });
it('Personal Files tooltip', () => { // TODO: incomplete test
xit('Personal Files tooltip - [C217151]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => { .then(() => {
expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.PERSONAL_FILES)).toContain('View your Personal Files'); expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.PERSONAL_FILES)).toContain('View your Personal Files');
}); });
}); });
it('File Libraries tooltip', () => { // TODO: incomplete test
xit('File Libraries tooltip - [C217152]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
.then(() => { .then(() => {
expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.FILE_LIBRARIES)).toContain('Access File Libraries'); expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.FILE_LIBRARIES)).toContain('Access File Libraries');
}); });
}); });
it('Shared Files tooltip', () => { // TODO: incomplete test
xit('Shared Files tooltip - [C213111]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => { .then(() => {
expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.SHARED_FILES)).toContain('View files that have been shared'); expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.SHARED_FILES)).toContain('View files that have been shared');
}); });
}); });
it('Recent Files tooltip', () => { // TODO: incomplete test
xit('Recent Files tooltip - [C213167]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => { .then(() => {
expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.RECENT_FILES)).toContain('View files you recently edited'); expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.RECENT_FILES)).toContain('View files you recently edited');
}); });
}); });
it('Favorites tooltip', () => { // TODO: incomplete test
xit('Favorites tooltip - [C217153]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => { .then(() => {
expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.FAVORITES)).toContain('View your favorite files and folders'); expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.FAVORITES)).toContain('View your favorite files and folders');
}); });
}); });
it('Trash tooltip', () => { // TODO: incomplete test
xit('Trash tooltip - [C217154]', () => {
sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
.then(() => { .then(() => {
expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.TRASH)).toContain('View deleted files in the trash'); expect(sidenav.getLinkTooltip(SIDEBAR_LABELS.TRASH)).toContain('View deleted files in the trash');

View File

@ -66,7 +66,7 @@ describe('Pagination on Favorites', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('pagination controls not displayed [C213164]', () => { it('pagination controls not displayed - [C280111]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => { .then(() => {
expect(pagination.range.isPresent()).toBe(false); expect(pagination.range.isPresent()).toBe(false);
@ -95,7 +95,7 @@ describe('Pagination on Favorites', () => {
.then(done); .then(done);
}); });
it('page selector not displayed when having a single page [C213165]', () => { it('page selector not displayed when having a single page - [C280112]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed')); .then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'));
@ -130,7 +130,7 @@ describe('Pagination on Favorites', () => {
.then(done); .then(done);
}); });
it('default values [C213157]', () => { it('Pagination control default values - [C280113]', () => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(pagination.maxItems.getText()).toContain('25'); expect(pagination.maxItems.getText()).toContain('25');
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
@ -139,7 +139,7 @@ describe('Pagination on Favorites', () => {
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
}); });
it('page sizes [C213157]', () => { it('Items per page values - [C280114]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => { .then(() => {
const [ first, second, third ] = [1, 2, 3] const [ first, second, third ] = [1, 2, 3]
@ -148,32 +148,44 @@ describe('Pagination on Favorites', () => {
expect(second).toBe('50'); expect(second).toBe('50');
expect(third).toBe('100'); expect(third).toBe('100');
}) })
.then(() => pagination.menu.closeMenu()); .then(() => pagination.menu.closeMenu());
}); });
it('change the page size [C213158]', () => { it('current page menu items - [C280115]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => pagination.menu.clickMenuItem('25'))
.then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('25');
expect(pagination.getText(pagination.totalPages)).toContain('of 5');
})
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('50')) .then(() => pagination.menu.clickMenuItem('50'))
.then(() => { .then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('50'); expect(pagination.getText(pagination.maxItems)).toContain('50');
expect(pagination.getText(pagination.totalPages)).toContain('of 3'); expect(pagination.getText(pagination.totalPages)).toContain('of 3');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(3))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu()) .then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('100')) .then(() => pagination.menu.clickMenuItem('100'))
.then(() => { .then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('100'); expect(pagination.getText(pagination.maxItems)).toContain('100');
expect(pagination.getText(pagination.totalPages)).toContain('of 2'); expect(pagination.getText(pagination.totalPages)).toContain('of 2');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(2))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.resetToDefaultPageSize()); .then(() => pagination.resetToDefaultPageSize());
}); });
it('current page menu items', () => { it('change the current page from menu - [C280116]', () => {
pagination.openCurrentPageMenu()
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu());
});
it('change the current page from menu [C260518]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(3)) .then(() => pagination.menu.clickNthItem(3))
.then(() => { .then(() => {
@ -186,18 +198,16 @@ describe('Pagination on Favorites', () => {
.then(() => pagination.resetToDefaultPageNumber()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('navigate to next page [C213160]', () => { it('navigate to next and previous pages - [C280119]', () => {
pagination.nextButton.click() pagination.nextButton.click()
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101'); expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber())
});
it('navigate to previous page [C213160]', () => { .then(() => pagination.openCurrentPageMenu())
pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(2)) .then(() => pagination.menu.clickNthItem(2))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => pagination.previousButton.click()) .then(() => pagination.previousButton.click())
@ -210,12 +220,12 @@ describe('Pagination on Favorites', () => {
.then(() => pagination.resetToDefaultPageNumber()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('Previous button is disabled on first page [C260519]', () => { it('Previous button is disabled on first page - [C280117]', () => {
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page');
}); });
it('Next button is disabled on last page [C260519]', () => { it('Next button is disabled on last page - [C280118]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(5)) .then(() => pagination.menu.clickNthItem(5))
.then(() => { .then(() => {

View File

@ -65,7 +65,7 @@ describe('Pagination on Personal Files', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('pagination controls not displayed [C213164]', () => { it('pagination controls not displayed - [C280075]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => { .then(() => {
expect(pagination.range.isPresent()).toBe(false); expect(pagination.range.isPresent()).toBe(false);
@ -93,7 +93,7 @@ describe('Pagination on Personal Files', () => {
.then(done); .then(done);
}); });
it('page selector not displayed when having a single page [C213165]', () => { it('page selector not displayed when having a single page - [C280076]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed')); .then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'));
@ -126,7 +126,7 @@ describe('Pagination on Personal Files', () => {
.then(done); .then(done);
}); });
it('default values [C213157]', () => { it('Pagination control default values - [C280077]', () => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(pagination.maxItems.getText()).toContain('25'); expect(pagination.maxItems.getText()).toContain('25');
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
@ -135,7 +135,7 @@ describe('Pagination on Personal Files', () => {
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
}); });
it('page sizes [C213157]', () => { it('Items per page values - [C280078]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => { .then(() => {
const [ first, second, third ] = [1, 2, 3] const [ first, second, third ] = [1, 2, 3]
@ -144,33 +144,44 @@ describe('Pagination on Personal Files', () => {
expect(second).toBe('50'); expect(second).toBe('50');
expect(third).toBe('100'); expect(third).toBe('100');
}) })
.then(() => pagination.menu.closeMenu()); .then(() => pagination.menu.closeMenu());
}); });
it('change the page size [C213158]', () => { it('current page menu items - [C280079]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => pagination.menu.clickMenuItem('50')) .then(() => pagination.menu.clickMenuItem('25'))
.then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.maxItems.getText()).toContain('50'); expect(pagination.getText(pagination.maxItems)).toContain('25');
expect(pagination.totalPages.getText()).toContain('of 3'); expect(pagination.getText(pagination.totalPages)).toContain('of 5');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('50'))
.then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('50');
expect(pagination.getText(pagination.totalPages)).toContain('of 3');
})
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(3))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu()) .then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('100')) .then(() => pagination.menu.clickMenuItem('100'))
.then(() => { .then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('100'); expect(pagination.getText(pagination.maxItems)).toContain('100');
expect(pagination.getText(pagination.totalPages)).toContain('of 2'); expect(pagination.getText(pagination.totalPages)).toContain('of 2');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(2))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.resetToDefaultPageSize()); .then(() => pagination.resetToDefaultPageSize());
}); });
it('current page menu items', () => { it('change the current page from menu - [C280080]', () => {
pagination.openCurrentPageMenu()
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu());
});
it('change the current page from menu [C260518]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(3)) .then(() => pagination.menu.clickNthItem(3))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
@ -185,7 +196,7 @@ describe('Pagination on Personal Files', () => {
.then(() => pagination.resetToDefaultPageNumber()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('navigate to next page [C213160]', () => { it('navigate to next and previous pages - [C280083]', () => {
pagination.clickNext() pagination.clickNext()
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -193,29 +204,27 @@ describe('Pagination on Personal Files', () => {
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber())
});
it('navigate to previous page [C213160]', () => { .then(() => pagination.openCurrentPageMenu())
pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(2)) .then(() => pagination.menu.clickNthItem(2))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => pagination.clickPrevious()) .then(() => pagination.previousButton.click())
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('Previous button is disabled on first page [C260519]', () => { it('Previous button is disabled on first page - [C280081]', () => {
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page');
}); });
it('Next button is disabled on last page [C260519]', () => { it('Next button is disabled on last page - [C280082]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(5)) .then(() => pagination.menu.clickNthItem(5))
.then(() => { .then(() => {

View File

@ -65,7 +65,7 @@ describe('Pagination on Recent Files', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('pagination controls not displayed [C213164]', () => { it('pagination controls not displayed - [C280102]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => { .then(() => {
expect(pagination.range.isPresent()).toBe(false); expect(pagination.range.isPresent()).toBe(false);
@ -94,7 +94,7 @@ describe('Pagination on Recent Files', () => {
.then(done); .then(done);
}); });
it('page selector not displayed when having a single page [C213165]', () => { it('page selector not displayed when having a single page - [C280103]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed')); .then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'));
@ -128,7 +128,7 @@ describe('Pagination on Recent Files', () => {
.then(done); .then(done);
}); });
it('default values [C213157]', () => { it('Pagination control default values - [C280104]', () => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(pagination.maxItems.getText()).toContain('25'); expect(pagination.maxItems.getText()).toContain('25');
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
@ -137,7 +137,7 @@ describe('Pagination on Recent Files', () => {
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
}); });
it('page sizes [C213157]', () => { it('Items per page values - [C280105]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => { .then(() => {
const [ first, second, third ] = [1, 2, 3] const [ first, second, third ] = [1, 2, 3]
@ -146,33 +146,44 @@ describe('Pagination on Recent Files', () => {
expect(second).toBe('50'); expect(second).toBe('50');
expect(third).toBe('100'); expect(third).toBe('100');
}) })
.then(() => pagination.menu.closeMenu()); .then(() => pagination.menu.closeMenu());
}); });
it('change the page size [C213158]', () => { it('current page menu items - [C280106]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => pagination.menu.clickMenuItem('50')) .then(() => pagination.menu.clickMenuItem('25'))
.then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.maxItems.getText()).toContain('50'); expect(pagination.getText(pagination.maxItems)).toContain('25');
expect(pagination.totalPages.getText()).toContain('of 3'); expect(pagination.getText(pagination.totalPages)).toContain('of 5');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('50'))
.then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('50');
expect(pagination.getText(pagination.totalPages)).toContain('of 3');
})
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(3))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu()) .then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('100')) .then(() => pagination.menu.clickMenuItem('100'))
.then(() => { .then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('100'); expect(pagination.getText(pagination.maxItems)).toContain('100');
expect(pagination.getText(pagination.totalPages)).toContain('of 2'); expect(pagination.getText(pagination.totalPages)).toContain('of 2');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(2))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.resetToDefaultPageSize()); .then(() => pagination.resetToDefaultPageSize());
}); });
it('current page menu items', () => { it('change the current page from menu - [C280107]', () => {
pagination.openCurrentPageMenu()
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu());
});
it('change the current page from menu [C260518]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(3)) .then(() => pagination.menu.clickNthItem(3))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
@ -187,7 +198,7 @@ describe('Pagination on Recent Files', () => {
.then(() => pagination.resetToDefaultPageNumber()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('navigate to next page [C213160]', () => { it('navigate to next and previous pages - [C280110]', () => {
pagination.nextButton.click() pagination.nextButton.click()
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -195,29 +206,27 @@ describe('Pagination on Recent Files', () => {
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber())
});
it('navigate to previous page [C213160]', () => { .then(() => pagination.openCurrentPageMenu())
pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(2)) .then(() => pagination.menu.clickNthItem(2))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => pagination.previousButton.click()) .then(() => pagination.previousButton.click())
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('Previous button is disabled on first page [C260519]', () => { it('Previous button is disabled on first page - [C280108]', () => {
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page');
}); });
it('Next button is disabled on last page [C260519]', () => { it('Next button is disabled on last page - [C280109]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(5)) .then(() => pagination.menu.clickNthItem(5))
.then(() => { .then(() => {

View File

@ -66,7 +66,7 @@ describe('Pagination on Shared Files', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('pagination controls not displayed [C213164]', () => { it('pagination controls not displayed - [C280094]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => { .then(() => {
expect(pagination.range.isPresent()).toBe(false); expect(pagination.range.isPresent()).toBe(false);
@ -96,7 +96,7 @@ describe('Pagination on Shared Files', () => {
.then(done); .then(done);
}); });
it('page selector not displayed when having a single page [C213165]', () => { it('page selector not displayed when having a single page - [C280094]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed')); .then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'));
@ -133,7 +133,7 @@ describe('Pagination on Shared Files', () => {
.then(done); .then(done);
}); });
it('default values [C213157]', () => { it('Pagination control default values - [C280095]', () => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(pagination.maxItems.getText()).toContain('25'); expect(pagination.maxItems.getText()).toContain('25');
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
@ -142,7 +142,7 @@ describe('Pagination on Shared Files', () => {
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
}); });
it('page sizes [C213157]', () => { it('Items per page values - [C280096]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => { .then(() => {
const [ first, second, third ] = [1, 2, 3] const [ first, second, third ] = [1, 2, 3]
@ -151,33 +151,44 @@ describe('Pagination on Shared Files', () => {
expect(second).toBe('50'); expect(second).toBe('50');
expect(third).toBe('100'); expect(third).toBe('100');
}) })
.then(() => pagination.menu.closeMenu()); .then(() => pagination.menu.closeMenu());
}); });
it('change the page size [C213158]', () => { it('current page menu items - [C280097]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => pagination.menu.clickMenuItem('50')) .then(() => pagination.menu.clickMenuItem('25'))
.then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.maxItems.getText()).toContain('50'); expect(pagination.getText(pagination.maxItems)).toContain('25');
expect(pagination.totalPages.getText()).toContain('of 3'); expect(pagination.getText(pagination.totalPages)).toContain('of 5');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('50'))
.then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('50');
expect(pagination.getText(pagination.totalPages)).toContain('of 3');
})
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(3))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu()) .then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('100')) .then(() => pagination.menu.clickMenuItem('100'))
.then(() => { .then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('100'); expect(pagination.getText(pagination.maxItems)).toContain('100');
expect(pagination.getText(pagination.totalPages)).toContain('of 2'); expect(pagination.getText(pagination.totalPages)).toContain('of 2');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(2))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.resetToDefaultPageSize()); .then(() => pagination.resetToDefaultPageSize());
}); });
it('current page menu items', () => { it('change the current page from menu - [C280098]', () => {
pagination.openCurrentPageMenu()
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu());
});
it('change the current page from menu [C260518]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(3)) .then(() => pagination.menu.clickNthItem(3))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
@ -193,7 +204,7 @@ describe('Pagination on Shared Files', () => {
.then(() => pagination.resetToDefaultPageNumber()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('navigate to next page [C213160]', () => { it('navigate to next and previous pages - [C280101]', () => {
pagination.nextButton.click() pagination.nextButton.click()
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -201,29 +212,27 @@ describe('Pagination on Shared Files', () => {
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber())
});
it('navigate to previous page [C213160]', () => { .then(() => pagination.openCurrentPageMenu())
pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(2)) .then(() => pagination.menu.clickNthItem(2))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => pagination.previousButton.click()) .then(() => pagination.previousButton.click())
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('Previous button is disabled on first page [C260519]', () => { it('Previous button is disabled on first page - [C280099]', () => {
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page');
}); });
it('Next button is disabled on last page [C260519]', () => { it('Next button is disabled on last page - [C280100]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(5)) .then(() => pagination.menu.clickNthItem(5))
.then(() => { .then(() => {

View File

@ -65,7 +65,7 @@ describe('Pagination on Trash', () => {
logoutPage.load().then(done); logoutPage.load().then(done);
}); });
it('pagination controls not displayed [C213164]', () => { it('pagination controls not displayed - [C280120]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
.then(() => { .then(() => {
expect(pagination.range.isPresent()).toBe(false); expect(pagination.range.isPresent()).toBe(false);
@ -95,7 +95,7 @@ describe('Pagination on Trash', () => {
.then(done); .then(done);
}); });
it('page selector not displayed when having a single page [C213165]', () => { it('page selector not displayed when having a single page - [C280121]', () => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH) page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed')); .then(() => expect(pagination.pagesButton.isPresent()).toBe(false, 'page selector displayed'));
@ -131,7 +131,7 @@ describe('Pagination on Trash', () => {
.then(done); .then(done);
}); });
it('default values [C213157]', () => { it('Pagination control default values - [C280122]', () => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(pagination.maxItems.getText()).toContain('25'); expect(pagination.maxItems.getText()).toContain('25');
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
@ -140,7 +140,7 @@ describe('Pagination on Trash', () => {
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled'); expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
}); });
it('page sizes [C213157]', () => { it('Items per page values - [C280123]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => { .then(() => {
const [ first, second, third ] = [1, 2, 3] const [ first, second, third ] = [1, 2, 3]
@ -149,33 +149,44 @@ describe('Pagination on Trash', () => {
expect(second).toBe('50'); expect(second).toBe('50');
expect(third).toBe('100'); expect(third).toBe('100');
}) })
.then(() => pagination.menu.closeMenu()); .then(() => pagination.menu.closeMenu());
}); });
it('change the page size [C213158]', () => { it('current page menu items - [C280124]', () => {
pagination.openMaxItemsMenu() pagination.openMaxItemsMenu()
.then(() => pagination.menu.clickMenuItem('50')) .then(() => pagination.menu.clickMenuItem('25'))
.then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.maxItems.getText()).toContain('50'); expect(pagination.getText(pagination.maxItems)).toContain('25');
expect(pagination.totalPages.getText()).toContain('of 3'); expect(pagination.getText(pagination.totalPages)).toContain('of 5');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('50'))
.then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('50');
expect(pagination.getText(pagination.totalPages)).toContain('of 3');
})
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(3))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.openMaxItemsMenu()) .then(() => pagination.openMaxItemsMenu())
.then(() => pagination.menu.clickMenuItem('100')) .then(() => pagination.menu.clickMenuItem('100'))
.then(() => { .then(() => {
expect(pagination.getText(pagination.maxItems)).toContain('100'); expect(pagination.getText(pagination.maxItems)).toContain('100');
expect(pagination.getText(pagination.totalPages)).toContain('of 2'); expect(pagination.getText(pagination.totalPages)).toContain('of 2');
}) })
.then(() => pagination.openCurrentPageMenu())
.then(() => expect(pagination.menu.getItemsCount()).toBe(2))
.then(() => pagination.menu.closeMenu())
.then(() => pagination.resetToDefaultPageSize()); .then(() => pagination.resetToDefaultPageSize());
}); });
it('current page menu items', () => { it('change the current page from menu - [C280125]', () => {
pagination.openCurrentPageMenu()
.then(() => expect(pagination.menu.getItemsCount()).toBe(5))
.then(() => pagination.menu.closeMenu());
});
it('change the current page from menu [C260518]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(3)) .then(() => pagination.menu.clickNthItem(3))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
@ -190,7 +201,7 @@ describe('Pagination on Trash', () => {
.then(() => pagination.resetToDefaultPageNumber()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('navigate to next page [C213160]', () => { it('navigate to next and previous pages - [C280128]', () => {
pagination.nextButton.click() pagination.nextButton.click()
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
@ -198,29 +209,27 @@ describe('Pagination on Trash', () => {
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber())
});
it('navigate to previous page [C213160]', () => { .then(() => pagination.openCurrentPageMenu())
pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(2)) .then(() => pagination.menu.clickNthItem(2))
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => pagination.previousButton.click()) .then(() => pagination.previousButton.click())
.then(() => dataTable.waitForHeader()) .then(() => dataTable.waitForHeader())
.then(() => { .then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101'); expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowByName('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()); .then(() => pagination.resetToDefaultPageNumber());
}); });
it('Previous button is disabled on first page [C260519]', () => { it('Previous button is disabled on first page - [C280126]', () => {
expect(pagination.currentPage.getText()).toContain('Page 1'); expect(pagination.currentPage.getText()).toContain('Page 1');
expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page'); expect(pagination.previousButton.isEnabled()).toBe(false, 'Previous button is enabled on first page');
}); });
it('Next button is disabled on last page [C260519]', () => { it('Next button is disabled on last page - [C280127]', () => {
pagination.openCurrentPageMenu() pagination.openCurrentPageMenu()
.then(() => pagination.menu.clickNthItem(5)) .then(() => pagination.menu.clickNthItem(5))
.then(() => { .then(() => {

View File

@ -11,7 +11,7 @@ const width = 1366;
const height = 768; const height = 768;
exports.config = { exports.config = {
allScriptsTimeout: 60000, allScriptsTimeout: 40000,
specs: [ specs: [
'./e2e/suites/authentication/*.test.ts', './e2e/suites/authentication/*.test.ts',
@ -39,7 +39,7 @@ exports.config = {
framework: 'jasmine2', framework: 'jasmine2',
jasmineNodeOpts: { jasmineNodeOpts: {
showColors: true, showColors: true,
defaultTimeoutInterval: 90000, defaultTimeoutInterval: 60000,
print: function() {} print: function() {}
}, },