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
}
};