I'm trying to write unit tests for the AngularJS TODO MVC application, and I'm a bit stuck learning the e2e testing syntax.
So far, here's what I have:
describe('todomvc', function () {
beforeEach(function () {
browser().navigateTo('../app/index.html');
});
afterEach(function() {
localStorage.clear();
});
describe('localstorage behavior', function() {
it('should load with zero items in localstorage', function() {
expect(repeater('#todo-list li').count()).toEqual(0);
input('newTodo').enter('Foo Bar');
expect(repeater('#todo-list li').count()).toEqual(1);
});
});
});
And my config:
basePath = '../';
files = [
ANGULAR_SCENARIO,
ANGULAR_SCENARIO_ADAPTER,
'test/e2e/**/*.js'
];
autoWatch = false;
browsers = ['Chrome'];
//singleRun = true;
proxies = {
'/': 'http://localhost:8000/'
};
junitReporter = {
outputFile: 'test_out/e2e.xml',
suite: 'e2e'
};
In short, I need a way to simulate the "enter" key because that's how this TODO MVC app adds items to the list. How can I do this?