mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
add tests for header extension (#701)
This commit is contained in:
committed by
Suzana Dirla
parent
253425971f
commit
d8ad020394
@@ -23,24 +23,32 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, by } from 'protractor';
|
||||
import { ElementFinder, by, browser } from 'protractor';
|
||||
import { Component } from '../component';
|
||||
import { UserInfo } from './user-info';
|
||||
import { protractor } from 'protractor';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Toolbar } from './../toolbar/toolbar';
|
||||
|
||||
export class Header extends Component {
|
||||
private locators = {
|
||||
root: 'app-header',
|
||||
logoLink: by.css('.app-menu__title'),
|
||||
userInfo: by.css('aca-current-user'),
|
||||
searchButton: by.css('#adf-search-button'),
|
||||
searchBar: by.css('#adf-control-input')
|
||||
searchBar: by.css('#adf-control-input'),
|
||||
moreActions: by.id('app.header.more')
|
||||
};
|
||||
|
||||
logoLink: ElementFinder = this.component.element(this.locators.logoLink);
|
||||
userInfo: UserInfo = new UserInfo(this.component);
|
||||
searchButton: ElementFinder = this.component.element(this.locators.searchButton);
|
||||
searchBar: ElementFinder = this.component.element(this.locators.searchBar);
|
||||
moreActions: ElementFinder = browser.element(this.locators.moreActions);
|
||||
|
||||
menu: Menu = new Menu();
|
||||
toolbar: Toolbar = new Toolbar();
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super('adf-layout-header', ancestor);
|
||||
@@ -59,5 +67,10 @@ export class Header extends Component {
|
||||
async waitForSearchBar() {
|
||||
await Utils.waitUntilElementClickable(this.searchBar);
|
||||
}
|
||||
|
||||
async openMoreMenu() {
|
||||
await this.moreActions.click();
|
||||
await this.menu.waitForMenuToOpen();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -112,6 +112,16 @@ export class Menu extends Component {
|
||||
return await this.component.element(by.cssContainingText(Menu.selectors.item, title)).isPresent();
|
||||
}
|
||||
|
||||
async isMenuItemDisabled(title: string) {
|
||||
try {
|
||||
const item = this.getItemByLabel(title);
|
||||
const disabled = await item.getAttribute('disabled');
|
||||
return disabled;
|
||||
} catch (error) {
|
||||
console.log('----- isMenuItemDisabled catch: ', error);
|
||||
}
|
||||
}
|
||||
|
||||
uploadFile() {
|
||||
return this.uploadFiles;
|
||||
}
|
||||
|
@@ -67,7 +67,6 @@ export class Toolbar extends Component {
|
||||
const moreMenu = this.getButtonByTitleAttribute('More actions');
|
||||
await moreMenu.click();
|
||||
await this.menu.waitForMenuToOpen();
|
||||
// return this.menu;
|
||||
}
|
||||
|
||||
async closeMoreMenu() {
|
||||
|
Reference in New Issue
Block a user