我正在嘗試對使用AngularJS編寫的應用程序執行一些端到端測試。目前,我在e2e.tests.js中有以下測試設置:使用Jasmine進行端到端測試
describe('MyApp', function() {
beforeEach(function() {
browser().navigateTo('../index.html');
});
it('should be true', function() {
expect(true).toBe(true);
});
});
奇怪的是,這個基本的測試失敗了。測試本身運行。但結果是:
203ms browser navigate to '../index.html'
5ms expect undefined toBe true
http://localhost:81/tests/e2e.tests.js:10:9
expected true but was undefined
考慮到「真」是硬編碼的,我期望它通過這個測試。我不知道真正的未定義如何。我錯過了什麼?
如何在你的index.html中硬編碼「true」? – BKM
[這個答案](http://stackoverflow.com/questions/13173719/is-it-possible-to-mix-testacular-karma-with-angular-scenario)應該有所幫助。 –