Skip to content

Instantly share code, notes, and snippets.

@sawo
Created January 27, 2017 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sawo/5a991a130c138dd3460e4f0f5c1fc2d8 to your computer and use it in GitHub Desktop.
Save sawo/5a991a130c138dd3460e4f0f5c1fc2d8 to your computer and use it in GitHub Desktop.
Page object for the hello world angular application
var helloWorldPageObject = function() {
this.get = function() {
browser.get('');
};
this.title = element(by.id('title'));
this.titleShouldHaveText = function(value) {
expect(this.title.getText()).toBe(value);
};
this.name = element(by.model('name'));
this.setName = function(value) {
this.name.clear();
this.name.sendKeys(value);
};
this.shouldHaveName = function(value) {
expect(this.name.getAttribute('value')).toEqual(value);
};
};
module.exports = new helloWorldPageObject();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment