AngularJS TODO MVC アプリケーションの単体テストを作成しようとしていますが、e2e テスト構文の学習に少し行き詰まっています。
これまでのところ、ここに私が持っているものがあります:
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);
});
});
});
そして私の設定:
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'
};
つまり、「Enter」キーをシミュレートする方法が必要です。これは、この TODO MVC アプリが項目をリストに追加する方法だからです。これどうやってするの?