Skip to content

Instantly share code, notes, and snippets.

@ackuser
Forked from andresdominguez/todo-spec.js
Created October 10, 2016 15:57
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 ackuser/3942852129b244a692c5cdf7b0de4174 to your computer and use it in GitHub Desktop.
Save ackuser/3942852129b244a692c5cdf7b0de4174 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