This commit is contained in:
Denys Vuika
2023-02-28 22:42:13 +00:00
committed by Sheena Malhotra
parent 738d93f5d1
commit 12e9e2a221
3 changed files with 1 additions and 43 deletions

View File

@@ -25,7 +25,7 @@
import { ElementFinder, by, element, browser } from 'protractor';
import { Logger, BrowserActions } from '@alfresco/adf-testing';
import { SIDEBAR_LABELS, BROWSER_WAIT_TIMEOUT } from '../../configs';
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
import { Menu } from '../menu/menu';
import { Component } from '../component';
@@ -48,20 +48,6 @@ export class Sidenav extends Component {
super('app-sidenav', ancestor);
}
private async expandMenu(name: string): Promise<void> {
try {
if (await element(by.cssContainingText('.mat-expanded', name)).isPresent()) {
return Promise.resolve();
} else {
const link = this.getLink(name);
await BrowserActions.click(link);
await element(by.css('.mat-expansion-panel-body')).isPresent();
}
} catch (e) {
Logger.error(`---- sidebar navigation catch expandMenu: failed to expand ${name} menu : `, e);
}
}
async openNewMenu(): Promise<void> {
await BrowserActions.click(this.newButton.first());
await this.menu.waitForMenuToOpen();
@@ -147,12 +133,4 @@ export class Sidenav extends Component {
Logger.error(`---- clickLink catch : sidebar navigation failed to click on - ${name} : `, error);
}
}
async isFileLibrariesMenuExpanded(): Promise<boolean> {
return element(by.cssContainingText('.mat-expanded', SIDEBAR_LABELS.FILE_LIBRARIES)).isPresent();
}
async expandFileLibraries(): Promise<void> {
await this.expandMenu(SIDEBAR_LABELS.FILE_LIBRARIES);
}
}

View File

@@ -54,9 +54,6 @@ export class BrowsingPage extends Page {
}
async goToFavoriteLibraries(): Promise<void> {
if (!(await this.sidenav.isFileLibrariesMenuExpanded())) {
await this.sidenav.expandFileLibraries();
}
await this.sidenav.clickLink(SIDEBAR_LABELS.FAVORITE_LIBRARIES);
}
@@ -66,9 +63,6 @@ export class BrowsingPage extends Page {
}
async goToMyLibraries(): Promise<void> {
if (!(await this.sidenav.isFileLibrariesMenuExpanded())) {
await this.sidenav.expandFileLibraries();
}
await this.sidenav.clickLink(SIDEBAR_LABELS.MY_LIBRARIES);
}