鉴于 e2e 配置:
module.exports = function(config) {
config.set({
basePath: '../',
files: [
'E2E/**/*.js'
],
autoWatch: false,
browsers: ['Chrome'],
frameworks: ['ng-scenario'],
singleRun: true,
proxies: {
'/': 'http://localhost:8000/'
},
plugins: [
'karma-junit-reporter',
'karma-chrome-launcher',
'karma-jasmine',
'karma-ng-scenario'
],
junitReporter: {
outputFile: 'test_out/e2e.xml',
suite: 'e2e'
},
urlRoot: '/_karma_/'
});
};
和场景:
'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('Mailing App', function () {
it('should filter the phone list as user types into the search box', function () {
expect(true).toBe(true);
});
it('should filter the phone list as user types into the search box', function () {
expect(Element('foo').count()).toEqual(1);
});
describe('Sample Test', function () {
beforeEach(function () {
browser().navigateTo('../../Client/Views/Shared/_Layout.cshtml');
});
it('should filter the phone list as user types into the search box', function () {
pause();
expect(Element('.ng-binding')).toBeDefined();
});
});
});
程序找到了 3 个测试,但没有通过或失败,而是跳过它们。运行脚本(使用 Windows 8.1,git bash)返回说:
Karma v0.12.1 服务器启动于HTTP://localhost:9876/ karma /"
启动 Chrome 连接到套接字 Chrome 31.0.1650 执行 0 of 3
(跳过 3)错误
知道为什么可以找到甚至不需要遍历站点或查看 DOM 等的测试但无法运行吗?