Created
August 7, 2016 19:16
-
-
Save anil826/003ceea2890b0c8272853275e5d3eb84 to your computer and use it in GitHub Desktop.
The Page Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var AngularPage = function () { | |
browser.get('http://www.angularjs.org'); | |
}; | |
AngularPage.prototype = Object.create({}, { | |
todoText: { get: function () { return element(by.model('todoText')); }}, | |
addButton: { get: function () { return element(by.css('[value="add"]')); }}, | |
yourName: { get: function () { return element(by.model('yourName')); }}, | |
greeting: { get: function () { return element(by.binding('yourName')).getText(); }}, | |
todoList: { get: function () { return element.all(by.repeater('todo in todos')); }}, | |
typeName: { value: function (keys) { return this.yourName.sendKeys(keys); }}, | |
todoAt: { value: function (idx) { return this.todoList.get(idx).getText(); }}, | |
addTodo: { value: function (todo) { | |
this.todoText.sendKeys(todo); | |
this.addButton.click(); | |
}} | |
}); | |
module.exports = AngularPage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment