import { by , element , ElementFinder } from 'protractor' ; import { promise } from 'selenium-webdriver' ; import { AppPage } from './app.po' ; export class SimpleScrollPage extends AppPage { getPath ( ) { return '/simple' ; } triggerScrollAlwaysButton ( ) { return this . triggerAButton ( by . css ( '#testScrollInView1' ) ) ; } triggerScrollInViewButton ( ) { return this . triggerAButton ( by . css ( '#testScrollInView2' ) ) ; } triggerLastHeadingButton ( ) { return this . triggerAButton ( by . css ( '#goToLastHeadingButton' ) ) ; } triggerOffsetButton ( ) { return this . triggerAButton ( by . css ( '#offsetButton' ) ) ; } triggerNegativeOffsetButton ( ) { return this . triggerAButton ( by . css ( '#negativeOffsetButton' ) ) ; } triggerFinishButton ( ) { return this . triggerAButton ( by . css ( '#finishEventButton' ) ) ; } triggerDynamicTargetButton ( ) { return this . triggerAButton ( by . css ( '#dynamicTargetButton' ) ) ; } selectDifferentDynamicScrollTarget ( ) { const select = element ( by . css ( '#dynamicTargetSelect' ) ) ; this . scrollToElement ( select ) ; select . click ( ) ; return element ( by . css ( '#mat-option-1' ) ) . click ( ) ; } triggerToTopWithSpeedButton ( ) { return this . triggerAButton ( by . css ( '#toTopWithSpeed' ) ) ; } getHead1VerticalPosition ( ) { return this . getVerticalPosition ( by . css ( '#head1' ) ) ; } getHead7VerticalPosition ( ) { return this . getVerticalPosition ( by . css ( '#head7' ) ) ; } getHead10VerticalPosition ( ) { return this . getVerticalPosition ( by . css ( '#head10' ) ) ; } }