import { browser , by , element , Key } from 'protractor' ; export class FocusIndicatorButtonsPage { target = element ( by . id ( 'target' ) ) ; indicatorLabel = element ( by . id ( 'indicator-label' ) ) ; mouseToggle = element ( by . id ( 'mouse-toggle' ) ) ; keyboardToggle = element ( by . id ( 'keyboard-toggle' ) ) ; programmaticToggle = element ( by . id ( 'programmatic-toggle' ) ) ; async getPage ( ) { await browser . get ( '#/focus-indicator' ) ; } async getFocusIndicatorClass ( ) { const classList = await this . target . getAttribute ( 'class' ) ; return classList . split ( ' ' ) . indexOf ( 'ux-focus-indicator' ) !== - 1 ; } async getFocusIndicatorActiveClass ( ) { const classList = await this . target . getAttribute ( 'class' ) ; return classList . split ( ' ' ) . indexOf ( 'ux-focus-indicator-active' ) !== - 1 ; } async getIndicatorLabel ( ) { return this . indicatorLabel . getText ( ) ; } async setProgrammaticFocus ( ) { return browser . executeScript ( 'document.querySelector("#target").focus()' ) ; } async setContainerFocused ( ) { return browser . executeScript ( 'document.querySelector("#container").focus()' ) ; } async pressTab ( ) { return browser . actions ( ) . sendKeys ( Key . TAB ) . perform ( ) ; } }