Skip to content

Instantly share code, notes, and snippets.

@andresdominguez
Created July 18, 2014 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andresdominguez/c6dca267814122535e48 to your computer and use it in GitHub Desktop.
Save andresdominguez/c6dca267814122535e48 to your computer and use it in GitHub Desktop.
Sample protractor test for todo list in angularjs.org
describe('angularjs homepage todo list', function() {
it('should add a todo', function() {
browser.get('http://www.angularjs.org');
element(by.model('todoText')).sendKeys('write a protractor test');
element(by.css('[value="add"]')).click();
var todoList = element.all(by.repeater('todo in todos'));
expect(todoList.count()).toEqual(3);
expect(todoList.get(2).getText()).toEqual('write a protractor test');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment