import { browser , by , element , $ } from 'protractor' ; export class LoginPage { id = $ ( 'input[name="id"]' ) ; pwd = $ ( 'input[name="pwd"]' ) ; submit = element ( by . buttonText ( 'Login' ) ) ; errMessage = element ( by . id ( 'errMessage' ) ) ; login ( id , password ) { this . id . sendKeys ( id ) ; this . pwd . sendKeys ( password ) ; this . submit . click ( ) ; } navigateToLogin ( ) { return browser . get ( '/login' ) ; } getErrorMessage ( ) { return this . errMessage ; } }