import { $ , $$ , browser , ElementFinder } from 'protractor' ; export class CardTabsPage { tabset = $ ( 'ux-card-tabset' ) ; tabs = $$ ( '.card-tab' ) ; content = $ ( '.card-tab-content' ) ; cardlist = $ ( '.card-tabs-list' ) ; previousBtn = $ ( '.card-tabs-paging-btn-previous' ) ; nextBtn = $ ( '.card-tabs-paging-btn-next' ) ; positionBtn = $ ( '.button-primary' ) ; async getPage ( ) { await browser . get ( '#/card-tabs' ) ; } async getTab ( index ) { return await this . tabs . get ( index ) ; } async getTabContent ( ) { return await this . content . getText ( ) ; } async getTabSelected ( index ) { const tab = await this . getTab ( index ) ; const classes = await tab . getAttribute ( 'class' ) ; return classes . includes ( 'active' ) ; } async getPosition ( ) { return await this . tabset . getAttribute ( 'class' ) ; } async getScrollPosition ( ) { const styles = await this . cardlist . getAttribute ( 'style' ) ; return parseInt ( styles . substring ( styles . indexOf ( 'translateX(' ) + 'translateX(' . length , styles . indexOf ( 'px' ) ) ) ; } }