split toolbar and breadcrumb e2e components (#626)

This commit is contained in:
Adina Parpalita
2018-09-13 11:01:16 +03:00
committed by Denys Vuika
parent 28a4fb7ba7
commit aafa606ceb
22 changed files with 398 additions and 444 deletions

View File

@@ -26,18 +26,18 @@
import { ElementFinder, ElementArrayFinder, by, promise } from 'protractor'; import { ElementFinder, ElementArrayFinder, by, promise } from 'protractor';
import { Component } from '../component'; import { Component } from '../component';
export class ToolbarBreadcrumb extends Component { export class Breadcrumb extends Component {
private static selectors = { private static selectors = {
root: 'adf-breadcrumb', root: 'adf-breadcrumb',
item: '.adf-breadcrumb-item', item: '.adf-breadcrumb-item',
currentItem: '.adf-breadcrumb-item-current' currentItem: '.adf-breadcrumb-item-current'
}; };
items: ElementArrayFinder = this.component.all(by.css(ToolbarBreadcrumb.selectors.item)); items: ElementArrayFinder = this.component.all(by.css(Breadcrumb.selectors.item));
currentItem: ElementFinder = this.component.element(by.css(ToolbarBreadcrumb.selectors.currentItem)); currentItem: ElementFinder = this.component.element(by.css(Breadcrumb.selectors.currentItem));
constructor(ancestor?: ElementFinder) { constructor(ancestor?: ElementFinder) {
super(ToolbarBreadcrumb.selectors.root, ancestor); super(Breadcrumb.selectors.root, ancestor);
} }
getNthItem(nth: number): ElementFinder { getNthItem(nth: number): ElementFinder {
@@ -69,7 +69,7 @@ export class ToolbarBreadcrumb extends Component {
} }
clickItem(name: string) { clickItem(name: string) {
return this.component.element(by.css(`${ToolbarBreadcrumb.selectors.item}[title=${name}]`)).click(); return this.component.element(by.css(`${Breadcrumb.selectors.item}[title=${name}]`)).click();
} }
clickNthItem(nth: number) { clickNthItem(nth: number) {

View File

@@ -32,4 +32,5 @@ export * from './dialog/create-edit-folder-dialog';
export * from './pagination/pagination'; export * from './pagination/pagination';
export * from './sidenav/sidenav'; export * from './sidenav/sidenav';
export * from './toolbar/toolbar'; export * from './toolbar/toolbar';
export * from './breadcrumb/breadcrumb';
export * from './viewer/viewer'; export * from './viewer/viewer';

View File

@@ -1,73 +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 { ElementFinder, ElementArrayFinder, by, promise, protractor, browser } from 'protractor';
import { Menu } from '../menu/menu';
import { Component } from '../component';
export class ToolbarActions extends Component {
private static selectors = {
root: 'adf-toolbar',
button: '.mat-icon-button'
};
menu: Menu = new Menu();
buttons: ElementArrayFinder = this.component.all(by.css(ToolbarActions.selectors.button));
constructor(ancestor?: ElementFinder) {
super(ToolbarActions.selectors.root, ancestor);
}
async isEmpty() {
return await this.buttons.count() === 0;
}
async isButtonPresent(title: string) {
return await this.component.element(by.css(`${ToolbarActions.selectors.button}[title="${title}"]`)).isPresent();
}
getButtonByLabel(label: string) {
return this.component.element(by.cssContainingText(ToolbarActions.selectors.button, label));
}
getButtonByTitleAttribute(title: string) {
return this.component.element(by.css(`${ToolbarActions.selectors.button}[title="${title}"]`));
}
async openMoreMenu() {
await this.getButtonByTitleAttribute('More actions').click();
await this.menu.waitForMenuToOpen();
return this.menu;
}
async closeMoreMenu() {
return await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
async getButtonTooltip(button: ElementFinder) {
return await button.getAttribute('title');
}
}

View File

@@ -23,20 +23,51 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { ElementFinder } from 'protractor'; import { ElementFinder, ElementArrayFinder, by, promise, protractor, browser } from 'protractor';
import { Menu } from '../menu/menu';
import { Component } from '../component'; import { Component } from '../component';
import { ToolbarActions } from './toolbar-actions';
import { ToolbarBreadcrumb } from './toolbar-breadcrumb';
export class Toolbar extends Component { export class Toolbar extends Component {
private static selectors = { private static selectors = {
root: '.inner-layout__header' root: 'adf-toolbar',
button: '.mat-icon-button'
}; };
actions: ToolbarActions = new ToolbarActions(this.component); menu: Menu = new Menu();
breadcrumb: ToolbarBreadcrumb = new ToolbarBreadcrumb(this.component); buttons: ElementArrayFinder = this.component.all(by.css(Toolbar.selectors.button));
constructor(ancestor?: ElementFinder) { constructor(ancestor?: ElementFinder) {
super(Toolbar.selectors.root, ancestor); super(Toolbar.selectors.root, ancestor);
} }
async isEmpty() {
return await this.buttons.count() === 0;
}
async isButtonPresent(title: string) {
return await this.component.element(by.css(`${Toolbar.selectors.button}[title="${title}"]`)).isPresent();
}
getButtonByLabel(label: string) {
return this.component.element(by.cssContainingText(Toolbar.selectors.button, label));
}
getButtonByTitleAttribute(title: string) {
return this.component.element(by.css(`${Toolbar.selectors.button}[title="${title}"]`));
}
async openMoreMenu() {
await this.getButtonByTitleAttribute('More actions').click();
await this.menu.waitForMenuToOpen();
return this.menu;
}
async closeMoreMenu() {
return await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
async getButtonTooltip(button: ElementFinder) {
return await button.getAttribute('title');
}
} }

View File

@@ -26,7 +26,7 @@
import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor'; import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor';
import { Component } from '../component'; import { Component } from '../component';
import { BROWSER_WAIT_TIMEOUT } from '../../configs'; import { BROWSER_WAIT_TIMEOUT } from '../../configs';
import { ToolbarActions } from '../toolbar/toolbar-actions'; import { Toolbar } from '../toolbar/toolbar';
export class Viewer extends Component { export class Viewer extends Component {
private static selectors = { private static selectors = {
@@ -46,7 +46,7 @@ export class Viewer extends Component {
fileTitle: ElementFinder = this.component.element(by.css(Viewer.selectors.fileTitle)); fileTitle: ElementFinder = this.component.element(by.css(Viewer.selectors.fileTitle));
viewerExtensionContent: ElementFinder = this.component.element(by.css(Viewer.selectors.viewerExtensionContent)); viewerExtensionContent: ElementFinder = this.component.element(by.css(Viewer.selectors.viewerExtensionContent));
toolbar = new ToolbarActions(this.component); toolbar = new Toolbar(this.component);
constructor(ancestor?: ElementFinder) { constructor(ancestor?: ElementFinder) {
super(Viewer.selectors.root, ancestor); super(Viewer.selectors.root, ancestor);

View File

@@ -24,13 +24,14 @@
*/ */
import { promise } from 'protractor'; import { promise } from 'protractor';
import { Header, DataTable, Pagination, Toolbar, Sidenav } from '../components/components'; import { Header, DataTable, Pagination, Toolbar, Breadcrumb, Sidenav } from '../components/components';
import { Page } from './page'; import { Page } from './page';
export class BrowsingPage extends Page { export class BrowsingPage extends Page {
header = new Header(this.app); header = new Header(this.app);
sidenav = new Sidenav(this.app); sidenav = new Sidenav(this.app);
toolbar = new Toolbar(this.app); toolbar = new Toolbar(this.app);
breadcrumb = new Breadcrumb(this.app);
dataTable = new DataTable(this.app); dataTable = new DataTable(this.app);
pagination = new Pagination(this.app); pagination = new Pagination(this.app);

View File

@@ -107,8 +107,8 @@ describe('Delete and undo delete', () => {
let items = await page.dataTable.countRows(); let items = await page.dataTable.countRows();
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`${file1} deleted`); expect(message).toContain(`${file1} deleted`);
expect(dataTable.getRowByName(file1).isPresent()).toBe(false, 'Item was not removed from list'); expect(dataTable.getRowByName(file1).isPresent()).toBe(false, 'Item was not removed from list');
@@ -124,8 +124,8 @@ describe('Delete and undo delete', () => {
let items = await page.dataTable.countRows(); let items = await page.dataTable.countRows();
await dataTable.selectMultipleItems([file1, file2]); await dataTable.selectMultipleItems([file1, file2]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Deleted 2 items`); expect(message).toContain(`Deleted 2 items`);
expect(dataTable.getRowByName(file1).isPresent()).toBe(false, `${file1} was not removed from list`); expect(dataTable.getRowByName(file1).isPresent()).toBe(false, `${file1} was not removed from list`);
@@ -144,8 +144,8 @@ describe('Delete and undo delete', () => {
let items = await page.dataTable.countRows(); let items = await page.dataTable.countRows();
await dataTable.selectItem(folder1); await dataTable.selectItem(folder1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
expect(dataTable.getRowByName(folder1).isPresent()).toBe(false, 'Item was not removed from list'); expect(dataTable.getRowByName(folder1).isPresent()).toBe(false, 'Item was not removed from list');
items--; items--;
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`); expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
@@ -158,8 +158,8 @@ describe('Delete and undo delete', () => {
it('delete a folder containing locked files - [C217127]', async () => { it('delete a folder containing locked files - [C217127]', async () => {
await dataTable.selectItem(folder2); await dataTable.selectItem(folder2);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`${folder2} couldn't be deleted`); expect(message).toContain(`${folder2} couldn't be deleted`);
expect(dataTable.getRowByName(folder2).isPresent()).toBe(true, 'Item was removed from list'); expect(dataTable.getRowByName(folder2).isPresent()).toBe(true, 'Item was removed from list');
@@ -170,8 +170,8 @@ describe('Delete and undo delete', () => {
it('notification on multiple items deletion - some items fail to delete - [C217129]', async () => { it('notification on multiple items deletion - some items fail to delete - [C217129]', async () => {
await dataTable.selectMultipleItems([file1, folder2]); await dataTable.selectMultipleItems([file1, folder2]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Deleted 1 item, 1 couldn't be deleted`); expect(message).toContain(`Deleted 1 item, 1 couldn't be deleted`);
@@ -180,16 +180,16 @@ describe('Delete and undo delete', () => {
it('notification on multiple items deletion - all items fail to delete - [C217130]', async () => { it('notification on multiple items deletion - all items fail to delete - [C217130]', async () => {
await dataTable.selectMultipleItems([fileLocked1, folder2]); await dataTable.selectMultipleItems([fileLocked1, folder2]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
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 - [C217131]', async () => { it('successful delete notification shows Undo action - [C217131]', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Undo`); expect(message).toContain(`Undo`);
@@ -198,8 +198,8 @@ describe('Delete and undo delete', () => {
it('unsuccessful delete notification does not show Undo action - [C217134]', async () => { it('unsuccessful delete notification does not show Undo action - [C217134]', async () => {
await dataTable.selectItem(folder2); await dataTable.selectItem(folder2);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).not.toContain(`Undo`); expect(message).not.toContain(`Undo`);
}); });
@@ -208,8 +208,8 @@ describe('Delete and undo delete', () => {
const items = await page.dataTable.countRows(); const items = await page.dataTable.countRows();
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
expect(dataTable.getRowByName(file1).isPresent()).toBe(true, 'Item was not restored'); expect(dataTable.getRowByName(file1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`); expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
@@ -219,8 +219,8 @@ describe('Delete and undo delete', () => {
const items = await page.dataTable.countRows(); const items = await page.dataTable.countRows();
await dataTable.selectItem(folder1); await dataTable.selectItem(folder1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
expect(dataTable.getRowByName(folder1).isPresent()).toBe(true, 'Item was not restored'); expect(dataTable.getRowByName(folder1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`); expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
@@ -232,8 +232,8 @@ describe('Delete and undo delete', () => {
const items = await page.dataTable.countRows(); const items = await page.dataTable.countRows();
await dataTable.selectMultipleItems([file1, file2]); await dataTable.selectMultipleItems([file1, file2]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
expect(dataTable.getRowByName(file1).isPresent()).toBe(true, `${file1} was not removed from list`); 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(dataTable.getRowByName(file2).isPresent()).toBe(true, `${file2} was not removed from list`);
@@ -281,8 +281,8 @@ describe('Delete and undo delete', () => {
it('delete a file and check notification - [C280316]', async () => { it('delete a file and check notification - [C280316]', async () => {
await dataTable.selectItem(sharedFile1); await dataTable.selectItem(sharedFile1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`${sharedFile1} deleted`); expect(message).toContain(`${sharedFile1} deleted`);
expect(dataTable.getRowByName(sharedFile1).isPresent()).toBe(false, 'Item was not removed from list'); expect(dataTable.getRowByName(sharedFile1).isPresent()).toBe(false, 'Item was not removed from list');
@@ -296,8 +296,8 @@ describe('Delete and undo delete', () => {
it('delete multiple files and check notification - [C280513]', async () => { it('delete multiple files and check notification - [C280513]', async () => {
await dataTable.selectMultipleItems([sharedFile2, sharedFile3]); await dataTable.selectMultipleItems([sharedFile2, sharedFile3]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Deleted 2 items`); expect(message).toContain(`Deleted 2 items`);
expect(dataTable.getRowByName(sharedFile2).isPresent()).toBe(false, `${sharedFile2} was not removed from list`); expect(dataTable.getRowByName(sharedFile2).isPresent()).toBe(false, `${sharedFile2} was not removed from list`);
@@ -314,8 +314,8 @@ describe('Delete and undo delete', () => {
it('successful delete notification shows Undo action - [C280323]', async () => { it('successful delete notification shows Undo action - [C280323]', async () => {
await dataTable.selectItem(sharedFile1); await dataTable.selectItem(sharedFile1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Undo`); expect(message).toContain(`Undo`);
@@ -324,8 +324,8 @@ describe('Delete and undo delete', () => {
xit('undo delete of file - [C280324]', async () => { xit('undo delete of file - [C280324]', async () => {
await dataTable.selectItem(sharedFile2); await dataTable.selectItem(sharedFile2);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
expect(dataTable.getRowByName(sharedFile2).isPresent()).toBe(false, 'Item was not restored'); expect(dataTable.getRowByName(sharedFile2).isPresent()).toBe(false, 'Item was not restored');
@@ -333,8 +333,8 @@ describe('Delete and undo delete', () => {
xit('undo delete of multiple files - [C280514]', async () => { xit('undo delete of multiple files - [C280514]', async () => {
await dataTable.selectMultipleItems([sharedFile3, sharedFile4]); await dataTable.selectMultipleItems([sharedFile3, sharedFile4]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
expect(dataTable.getRowByName(sharedFile3).isPresent()).toBe(false, `${sharedFile3} was not restored`); expect(dataTable.getRowByName(sharedFile3).isPresent()).toBe(false, `${sharedFile3} was not restored`);
@@ -401,8 +401,8 @@ describe('Delete and undo delete', () => {
let items = await page.dataTable.countRows(); let items = await page.dataTable.countRows();
await dataTable.selectItem(favoriteFile1); await dataTable.selectItem(favoriteFile1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`${favoriteFile1} deleted`); expect(message).toContain(`${favoriteFile1} deleted`);
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(false, 'Item was not removed from list'); expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(false, 'Item was not removed from list');
@@ -418,8 +418,8 @@ describe('Delete and undo delete', () => {
let items = await page.dataTable.countRows(); let items = await page.dataTable.countRows();
await dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]); await dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Deleted 2 items`); expect(message).toContain(`Deleted 2 items`);
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(false, `${favoriteFile1} was not removed from list`); expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(false, `${favoriteFile1} was not removed from list`);
@@ -437,8 +437,8 @@ describe('Delete and undo delete', () => {
it('delete a folder with content - [C280518]', async () => { it('delete a folder with content - [C280518]', async () => {
let items = await page.dataTable.countRows(); let items = await page.dataTable.countRows();
await dataTable.selectItem(favoriteFolder1); await dataTable.selectItem(favoriteFolder1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(false, 'Item was not removed from list'); expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(false, 'Item was not removed from list');
items--; items--;
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`); expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
@@ -451,8 +451,8 @@ describe('Delete and undo delete', () => {
it('delete a folder containing locked files - [C280519]', async () => { it('delete a folder containing locked files - [C280519]', async () => {
await dataTable.selectItem(favoriteFolder2); await dataTable.selectItem(favoriteFolder2);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`${favoriteFolder2} couldn't be deleted`); expect(message).toContain(`${favoriteFolder2} couldn't be deleted`);
expect(dataTable.getRowByName(favoriteFolder2).isPresent()).toBe(true, 'Item was removed from list'); expect(dataTable.getRowByName(favoriteFolder2).isPresent()).toBe(true, 'Item was removed from list');
@@ -463,8 +463,8 @@ describe('Delete and undo delete', () => {
it('notification on multiple items deletion - some items fail to delete - [C280520]', async () => { it('notification on multiple items deletion - some items fail to delete - [C280520]', async () => {
await dataTable.selectMultipleItems([favoriteFile1, favoriteFolder2]); await dataTable.selectMultipleItems([favoriteFile1, favoriteFolder2]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Deleted 1 item, 1 couldn't be deleted`); expect(message).toContain(`Deleted 1 item, 1 couldn't be deleted`);
@@ -473,16 +473,16 @@ describe('Delete and undo delete', () => {
it('notification on multiple items deletion - all items fail to delete - [C280521]', async () => { it('notification on multiple items deletion - all items fail to delete - [C280521]', async () => {
await dataTable.selectMultipleItems([favoriteFileLocked1, favoriteFolder2]); await dataTable.selectMultipleItems([favoriteFileLocked1, favoriteFolder2]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
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]', async () => { it('successful delete notification shows Undo action - [C280522]', async () => {
await dataTable.selectItem(favoriteFile1); await dataTable.selectItem(favoriteFile1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Undo`); expect(message).toContain(`Undo`);
@@ -491,8 +491,8 @@ describe('Delete and undo delete', () => {
it('unsuccessful delete notification does not show Undo action - [C280523]', async () => { it('unsuccessful delete notification does not show Undo action - [C280523]', async () => {
await dataTable.selectItem(favoriteFolder2); await dataTable.selectItem(favoriteFolder2);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).not.toContain(`Undo`); expect(message).not.toContain(`Undo`);
}); });
@@ -501,8 +501,8 @@ describe('Delete and undo delete', () => {
const items = await page.dataTable.countRows(); const items = await page.dataTable.countRows();
await dataTable.selectItem(favoriteFile1); await dataTable.selectItem(favoriteFile1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, 'Item was not restored'); expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`); expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
@@ -512,8 +512,8 @@ describe('Delete and undo delete', () => {
const items = await page.dataTable.countRows(); const items = await page.dataTable.countRows();
await dataTable.selectItem(favoriteFolder1); await dataTable.selectItem(favoriteFolder1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(true, 'Item was not restored'); expect(dataTable.getRowByName(favoriteFolder1).isPresent()).toBe(true, 'Item was not restored');
expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`); expect(page.pagination.range.getText()).toContain(`1-${items} of ${items}`);
@@ -525,8 +525,8 @@ describe('Delete and undo delete', () => {
const items = await page.dataTable.countRows(); const items = await page.dataTable.countRows();
await dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]); await dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, `${favoriteFile1} was not removed from list`); expect(dataTable.getRowByName(favoriteFile1).isPresent()).toBe(true, `${favoriteFile1} was not removed from list`);
expect(dataTable.getRowByName(favoriteFile2).isPresent()).toBe(true, `${favoriteFile2} was not removed from list`); expect(dataTable.getRowByName(favoriteFile2).isPresent()).toBe(true, `${favoriteFile2} was not removed from list`);
@@ -580,8 +580,8 @@ describe('Delete and undo delete', () => {
xit('delete a file and check notification - [C280528]', async () => { xit('delete a file and check notification - [C280528]', async () => {
await dataTable.selectItem(recentFile1); await dataTable.selectItem(recentFile1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`${recentFile1} deleted`); expect(message).toContain(`${recentFile1} deleted`);
expect(dataTable.getRowByName(recentFile1).isPresent()).toBe(false, 'Item was not removed from list'); expect(dataTable.getRowByName(recentFile1).isPresent()).toBe(false, 'Item was not removed from list');
@@ -594,8 +594,8 @@ describe('Delete and undo delete', () => {
xit('delete multiple files and check notification - [C280529]', async () => { xit('delete multiple files and check notification - [C280529]', async () => {
await dataTable.selectMultipleItems([recentFile2, recentFile3]); await dataTable.selectMultipleItems([recentFile2, recentFile3]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Deleted 2 items`); expect(message).toContain(`Deleted 2 items`);
expect(dataTable.getRowByName(recentFile2).isPresent()).toBe(false, `${recentFile2} was not removed from list`); expect(dataTable.getRowByName(recentFile2).isPresent()).toBe(false, `${recentFile2} was not removed from list`);
@@ -611,8 +611,8 @@ describe('Delete and undo delete', () => {
xit('successful delete notification shows Undo action - [C280534]', async () => { xit('successful delete notification shows Undo action - [C280534]', async () => {
await dataTable.selectItem(recentFile1); await dataTable.selectItem(recentFile1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
const message = await page.getSnackBarMessage(); const message = await page.getSnackBarMessage();
expect(message).toContain(`Undo`); expect(message).toContain(`Undo`);
@@ -626,8 +626,8 @@ describe('Delete and undo delete', () => {
// so for the moment we're testing that the restored file is not displayed in the Trash // so for the moment we're testing that the restored file is not displayed in the Trash
xit('undo delete of file - [C280536]', async () => { xit('undo delete of file - [C280536]', async () => {
await dataTable.selectItem(recentFile2); await dataTable.selectItem(recentFile2);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
expect(dataTable.getRowByName(recentFile2).isPresent()).toBe(false, 'Item is in Trash'); expect(dataTable.getRowByName(recentFile2).isPresent()).toBe(false, 'Item is in Trash');
@@ -639,8 +639,8 @@ describe('Delete and undo delete', () => {
// so for the moment we're testing that the restored file is not displayed in the Trash // so for the moment we're testing that the restored file is not displayed in the Trash
xit('undo delete of multiple files - [C280537]', async () => { xit('undo delete of multiple files - [C280537]', async () => {
await dataTable.selectMultipleItems([recentFile3, recentFile4]); await dataTable.selectMultipleItems([recentFile3, recentFile4]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Delete'); await toolbar.menu.clickMenuItem('Delete');
await page.clickSnackBarAction(); await page.clickSnackBarAction();
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
expect(dataTable.getRowByName(recentFile3).isPresent()).toBe(false, `${recentFile3} is in Trash`); expect(dataTable.getRowByName(recentFile3).isPresent()).toBe(false, `${recentFile3} is in Trash`);

View File

@@ -55,7 +55,7 @@ describe('Edit folder', () => {
const personalFilesPage = new BrowsingPage(); const personalFilesPage = new BrowsingPage();
const editDialog = new CreateOrEditFolderDialog(); const editDialog = new CreateOrEditFolderDialog();
const { dataTable } = personalFilesPage; const { dataTable } = personalFilesPage;
const editButton = personalFilesPage.toolbar.actions.getButtonByTitleAttribute('Edit'); const editButton = personalFilesPage.toolbar.getButtonByTitleAttribute('Edit');
beforeAll(done => { beforeAll(done => {
apis.admin.people.createUser({ username }) apis.admin.people.createUser({ username })

View File

@@ -93,31 +93,31 @@ describe('Mark items as favorites', () => {
}); });
beforeEach(done => { beforeEach(done => {
toolbar.actions.closeMoreMenu().then(done); toolbar.closeMoreMenu().then(done);
}); });
it('Favorite action has empty star icon for an item not marked as favorite - [C217186]', () => { it('Favorite action has empty star icon for an item not marked as favorite - [C217186]', () => {
dataTable.selectItem(file1NotFav) dataTable.selectItem(file1NotFav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border')); .then(() => expect(toolbar.menu.getItemIconText('Favorite')).toEqual('star_border'));
}); });
it('Favorite action has empty star icon for multiple selection of items when some are not favorite - [C217187]', () => { 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.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border')); .then(() => expect(toolbar.menu.getItemIconText('Favorite')).toEqual('star_border'));
}); });
it('Favorite action has full star icon for items marked as favorite - [C217188]', () => { it('Favorite action has full star icon for items marked as favorite - [C217188]', () => {
dataTable.selectItem(file3Fav) dataTable.selectItem(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star')); .then(() => expect(toolbar.menu.getItemIconText('Favorite')).toEqual('star'));
}); });
it('favorite a file - [C217189]', () => { it('favorite a file - [C217189]', () => {
dataTable.selectItem(file1NotFav) dataTable.selectItem(file1NotFav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 })) .then(() => apis.user.favorites.waitForApi({ expect: 3 }))
.then(() => apis.user.favorites.isFavorite(file1Id)) .then(() => apis.user.favorites.isFavorite(file1Id))
.then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`)) .then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`))
@@ -127,8 +127,8 @@ describe('Mark items as favorites', () => {
it('favorite a folder - [C280390]', () => { it('favorite a folder - [C280390]', () => {
dataTable.selectItem(folder1) dataTable.selectItem(folder1)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 })) .then(() => apis.user.favorites.waitForApi({ expect: 3 }))
.then(() => apis.user.favorites.isFavorite(folder1Id)) .then(() => apis.user.favorites.isFavorite(folder1Id))
.then(isFavorite => expect(isFavorite).toBe(true, `${folder1} not marked as favorite`)) .then(isFavorite => expect(isFavorite).toBe(true, `${folder1} not marked as favorite`))
@@ -138,8 +138,8 @@ describe('Mark items as favorites', () => {
it('unfavorite an item - [C217190]', () => { it('unfavorite an item - [C217190]', () => {
dataTable.selectItem(file3Fav) dataTable.selectItem(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 1 })) .then(() => apis.user.favorites.waitForApi({ expect: 1 }))
.then(() => apis.user.favorites.isFavorite(file3Id)) .then(() => apis.user.favorites.isFavorite(file3Id))
.then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`)) .then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`))
@@ -149,8 +149,8 @@ describe('Mark items as favorites', () => {
it('favorite multiple items - all unfavorite - [C217192]', () => { it('favorite multiple items - all unfavorite - [C217192]', () => {
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 4 })) .then(() => apis.user.favorites.waitForApi({ expect: 4 }))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file1Id), apis.user.favorites.isFavorite(file1Id),
@@ -167,8 +167,8 @@ describe('Mark items as favorites', () => {
it('favorite multiple items - some favorite and some unfavorite - [C217194]', () => { it('favorite multiple items - some favorite and some unfavorite - [C217194]', () => {
dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 })) .then(() => apis.user.favorites.waitForApi({ expect: 3 }))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file1Id), apis.user.favorites.isFavorite(file1Id),
@@ -184,8 +184,8 @@ describe('Mark items as favorites', () => {
it('unfavorite multiple items - [C217193]', () => { it('unfavorite multiple items - [C217193]', () => {
dataTable.selectMultipleItems([ file3Fav, file4Fav ]) dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => browser.sleep(2000)) .then(() => browser.sleep(2000))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file3Id), apis.user.favorites.isFavorite(file3Id),
@@ -209,13 +209,13 @@ describe('Mark items as favorites', () => {
}); });
beforeEach(done => { beforeEach(done => {
toolbar.actions.closeMoreMenu().then(done); toolbar.closeMoreMenu().then(done);
}); });
it('favorite a file - [C280352]', () => { it('favorite a file - [C280352]', () => {
dataTable.selectItem(file1NotFav) dataTable.selectItem(file1NotFav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 })) .then(() => apis.user.favorites.waitForApi({ expect: 3 }))
.then(() => apis.user.favorites.isFavorite(file1Id)) .then(() => apis.user.favorites.isFavorite(file1Id))
.then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`)) .then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`))
@@ -225,8 +225,8 @@ describe('Mark items as favorites', () => {
it('unfavorite an item - [C280353]', () => { it('unfavorite an item - [C280353]', () => {
dataTable.selectItem(file3Fav) dataTable.selectItem(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 1 })) .then(() => apis.user.favorites.waitForApi({ expect: 1 }))
.then(() => apis.user.favorites.isFavorite(file3Id)) .then(() => apis.user.favorites.isFavorite(file3Id))
.then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`)) .then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`))
@@ -236,8 +236,8 @@ describe('Mark items as favorites', () => {
it('favorite multiple items - all unfavorite - [C280355]', () => { it('favorite multiple items - all unfavorite - [C280355]', () => {
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 4 })) .then(() => apis.user.favorites.waitForApi({ expect: 4 }))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file1Id), apis.user.favorites.isFavorite(file1Id),
@@ -254,8 +254,8 @@ describe('Mark items as favorites', () => {
it('favorite multiple items - some favorite and some unfavorite - [C280357]', () => { it('favorite multiple items - some favorite and some unfavorite - [C280357]', () => {
dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 })) .then(() => apis.user.favorites.waitForApi({ expect: 3 }))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file1Id), apis.user.favorites.isFavorite(file1Id),
@@ -271,8 +271,8 @@ describe('Mark items as favorites', () => {
it('unfavorite multiple items - [C280356]', () => { it('unfavorite multiple items - [C280356]', () => {
dataTable.selectMultipleItems([ file3Fav, file4Fav ]) dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => browser.sleep(2000)) .then(() => browser.sleep(2000))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file3Id), apis.user.favorites.isFavorite(file3Id),
@@ -304,8 +304,8 @@ describe('Mark items as favorites', () => {
it('favorite a file - [C280362]', () => { it('favorite a file - [C280362]', () => {
dataTable.selectItem(file1NotFav) dataTable.selectItem(file1NotFav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 })) .then(() => apis.user.favorites.waitForApi({ expect: 3 }))
.then(() => apis.user.favorites.isFavorite(file1Id)) .then(() => apis.user.favorites.isFavorite(file1Id))
.then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`)) .then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`))
@@ -315,8 +315,8 @@ describe('Mark items as favorites', () => {
it('unfavorite an item - [C280363]', () => { it('unfavorite an item - [C280363]', () => {
dataTable.selectItem(file3Fav) dataTable.selectItem(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 1 })) .then(() => apis.user.favorites.waitForApi({ expect: 1 }))
.then(() => apis.user.favorites.isFavorite(file3Id)) .then(() => apis.user.favorites.isFavorite(file3Id))
.then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`)) .then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`))
@@ -326,8 +326,8 @@ describe('Mark items as favorites', () => {
it('favorite multiple items - all unfavorite - [C280365]', () => { it('favorite multiple items - all unfavorite - [C280365]', () => {
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]) dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 4 })) .then(() => apis.user.favorites.waitForApi({ expect: 4 }))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file1Id), apis.user.favorites.isFavorite(file1Id),
@@ -344,8 +344,8 @@ describe('Mark items as favorites', () => {
it('favorite multiple items - some favorite and some unfavorite - [C280367]', () => { it('favorite multiple items - some favorite and some unfavorite - [C280367]', () => {
dataTable.selectMultipleItems([ file1NotFav, file3Fav ]) dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 3 })) .then(() => apis.user.favorites.waitForApi({ expect: 3 }))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file1Id), apis.user.favorites.isFavorite(file1Id),
@@ -361,8 +361,8 @@ describe('Mark items as favorites', () => {
it('unfavorite multiple items - [C280366]', () => { it('unfavorite multiple items - [C280366]', () => {
dataTable.selectMultipleItems([ file3Fav, file4Fav ]) dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => browser.sleep(2000)) .then(() => browser.sleep(2000))
.then(() => Promise.all([ .then(() => Promise.all([
apis.user.favorites.isFavorite(file3Id), apis.user.favorites.isFavorite(file3Id),
@@ -391,8 +391,8 @@ describe('Mark items as favorites', () => {
it('unfavorite an item - [C280368]', () => { it('unfavorite an item - [C280368]', () => {
dataTable.selectItem(file3Fav) dataTable.selectItem(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => apis.user.favorites.waitForApi({ expect: 1 })) .then(() => apis.user.favorites.waitForApi({ expect: 1 }))
.then(() => apis.user.favorites.isFavorite(file3Id)) .then(() => apis.user.favorites.isFavorite(file3Id))
.then(isFavorite => { .then(isFavorite => {
@@ -405,8 +405,8 @@ describe('Mark items as favorites', () => {
it('unfavorite multiple items - [C280374]', () => { it('unfavorite multiple items - [C280374]', () => {
dataTable.selectMultipleItems([ file3Fav, file4Fav ]) dataTable.selectMultipleItems([ file3Fav, file4Fav ])
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => toolbar.actions.menu.clickMenuItem('Favorite')) .then(() => toolbar.menu.clickMenuItem('Favorite'))
.then(() => browser.sleep(2000)) .then(() => browser.sleep(2000))
.then(() => apis.user.favorites.isFavorite(file3Id)) .then(() => apis.user.favorites.isFavorite(file3Id))
.then(resp => { .then(resp => {
@@ -425,8 +425,8 @@ describe('Mark items as favorites', () => {
it('Favorite action has full star icon for items marked as favorite - [C280371]', () => { it('Favorite action has full star icon for items marked as favorite - [C280371]', () => {
dataTable.selectItem(file3Fav) dataTable.selectItem(file3Fav)
.then(() => toolbar.actions.openMoreMenu()) .then(() => toolbar.openMoreMenu())
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star')); .then(() => expect(toolbar.menu.getItemIconText('Favorite')).toEqual('star'));
}); });
}); });
@@ -451,7 +451,7 @@ describe('Mark items as favorites', () => {
await fileLibrariesPage.dataTable.waitForHeader(); await fileLibrariesPage.dataTable.waitForHeader();
await fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName); await fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName);
await fileLibrariesPage.dataTable.waitForHeader(); await fileLibrariesPage.dataTable.waitForHeader();
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
done(); done();
}); });
@@ -462,8 +462,8 @@ describe('Mark items as favorites', () => {
it('Favorite a folder - [C280391]', async () => { it('Favorite a folder - [C280391]', async () => {
await dataTable.selectItem(folderSite); await dataTable.selectItem(folderSite);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Favorite'); await toolbar.menu.clickMenuItem('Favorite');
await apis.user.favorites.waitForApi({ expect: 3 }); await apis.user.favorites.waitForApi({ expect: 3 });
const isFavorite = await apis.user.favorites.isFavorite(folderSiteId); const isFavorite = await apis.user.favorites.isFavorite(folderSiteId);
expect(isFavorite).toBe(true, `${folderSite} not marked as favorite`); expect(isFavorite).toBe(true, `${folderSite} not marked as favorite`);
@@ -473,8 +473,8 @@ describe('Mark items as favorites', () => {
it('Favorite a file - [C280342]', async () => { it('Favorite a file - [C280342]', async () => {
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite); await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
await dataTable.selectItem(fileSiteNotFav1); await dataTable.selectItem(fileSiteNotFav1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Favorite'); await toolbar.menu.clickMenuItem('Favorite');
await apis.user.favorites.waitForApi({ expect: 3 }); await apis.user.favorites.waitForApi({ expect: 3 });
const isFavorite = await apis.user.favorites.isFavorite(fileSiteNotFav1Id); const isFavorite = await apis.user.favorites.isFavorite(fileSiteNotFav1Id);
expect(isFavorite).toBe(true, `${fileSiteNotFav1} not marked as favorite`); expect(isFavorite).toBe(true, `${fileSiteNotFav1} not marked as favorite`);
@@ -484,8 +484,8 @@ describe('Mark items as favorites', () => {
it('Unfavorite an item - [C280343]', async () => { it('Unfavorite an item - [C280343]', async () => {
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite); await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
await dataTable.selectItem(fileSiteFav1); await dataTable.selectItem(fileSiteFav1);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Favorite'); await toolbar.menu.clickMenuItem('Favorite');
await apis.user.favorites.waitForApi({ expect: 3 }); await apis.user.favorites.waitForApi({ expect: 3 });
const isFavorite = await apis.user.favorites.isFavorite(fileSiteFav1Id); const isFavorite = await apis.user.favorites.isFavorite(fileSiteFav1Id);
expect(isFavorite).toBe(false, `${fileSiteFav1} is marked as favorite`); expect(isFavorite).toBe(false, `${fileSiteFav1} is marked as favorite`);
@@ -495,8 +495,8 @@ describe('Mark items as favorites', () => {
it('Favorite multiple items - all unfavorite - [C280345]', async () => { it('Favorite multiple items - all unfavorite - [C280345]', async () => {
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite); await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
await dataTable.selectMultipleItems([ fileSiteNotFav1, fileSiteNotFav2 ]); await dataTable.selectMultipleItems([ fileSiteNotFav1, fileSiteNotFav2 ]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Favorite'); await toolbar.menu.clickMenuItem('Favorite');
await apis.user.favorites.waitForApi({ expect: 4 }); await apis.user.favorites.waitForApi({ expect: 4 });
const listItems1 = await Promise.all([ const listItems1 = await Promise.all([
apis.user.favorites.isFavorite(fileSiteNotFav1Id), apis.user.favorites.isFavorite(fileSiteNotFav1Id),
@@ -511,8 +511,8 @@ describe('Mark items as favorites', () => {
it('Unfavorite multiple items - [C280346]', async () => { it('Unfavorite multiple items - [C280346]', async () => {
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite); await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
await dataTable.selectMultipleItems([ fileSiteFav1, fileSiteFav2 ]); await dataTable.selectMultipleItems([ fileSiteFav1, fileSiteFav2 ]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Favorite'); await toolbar.menu.clickMenuItem('Favorite');
const listItems2 = await Promise.all([ const listItems2 = await Promise.all([
apis.user.favorites.isFavorite(fileSiteFav1Id), apis.user.favorites.isFavorite(fileSiteFav1Id),
apis.user.favorites.isFavorite(fileSiteFav2Id) apis.user.favorites.isFavorite(fileSiteFav2Id)
@@ -526,8 +526,8 @@ describe('Mark items as favorites', () => {
it('Favorite multiple items - some favorite and some unfavorite - [C280347]', async () => { it('Favorite multiple items - some favorite and some unfavorite - [C280347]', async () => {
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite); await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
await dataTable.selectMultipleItems([ fileSiteNotFav1, fileSiteFav1 ]); await dataTable.selectMultipleItems([ fileSiteNotFav1, fileSiteFav1 ]);
await toolbar.actions.openMoreMenu(); await toolbar.openMoreMenu();
await toolbar.actions.menu.clickMenuItem('Favorite'); await toolbar.menu.clickMenuItem('Favorite');
await apis.user.favorites.waitForApi({ expect: 3 }); await apis.user.favorites.waitForApi({ expect: 3 });
const listItems3 = await Promise.all([ const listItems3 = await Promise.all([
apis.user.favorites.isFavorite(fileSiteNotFav1Id), apis.user.favorites.isFavorite(fileSiteNotFav1Id),

View File

@@ -81,7 +81,7 @@ describe('Permanently delete from Trash', () => {
it('delete file - [C217091]', async () => { it('delete file - [C217091]', async () => {
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click(); await toolbar.getButtonByTitleAttribute('Permanently delete').click();
await trashPage.waitForDialog(); await trashPage.waitForDialog();
await trashPage.getDialogActionByLabel('Delete').click(); await trashPage.getDialogActionByLabel('Delete').click();
await trashPage.waitForDialogToClose(); await trashPage.waitForDialogToClose();
@@ -93,7 +93,7 @@ describe('Permanently delete from Trash', () => {
it('delete folder - [C280416]', async () => { it('delete folder - [C280416]', async () => {
await dataTable.selectItem(folder1); await dataTable.selectItem(folder1);
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click(); await toolbar.getButtonByTitleAttribute('Permanently delete').click();
await trashPage.waitForDialog(); await trashPage.waitForDialog();
await trashPage.getDialogActionByLabel('Delete').click(); await trashPage.getDialogActionByLabel('Delete').click();
await trashPage.waitForDialogToClose(); await trashPage.waitForDialogToClose();
@@ -105,7 +105,7 @@ describe('Permanently delete from Trash', () => {
it('delete multiple items - [C280417]', async () => { it('delete multiple items - [C280417]', async () => {
await dataTable.selectMultipleItems([ file2, folder2 ]); await dataTable.selectMultipleItems([ file2, folder2 ]);
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click(); await toolbar.getButtonByTitleAttribute('Permanently delete').click();
await trashPage.waitForDialog(); await trashPage.waitForDialog();
await trashPage.getDialogActionByLabel('Delete').click(); await trashPage.getDialogActionByLabel('Delete').click();
await trashPage.waitForDialogToClose(); await trashPage.waitForDialogToClose();
@@ -118,7 +118,7 @@ describe('Permanently delete from Trash', () => {
it('Confirmation dialog UI - [C269113]', async () => { it('Confirmation dialog UI - [C269113]', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click(); await toolbar.getButtonByTitleAttribute('Permanently delete').click();
await trashPage.waitForDialog(); await trashPage.waitForDialog();
expect(await confirmDialog.getTitle()).toContain('Delete from trash'); expect(await confirmDialog.getTitle()).toContain('Delete from trash');
@@ -132,7 +132,7 @@ describe('Permanently delete from Trash', () => {
it('"Keep" action cancels the deletion - [C269115]', async () => { it('"Keep" action cancels the deletion - [C269115]', async () => {
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click(); await toolbar.getButtonByTitleAttribute('Permanently delete').click();
await trashPage.waitForDialog(); await trashPage.waitForDialog();
expect(await confirmDialog.keepButton.isEnabled()).toBe(true, 'KEEP button is not enabled'); expect(await confirmDialog.keepButton.isEnabled()).toBe(true, 'KEEP button is not enabled');

View File

@@ -81,7 +81,7 @@ describe('Restore from Trash', () => {
it('restore file - [C217177]', () => { it('restore file - [C217177]', () => {
dataTable.selectItem(file) dataTable.selectItem(file)
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
.then(text => { .then(text => {
expect(text).toContain(`${file} restored`); expect(text).toContain(`${file} restored`);
@@ -99,7 +99,7 @@ describe('Restore from Trash', () => {
it('restore folder - [C280438]', () => { it('restore folder - [C280438]', () => {
dataTable.selectItem(folder) dataTable.selectItem(folder)
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
.then(text => { .then(text => {
expect(text).toContain(`${folder} restored`); expect(text).toContain(`${folder} restored`);
@@ -117,7 +117,7 @@ describe('Restore from Trash', () => {
it('restore multiple items - [C217182]', () => { it('restore multiple items - [C217182]', () => {
dataTable.selectMultipleItems([ file, folder ]) dataTable.selectMultipleItems([ file, folder ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
.then(text => { .then(text => {
expect(text).toContain(`Restore successful`); expect(text).toContain(`Restore successful`);
@@ -137,7 +137,7 @@ describe('Restore from Trash', () => {
it('View from notification - [C217181]', () => { it('View from notification - [C217181]', () => {
dataTable.selectItem(file) dataTable.selectItem(file)
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.getButtonByTitleAttribute('Restore').click())
.then(() => page.clickSnackBarAction()) .then(() => page.clickSnackBarAction())
.then(() => page.dataTable.waitForHeader()) .then(() => page.dataTable.waitForHeader())
.then(() => { .then(() => {
@@ -187,7 +187,7 @@ describe('Restore from Trash', () => {
it('Restore a file when another file with same name exists on the restore location - [C217178]', () => { 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.selectItem(file1)) .then(() => dataTable.selectItem(file1))
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
.then(text => expect(text).toEqual(`Can't restore, ${file1} already exists`)); .then(text => expect(text).toEqual(`Can't restore, ${file1} already exists`));
}); });
@@ -195,7 +195,7 @@ describe('Restore from Trash', () => {
it('Restore a file when original location no longer exists - [C217179]', () => { 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.selectItem(file2)) .then(() => dataTable.selectItem(file2))
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
.then(text => expect(text).toEqual(`Can't restore ${file2}, the original location no longer exists`)); .then(text => expect(text).toEqual(`Can't restore ${file2}, the original location no longer exists`));
}); });
@@ -253,14 +253,14 @@ describe('Restore from Trash', () => {
it('one failure - [C217183]', () => { it('one failure - [C217183]', () => {
dataTable.selectMultipleItems([ file1, file2 ]) dataTable.selectMultipleItems([ file1, file2 ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.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 - [C217184]', () => { it('multiple failures - [C217184]', () => {
dataTable.selectMultipleItems([ file3, file4, file5 ]) dataTable.selectMultipleItems([ file3, file4, file5 ])
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click()) .then(() => toolbar.getButtonByTitleAttribute('Restore').click())
.then(() => page.getSnackBarMessage()) .then(() => page.getSnackBarMessage())
.then(text => expect(text).toEqual('2 items not restored because of issues with the restore location')); .then(text => expect(text).toEqual('2 items not restored because of issues with the restore location'));
}); });

View File

@@ -50,8 +50,7 @@ describe('Single click on item name', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const logoutPage = new LogoutPage(); const logoutPage = new LogoutPage();
const page = new BrowsingPage(); const page = new BrowsingPage();
const { dataTable } = page; const { dataTable, breadcrumb } = page;
const { breadcrumb } = page.toolbar;
const viewer = new Viewer(); const viewer = new Viewer();
beforeAll(async (done) => { beforeAll(async (done) => {

View File

@@ -106,46 +106,46 @@ describe('Granular permissions available actions : ', () => {
await dataTable.doubleClickOnRowByName(siteName); await dataTable.doubleClickOnRowByName(siteName);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectMultipleItems([ file1, file2 ]); await dataTable.selectMultipleItems([ file1, file2 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Shared Files - [C280477]', 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 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Favorites - [C280478]', async () => { it('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 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
// TODO: enable when ACA-1737 is done // TODO: enable when ACA-1737 is done
// expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`); // expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
// expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`); // expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -161,51 +161,51 @@ describe('Granular permissions available actions : ', () => {
await dataTable.doubleClickOnRowByName(siteName); await dataTable.doubleClickOnRowByName(siteName);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Shared Files - [C280456]', 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.selectItem(file1); await page.dataTable.selectItem(file1);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Favorites - [C213121]', async () => { it('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.selectItem(file1); await dataTable.selectItem(file1);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`); expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
// TODO: enable when ACA-1737 is done // TODO: enable when ACA-1737 is done
// expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`); // expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
// expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`); // expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -221,35 +221,35 @@ describe('Granular permissions available actions : ', () => {
await dataTable.doubleClickOnRowByName(siteName); await dataTable.doubleClickOnRowByName(siteName);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectItem(folder1); await dataTable.selectItem(folder1);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folder1}`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for ${folder1}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${folder1}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${folder1}`);
expect(await toolbar.actions.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${folder1}`); expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${folder1}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${folder1}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${folder1}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folder1}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folder1}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folder1}`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folder1}`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folder1}`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folder1}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folder1}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folder1}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Favorites - [C286266]', async () => { it('on Favorites - [C286266]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectItem(folder1); await dataTable.selectItem(folder1);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is not displayed for ${folder1}`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is not displayed for ${folder1}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${folder1}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${folder1}`);
expect(await toolbar.actions.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${folder1}`); expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${folder1}`);
// TODO: enable when ACA-1737 is done // TODO: enable when ACA-1737 is done
// expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${folder1}`); // expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${folder1}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folder1}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folder1}`);
// TODO: enable when ACA-1737 is done // TODO: enable when ACA-1737 is done
// expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folder1}`); // expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folder1}`);
// expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folder1}`); // expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folder1}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folder1}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folder1}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -266,46 +266,46 @@ describe('Granular permissions available actions : ', () => {
await dataTable.doubleClickOnRowByName(siteName); await dataTable.doubleClickOnRowByName(siteName);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectMultipleItems([ file1, file2 ]); await dataTable.selectMultipleItems([ file1, file2 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Shared Files - [C286284]', async () => { it('on Shared Files - [C286284]', 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 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Favorites - [C286285]', async () => { it('on Favorites - [C286285]', 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 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
// TODO: enable when ACA-1737 is done // TODO: enable when ACA-1737 is done
// expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`); // expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
// expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`); // expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -322,31 +322,31 @@ describe('Granular permissions available actions : ', () => {
await dataTable.doubleClickOnRowByName(siteName); await dataTable.doubleClickOnRowByName(siteName);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectMultipleItems([ folder1, folder2 ]); await dataTable.selectMultipleItems([ folder1, folder2 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Favorites - [C286286]', async () => { it('on Favorites - [C286286]', async () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectMultipleItems([ folder1, folder2 ]); await dataTable.selectMultipleItems([ folder1, folder2 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
// TODO: enable when ACA-1737 is done // TODO: enable when ACA-1737 is done
// expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`); // expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
// expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`); // expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -363,31 +363,31 @@ describe('Granular permissions available actions : ', () => {
await dataTable.doubleClickOnRowByName(siteName); await dataTable.doubleClickOnRowByName(siteName);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectMultipleItems([ file1, folder1 ]); await dataTable.selectMultipleItems([ file1, folder1 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`); expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`); expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('on Favorites - [C286287]', async () => { it('on Favorites - [C286287]', 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, folder1 ]); await dataTable.selectMultipleItems([ file1, folder1 ]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
// TODO: enable when ACA-1737 is done // TODO: enable when ACA-1737 is done
// expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`); // expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
// expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`); // expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });

View File

@@ -135,41 +135,41 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when multiple files are selected - [C217112]', async () => { it('correct actions appear when multiple files are selected - [C217112]', async () => {
await dataTable.selectMultipleItems([file1, file2]); await dataTable.selectMultipleItems([file1, file2]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('correct actions appear when multiple folders are selected - [C280459]', async () => { it('correct actions appear when multiple folders are selected - [C280459]', async () => {
await dataTable.selectMultipleItems([folder1, folder2]); await dataTable.selectMultipleItems([folder1, folder2]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('correct actions appear when both files and folders are selected - [C280460]', async () => { it('correct actions appear when both files and folders are selected - [C280460]', async () => {
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]); await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -186,10 +186,10 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when multiple files are selected - [C280461]', async () => { it('correct actions appear when multiple files are selected - [C280461]', async () => {
await dataTable.selectMultipleItems([file1InSite, file2InSite]); await dataTable.selectMultipleItems([file1InSite, file2InSite]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed for selected files');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
@@ -198,10 +198,10 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when multiple folders are selected - [C280462]', async () => { it('correct actions appear when multiple folders are selected - [C280462]', async () => {
await dataTable.selectMultipleItems([folder1InSite, folder2InSite]); await dataTable.selectMultipleItems([folder1InSite, folder2InSite]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
@@ -210,10 +210,10 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when both files and folders are selected - [C280463]', async () => { it('correct actions appear when both files and folders are selected - [C280463]', async () => {
await dataTable.selectMultipleItems([file1InSite, file2InSite, folder1InSite, folder2InSite]); await dataTable.selectMultipleItems([file1InSite, file2InSite, folder1InSite, folder2InSite]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
@@ -232,10 +232,10 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when multiple files are selected - [C280467]', async () => { it('correct actions appear when multiple files are selected - [C280467]', async () => {
await dataTable.selectMultipleItems([file1, file2]); await dataTable.selectMultipleItems([file1, file2]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
@@ -254,10 +254,10 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when multiple files are selected - [C280468]', async () => { it('correct actions appear when multiple files are selected - [C280468]', async () => {
await dataTable.selectMultipleItems([file1, file2]); await dataTable.selectMultipleItems([file1, file2]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
@@ -276,10 +276,10 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when multiple files are selected - [C280469]', async () => { it('correct actions appear when multiple files are selected - [C280469]', async () => {
await dataTable.selectMultipleItems([file1, file2]); await dataTable.selectMultipleItems([file1, file2]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
@@ -288,10 +288,10 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when multiple folders are selected - [C280470]', async () => { it('correct actions appear when multiple folders are selected - [C280470]', async () => {
await dataTable.selectMultipleItems([folder1, folder2]); await dataTable.selectMultipleItems([folder1, folder2]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
@@ -300,10 +300,10 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when both files and folders are selected - [C280471]', async () => { it('correct actions appear when both files and folders are selected - [C280471]', async () => {
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]); await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed'); expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files'); expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed'); expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
@@ -321,20 +321,20 @@ describe('Toolbar actions - multiple selection : ', () => {
it('correct actions appear when multiple files are selected - [C280472]', async () => { it('correct actions appear when multiple files are selected - [C280472]', async () => {
await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2]); await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2]);
expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed'); expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed'); expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
}); });
it('correct actions appear when multiple folders are selected - [C280473]', async () => { it('correct actions appear when multiple folders are selected - [C280473]', async () => {
await dataTable.selectMultipleItems([folderForDelete1, folderForDelete2]); await dataTable.selectMultipleItems([folderForDelete1, folderForDelete2]);
expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed'); expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed'); expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
}); });
it('correct actions appear when both files and folders are selected - [C280474]', async () => { it('correct actions appear when both files and folders are selected - [C280474]', async () => {
await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]); await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]);
expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed'); expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed'); expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
}); });
}); });
}); });

View File

@@ -97,7 +97,7 @@ describe('Toolbar actions - single selection : ', () => {
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES); await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
await dataTable.waitForHeader(); await dataTable.waitForHeader();
await dataTable.selectItem(siteName); await dataTable.selectItem(siteName);
expect(await toolbar.actions.isEmpty()).toBe(true, 'toolbar not empty'); expect(await toolbar.isEmpty()).toBe(true, 'toolbar not empty');
}); });
it('selected row is marked with a check circle icon - [C213134]', async () => { it('selected row is marked with a check circle icon - [C213134]', async () => {
@@ -118,35 +118,35 @@ describe('Toolbar actions - single selection : ', () => {
}); });
it('actions are not displayed when no item is selected - [C213120]', 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.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected - [C213122]', async () => { it('correct actions appear when a file is selected - [C213122]', async () => {
await dataTable.selectItem(fileUser); await dataTable.selectItem(fileUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); expect(await toolbar.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.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('correct actions appear when a folder is selected - [C213123]', async () => { it('correct actions appear when a folder is selected - [C213123]', async () => {
await dataTable.selectItem(folderUser); await dataTable.selectItem(folderUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`); expect(await toolbar.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -161,35 +161,35 @@ describe('Toolbar actions - single selection : ', () => {
}); });
it('actions are not displayed when no item is selected - [C280439]', 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.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected - [C280440]', async () => { it('correct actions appear when a file is selected - [C280440]', async () => {
await dataTable.selectItem(fileInSite); await dataTable.selectItem(fileInSite);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileInSite}`); expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileInSite}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileInSite}`); expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileInSite}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileInSite}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileInSite}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileInSite}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileInSite}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileInSite}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileInSite}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileInSite}`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileInSite}`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileInSite}`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileInSite}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileInSite}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileInSite}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('correct actions appear when a folder is selected - [C280441]', async () => { it('correct actions appear when a folder is selected - [C280441]', async () => {
await dataTable.selectItem(folderInSite); await dataTable.selectItem(folderInSite);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderInSite}`); expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderInSite}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderInSite}`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for ${folderInSite}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderInSite}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderInSite}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderInSite}`); expect(await toolbar.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderInSite}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderInSite}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderInSite}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderInSite}`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderInSite}`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderInSite}`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderInSite}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderInSite}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderInSite}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -202,21 +202,21 @@ describe('Toolbar actions - single selection : ', () => {
}); });
it('actions are not displayed when no item is selected - [C280445]', 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.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected - [C286265]', async () => { it('correct actions appear when a file is selected - [C286265]', async () => {
await page.dataTable.selectItem(fileUser); await page.dataTable.selectItem(fileUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); expect(await toolbar.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.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -230,21 +230,21 @@ describe('Toolbar actions - single selection : ', () => {
}); });
it('actions are not displayed when no item is selected - [C280447]', 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.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected - [C280448]', async () => { it('correct actions appear when a file is selected - [C280448]', async () => {
await dataTable.selectItem(fileUser); await dataTable.selectItem(fileUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); expect(await toolbar.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.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -257,35 +257,35 @@ describe('Toolbar actions - single selection : ', () => {
}); });
it('actions are not displayed when no item is selected - [C280449]', 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.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected - [C280450]', async () => { it('correct actions appear when a file is selected - [C280450]', async () => {
await dataTable.selectItem(fileUser); await dataTable.selectItem(fileUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); expect(await toolbar.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.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`); expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
it('correct actions appear when a folder is selected - [C280451]', async () => { it('correct actions appear when a folder is selected - [C280451]', async () => {
await dataTable.selectItem(folderUser); await dataTable.selectItem(folderUser);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`); expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`); expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`);
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`); expect(await toolbar.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
const menu = await toolbar.actions.openMoreMenu(); const menu = await toolbar.openMoreMenu();
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`); expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`);
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`); expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`);
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`); expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`);
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`); expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`);
await toolbar.actions.closeMoreMenu(); await toolbar.closeMoreMenu();
}); });
}); });
@@ -298,21 +298,21 @@ describe('Toolbar actions - single selection : ', () => {
}); });
it('actions are not displayed when no item is selected - [C280452]', 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.isEmpty()).toBe(true, `actions displayed though nothing selected`);
}); });
it('correct actions appear when a file is selected - [C280453]', async () => { it('correct actions appear when a file is selected - [C280453]', async () => {
await dataTable.selectItem(fileForDelete); await dataTable.selectItem(fileForDelete);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileForDelete}`); expect(await toolbar.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.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.isButtonPresent('Restore')).toBe(true, `Restore is not displayed for file`);
}); });
it('correct actions appear when a folder is selected - [C280454]', async () => { it('correct actions appear when a folder is selected - [C280454]', async () => {
await dataTable.selectItem(folderForDelete); await dataTable.selectItem(folderForDelete);
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderForDelete}`); expect(await toolbar.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.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is displayed for folder`);
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, `Restore is not enabled for folder`); expect(await toolbar.isButtonPresent('Restore')).toBe(true, `Restore is not enabled for folder`);
}); });
}); });
}); });

View File

@@ -101,7 +101,7 @@ describe('Extensions - Info Drawer', () => {
it('Add a new tab with icon and title - [C284646]', async () => { it('Add a new tab with icon and title - [C284646]', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.actions.getButtonByTitleAttribute('View details').click(); await page.toolbar.getButtonByTitleAttribute('View details').click();
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabPresent(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not present`); expect(await infoDrawer.isTabPresent(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not present`);
@@ -110,7 +110,7 @@ describe('Extensions - Info Drawer', () => {
it('Remove existing tab - [C284647]', async () => { it('Remove existing tab - [C284647]', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.actions.getButtonByTitleAttribute('View details').click(); await page.toolbar.getButtonByTitleAttribute('View details').click();
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabPresent(comments_tab.title)).toBe(false, `${comments_tab.title} tab should not be present!`); expect(await infoDrawer.isTabPresent(comments_tab.title)).toBe(false, `${comments_tab.title} tab should not be present!`);
@@ -118,7 +118,7 @@ describe('Extensions - Info Drawer', () => {
it('Change tab title - [C284648]', async () => { it('Change tab title - [C284648]', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.actions.getButtonByTitleAttribute('View details').click(); await page.toolbar.getButtonByTitleAttribute('View details').click();
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabPresent(properties_tab.title)).toBe(true, `${properties_tab.title} tab is not present`); expect(await infoDrawer.isTabPresent(properties_tab.title)).toBe(true, `${properties_tab.title} tab is not present`);
@@ -127,7 +127,7 @@ describe('Extensions - Info Drawer', () => {
it('Tab with icon and no title - [C284649]', async () => { it('Tab with icon and no title - [C284649]', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.actions.getButtonByTitleAttribute('View details').click(); await page.toolbar.getButtonByTitleAttribute('View details').click();
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabPresent(no_title_tab.title)).toBe(true, `${no_title_tab.title} tab is not present`); expect(await infoDrawer.isTabPresent(no_title_tab.title)).toBe(true, `${no_title_tab.title} tab is not present`);
@@ -136,7 +136,7 @@ describe('Extensions - Info Drawer', () => {
it('Insert new component in tab - [C284651]', async () => { it('Insert new component in tab - [C284651]', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.actions.getButtonByTitleAttribute('View details').click(); await page.toolbar.getButtonByTitleAttribute('View details').click();
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isTabDisplayed(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not displayed`); expect(await infoDrawer.isTabDisplayed(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not displayed`);
@@ -162,7 +162,7 @@ describe('Extensions - Info Drawer', () => {
it('Remove all tabs - [C284650]', async () => { it('Remove all tabs - [C284650]', async () => {
await page.dataTable.selectItem(file); await page.dataTable.selectItem(file);
await page.toolbar.actions.getButtonByTitleAttribute('View details').click(); await page.toolbar.getButtonByTitleAttribute('View details').click();
await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.waitForInfoDrawerToOpen();
expect(await infoDrawer.isEmpty()).toBe(true, 'Info Drawer is not empty'); expect(await infoDrawer.isEmpty()).toBe(true, 'Info Drawer is not empty');

View File

@@ -48,8 +48,7 @@ describe('Favorites', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const logoutPage = new LogoutPage(); const logoutPage = new LogoutPage();
const favoritesPage = new BrowsingPage(); const favoritesPage = new BrowsingPage();
const { dataTable } = favoritesPage; const { dataTable, breadcrumb } = favoritesPage;
const { breadcrumb } = favoritesPage.toolbar;
beforeAll(async (done) => { beforeAll(async (done) => {
await apis.admin.people.createUser({ username }); await apis.admin.people.createUser({ username });

View File

@@ -48,8 +48,7 @@ describe('Recent Files', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const logoutPage = new LogoutPage(); const logoutPage = new LogoutPage();
const recentFilesPage = new BrowsingPage(); const recentFilesPage = new BrowsingPage();
const { dataTable } = recentFilesPage; const { dataTable, breadcrumb } = recentFilesPage;
const { breadcrumb } = recentFilesPage.toolbar;
beforeAll(done => { beforeAll(done => {
apis.admin.people.createUser({ username }) apis.admin.people.createUser({ username })

View File

@@ -49,8 +49,7 @@ describe('Shared Files', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const logoutPage = new LogoutPage(); const logoutPage = new LogoutPage();
const sharedFilesPage = new BrowsingPage(); const sharedFilesPage = new BrowsingPage();
const { dataTable } = sharedFilesPage; const { dataTable, breadcrumb } = sharedFilesPage;
const { breadcrumb } = sharedFilesPage.toolbar;
beforeAll(done => { beforeAll(done => {
apis.admin.people.createUser({ username }) apis.admin.people.createUser({ username })

View File

@@ -55,8 +55,7 @@ describe('Trash', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const logoutPage = new LogoutPage(); const logoutPage = new LogoutPage();
const trashPage = new BrowsingPage(); const trashPage = new BrowsingPage();
const { dataTable } = trashPage; const { dataTable, breadcrumb } = trashPage;
const { breadcrumb } = trashPage.toolbar;
beforeAll(done => { beforeAll(done => {
apis.admin.people.createUser({ username }) apis.admin.people.createUser({ username })

View File

@@ -47,7 +47,7 @@ describe('Breadcrumb', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const logoutPage = new LogoutPage(); const logoutPage = new LogoutPage();
const page = new BrowsingPage(); const page = new BrowsingPage();
const { breadcrumb } = page.toolbar; const { breadcrumb } = page;
const apis = { const apis = {
admin: new RepoClient(), admin: new RepoClient(),

View File

@@ -90,14 +90,13 @@ describe('Viewer general', () => {
}); });
afterAll(async (done) => { afterAll(async (done) => {
await Promise await Promise.all([
.all([ apis.user.nodes.deleteNodeById(parentId),
apis.user.nodes.deleteNodeById(parentId), apis.admin.sites.deleteSite(siteAdmin),
apis.admin.sites.deleteSite(siteAdmin), apis.user.sites.deleteSite(siteUser),
apis.user.sites.deleteSite(siteUser), logoutPage.load()
logoutPage.load() ]);
]) done();
.then(done);
}); });
it('Viewer opens on double clicking on a file from Personal Files - [C279269]', async () => { it('Viewer opens on double clicking on a file from Personal Files - [C279269]', async () => {
@@ -107,7 +106,7 @@ describe('Viewer general', () => {
it('Viewer opens when clicking the View action for a file - [C279270]', async () => { it('Viewer opens when clicking the View action for a file - [C279270]', async () => {
await dataTable.selectItem(xlsxFile); await dataTable.selectItem(xlsxFile);
await page.toolbar.actions.getButtonByTitleAttribute('View').click(); await page.toolbar.getButtonByTitleAttribute('View').click();
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
}); });