import { $ , $$ , browser , ElementFinder } from 'protractor' ; export class TabsTestPageComponent { minimalCheckbox = $ ( '#minimal-checkbox' ) ; stackNoneRadio = $ ( '#stack-none-radio' ) ; stackLeftRadio = $ ( '#stack-left-radio' ) ; stackRightRadio = $ ( '#stack-right-radio' ) ; addTab0 = $ ( '#add-tab-0' ) ; tabsetHost = $ ( 'ux-tabset' ) ; tabset = $ ( '.nav-tabs' ) ; tabs = $$ ( '.nav-item' ) ; selectedTab = $ ( '.nav-item.active' ) ; selectedLabel = $ ( '#selected-tab' ) ; async getPage ( ) { await browser . get ( '#/tabs' ) ; } async getTabCount ( ) { return await this . tabs . count ( ) ; } async getSelectedTab ( ) { return await this . selectedTab . getText ( ) ; } async getSelectedTabContent ( ) { return ( await this . getSelectedTabElement ( ) ) . getText ( ) ; } async getTabsetStyle ( ) { const classes = await this . tabset . getAttribute ( 'class' ) ; return classes . includes ( 'minimal-tab' ) ? 'minimal' : 'alternative' ; } async getTabsetStack ( ) { const classes = await this . tabsetHost . getAttribute ( 'class' ) ; if ( classes . includes ( 'tabs-left' ) ) { return 'left' ; } if ( classes . includes ( 'tabs-right' ) ) { return 'right' ; } return 'none' ; } async clickTabAtIndex ( index ) { await this . tabs . get ( index ) . click ( ) ; } async pressKey ( key ) { return await browser . actions ( ) . sendKeys ( key ) . perform ( ) ; } async getSelectedLabelText ( ) { return await this . selectedLabel . getText ( ) ; } async getSelectedTabElement ( ) { return await $$ ( 'ux-tab > .tab-pane' ) . filter ( async ( pane ) => await pane . getCssValue ( 'display' ) === 'block' ) . first ( ) ; } }