import Component  from '../component.js'

export default class CoUxAppShell extends Component {
    /**
    * Expects the parent element and an xpath selector (without the leading slashes)
    * @param parent WebdriverIO.Element
    */
    constructor(parent) {
      // super();
      let selector = 'ux-app-shell';
      super(parent, selector);
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBar() {
        let path = '//div[contains(@class,"ux-app-shell__sidebar")]';
        return this.currentPath + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarHeader() {
        let path = '//div[contains(@class,"ux-app-shell__sidebar-header")]';
        return this.sideBar + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarHeaderToggle() {
        let path = '//div[contains(@class,"ux-app-shell__sidebar-header-toggle")]';
        return this.sideBarHeader + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarHeaderToggleIcon() {
        let path = '//span[contains(@class,"ux-icon")]';
        return this.sideBarHeaderToggle + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    async isSidebarOpen() {
        let cl = await (await $(this.sideBarHeaderToggleIcon)).getAttribute('class');
        if (cl.includes('ux-icon-times')) {
            return true;
        } else if (cl.includes('ux-icon-bars')) {
            return false;
        } else {
            throw new Error('ux-app-shell component object needs to be revised, SideBarHeaderToggleIcon is missing class');
        }
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarHeaderLogo() {
        let path = '//div[contains(@class,"ux-app-shell__sidebar-header-logo")]';
        return this.sideBarHeader + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarHeaderTitle() {
        let path = '//div[contains(@class,"ux-app-shell__sidebar-header-title")]';
        return this.sideBarHeader + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarHeaderTitleFullAppName() {
        let path = '//div[contains(@class,"ux-app-shell__sidebar-header-title") and contains(@class,"full")]';
        return this.sideBarHeaderTitle + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarHeaderTitleSmallAppName() {
        let path = '//div[contains(@class,"ux-app-shell__sidebar-header-title") and contains(@class,"small")]';
        return this.sideBarHeaderTitle + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarBody() {
        let path = '//div[contains(@class,"ux-app-shell__sidebar-body")]';
        return this.sideBar + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get sideBarBodyItemsPlaceholder() {
        let path = '//ux-layout-sidebar-items';
        return this.sideBarBody + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get main() {
        let path = '//div[contains(@class,"ux-app-shell__main")]';
        return this.currentPath + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeader() {
        let path = '//div[contains(@class,"ux-app-shell__header")]';
        return this.main + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderTitle() {
        let path = '//div[contains(@class,"ux-app-shell__header-app-title")]';
        return this.mainHeader + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderBreadcrumbsPlaceholder() {
        let path = '//ux-layout-breadcrumbs';
        return this.mainHeader + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfile() {
        let path = '//div[contains(@class,"ux-app-shell__header-profile")]';
        return this.mainHeader + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapper() {
        let path = '//div[contains(@class,"profile-wrapper")]';
        return this.mainHeaderProfile + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperUserInfos() {
        let path = '//div[contains(@class,"profile-user-infos")]';
        return this.mainHeaderProfileWrapper + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperUserInfosMessage() {
        let path = '/div/span';
        return this.mainHeaderProfileWrapperUserInfos + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperUserInfosUserName() {
        let path = '//strong/span';
        return this.mainHeaderProfileWrapperUserInfos + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperAvatar() {
        let path = '//div[contains(@class,"profile-avatar")]';
        return this.mainHeaderProfileWrapper + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperAvatarConnectedState() {
        let path = '//div[contains(@class,"profile-avatar")]//span[contains(@class,"ion-social-rss")]';
        return this.mainHeaderProfileWrapperAvatar + path;
    }
    /**
    * @type string
    */
    get mainHeaderProfileWrapperAvatarConnectedStateTitle() {
        return this.mainHeaderProfileWrapperAvatarConnectedState.getAttribute('title');
    }
    /**
    * @type boolean
    */
    async isConnected() {
        let cl = await (await $(this.mainHeaderProfileWrapperAvatarConnectedState)).getAttribute('class');
        if (cl.includes('ux-u-color-success')) {
            return true;
        } else if (cl.includes('ux-u-color-danger')) {
            return false;
        } else {
            throw new Error('ux-app-shell component object needs to be revised, ' +
            'MainHeaderProfileWrapperAvatarConnectedState is missing class');
        }
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperAvatarAvailableState() {
        let path = '//div[contains(@class,"profile-avatar")]//span[contains(@class,"ux-icon-circle")]';
        return this.mainHeaderProfileWrapperAvatar + path;
    }
    /**
    * @type string
    */
    get mainHeaderProfileWrapperAvatarAvailableStateTitle() {
        return this.mainHeaderProfileWrapperAvatarAvailableState.getAttribute('title');
    }
    /**
    * @type boolean
    */
    async isOnline() {
        let cl = await (await $(this.mainHeaderProfileWrapperAvatarAvailableState)).getAttribute('class');
        if (cl.includes('ux-u-color-success')) {
            return true;
        } else if (cl.includes('ux-u-color-danger')) {
            return false;
        } else {
            throw new Error('ux-app-shell component object needs to be revised, ' +
            'MainHeaderProfileWrapperAvatarAvailableState is missing class');
        }
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperToggle() {
        let path = '//div[contains(@class,"profile-toggle")]';
        return this.mainHeaderProfileWrapper + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperToggleIcon() {
        let path = '//span[contains(@class,"ux-icon")]';
        return this.mainHeaderProfileWrapperToggle + path;
    }
    /**
    * @type boolean
    */
    async isProfileDropdownVisible() {
        let cl = await (await $(this.mainHeaderProfileWrapperToggleIcon)).getAttribute('class');
        if (cl.includes('ux-icon-angle-up')) {
            return true;
        } else if (cl.includes('ux-icon-angle-down')) {
            return false;
        } else {
            throw new Error('ux-app-shell component object needs to be revised, ' +
            'MainHeaderProfileWrapperToggleIcon is missing class');
        }
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileWrapperProfileMenuPlaceholder() {
        let path = '//ux-app-shell-header-profile-menu';
        return this.mainHeaderProfileWrapper + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileActions() {
        let path = '//div[contains(@class,"ux-app-shell__header-actions")]';
        return this.mainHeaderProfile + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileActionsPlaceholder() {
        let path = '//ux-app-shell-header-actions';
        return this.mainHeaderProfileActions + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileActionsLanguageActionItem() {
        let path = '//div[contains(@class,"language-action-item")]';
        return this.mainHeaderProfileActions + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileActionsLanguageActionItemLanguageSelectorPlaceholder() {
        let path = '//ux-language-selector"]';
        return this.mainHeaderProfileActions + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainHeaderProfileActionsNavBarActionItemPlaceholder() {
        let path = '//ux-layout-nav-bar-action-item"]';
        return this.mainHeaderProfileActions + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainTopMessageContent() {
        let path = '//div[contains(@class,"ux-app-shell__top-message-content")]';
        return this.main + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainTopMessageContentMessagePlaceholder() {
        let path = '//ux-app-shell-top-message';
        return this.main + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get mainContent() {
        let path = '//div[contains(@class,"ux-app-shell__main-content")]';
        return this.main + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get growlPlaceholder() {
        let path = 'ux-growl';
        return this.currentPath + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get blockDocumentPlaceholder() {
        let path = 'ux-block-document';
        return this.currentPath + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get feedback() {
        let path = '//div[contains(@class,"ux-app-shell__feedback")]';
        return this.currentPath + path;
    }
    /**
    * @type WebdriverIO.Element
    */
    get eclSvgDefinitionsPlaceholder() {
        let path = 'ecl-svg-definitions';
        return this.currentPath + path;
    }
}


