Skip to content

Instantly share code, notes, and snippets.

@DavertMik
Created December 23, 2017 22:37
Show Gist options
  • Save DavertMik/f8391402372d5095dbf428aa5da717f6 to your computer and use it in GitHub Desktop.
Save DavertMik/f8391402372d5095dbf428aa5da717f6 to your computer and use it in GitHub Desktop.
it('should create todo item', (I) => {
browser.get("http://todomvc.com/examples/angularjs/#/");
expect(element(by.css("#todo-count")).isPresent()).toBeFalsy();
var inputField = element(by.model("newTodo"));
inputField.sendKeys("Write a guide");
inputField.sendKeys(protractor.Key.ENTER);
var todos = element.all(by.repeater("todo in todos"));
expect(todos.last().getText()).toEqual("Write a guide"));
element(by.css("#todo-count")).getText()).toContain('1 items left');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment