0
雖然我在做教程AngularJS量角器測試從https://docs.angularjs.org/tutorial/step_02,我得到錯誤信息爲「沒有規格發現」,當我運行e2e測試。這意味着e2e測試沒有發生。我是量角器的新手,我遇到了類似的堆棧溢出問題,但這些問題並沒有真正解決我的問題。角度量角器:如何確保「沒有規格發現」的錯誤不會發生?
我不知道我是否缺少任何配置,或者如果我從錯誤的目錄發出命令。我的問題是我如何確保「沒有規格發現」的錯誤不會發生?
我跑/角phonecat/app目錄的命令爲:NPM運行量角器
該項目的文件夾結構如下:
angular-phonecat
|_____app
|_____app.js
|_____app.spec.js
|_____index.html
|_____e2e-tests
|_____protractor.conf.js
這是應用的內容。 spec.js:
'use strict';
describe('PhoneListController', function() {
beforeEach(module('phonecatApp'));
it('should create a `phones` model with 3 phones', inject(function($controller) {
var scope = {};
var ctrl = $controller('PhoneListController', {$scope: scope});
expect(scope.phones.length).toBe(3);
}));
});
Protractor.conf.js如下:
//jshint strict: false
exports.config = {
allScriptsTimeout: 11000,
specs: [
'*.js'
],
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://localhost:8000/',
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};