This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
FoodLoop-Web/e2e/login.po.ts

32 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

import { browser, element, by } from 'protractor';
2017-08-25 10:55:53 +00:00
export class LoginPageObject {
navigateTo() {
return browser.get('/login');
}
getLoginHeaderText() {
return element(by.css('app-root h1')).getText();
}
getEmailField() { return element(by.id('username')); }
getPasswordField() { return element(by.id('password')); }
getLoginButton() { return element(by.id('login')); }
isEmailFieldPresent() { return this.getEmailField().isPresent(); }
isPasswordFieldPresent() { return this.getPasswordField().isPresent(); }
isLoginButtonPresent() { return this.getLoginButton().isPresent(); }
getEmailFieldType() { return this.getEmailField().getAttribute('type'); }
getPasswordFieldType() { return this.getPasswordField().getAttribute('type'); }
getLoginButtonType() { return this.getLoginButton().getAttribute('type'); }
isLoginButtonEnabled() { return this.getLoginButton().isEnabled(); }
clearEmailField() { return this.getEmailField().clear() };
clearPasswordField() { return this.getPasswordField().clear() };
fillEmailFieldWith(text) { return this.getEmailField().sendKeys(text) };
fillPasswordFieldWith(text) { return this.getPasswordField().sendKeys(text) };
}