import { browser , by , element } from 'protractor' ; export class TimelinePage { async getPage ( ) { await browser . get ( '#/timeline' ) ; } addEvent = element ( by . id ( 'button' ) ) ; timeline = element ( by . id ( 'timeline' ) ) ; resetBtn = element ( by . id ( 'reset-btn' ) ) ; getNumberOfEvents ( ) { return this . timeline . $ ( 'div.timeline' ) . $$ ( 'ux-timeline-event' ) . count ( ) ; } getEvent ( index ) { return this . timeline . $ ( 'div.timeline' ) . $$ ( 'ux-timeline-event' ) . get ( index ) ; } getEventBadge ( index ) { return this . getEvent ( index ) . $ ( '.timeline-badge' ) ; } getEventPanel ( index ) { return this . getEvent ( index ) . $ ( '.timeline-panel' ) ; } getEventBadgeTitle ( index ) { return this . getEventBadge ( index ) . getText ( ) ; } getEventPanelText ( index ) { return this . getEventPanel ( index ) . $ ( 'p' ) . getText ( ) ; } reset ( ) { return this . resetBtn . click ( ) ; } }