在我的业力测试中使用Chrome时,我经常(超过所有运行的50%)看到每次测试都由Chrome执行两次。您可以在下面找到示例输出和我的配置。Chrome在业力运行测试两次
我该如何解决这个问题?原因是什么?
karma start --single-run --browsers Firefox,Chrome
INFO [karma]: Karma v0.12.17 server started at http://localhost:9876/
INFO [launcher]: Starting browser Firefox
INFO [launcher]: Starting browser Chrome
INFO [Chrome 36.0.1985 (Linux)]: Connected on socket RV8G8p63bCLQGaAJW9Hc with id 91444447
Chrome 36.0.1985 (Linux): Executed 0 of 92 SUCCESS (0 secs/0 secs)
Chrome 36.0.1985 (Linux): Executed 1 of 92 SUCCESS (0 secs/0.065 secs)
[...]
Chrome 36.0.1985 (Linux): Executed 91 of 92 SUCCESS (0 secs/0.24 secs)
Chrome 36.0.1985 (Linux): Executed 92 of 92 SUCCESS (0 secs/0.241 secs)
Chrome 36.0.1985 (Linux): Executed 92 of 92 SUCCESS (0.274 secs/0.241 secs)
Chrome 36.0.1985 (Linux): Executed 93 of 92 SUCCESS (0.274 secs/0.258 secs)
[...]
Chrome 36.0.1985 (Linux): Executed 183 of 92 SUCCESS (0.274 secs/0.412 secs)
Chrome 36.0.1985 (Linux): Executed 184 of 92 SUCCESS (0.274 secs/0.413 secs)
INFO [Iceweasel 30.0.0 (Linux)]: Connected on socket 4DISHs7012QeIwhEW9Hd with id 93232241
Chrome 36.0.1985 (Linux): Executed 184 of 92 SUCCESS (0.274 secs/0.413 secs)
Iceweasel 30.0.0 (Linux): Executed 0 of 92 SUCCESS (0 secs/0 secs)
Chrome 36.0.1985 (Linux): Executed 184 of 92 SUCCESS (0.274 secs/0.413 secs)
Iceweasel 30.0.0 (Linux): Executed 1 of 92 SUCCESS (0 secs/0.003 secs)
[...]
Iceweasel 30.0.0 (Linux): Executed 91 of 92 SUCCESS (0 secs/0.201 secs)
Chrome 36.0.1985 (Linux): Executed 184 of 92 SUCCESS (0.274 secs/0.413 secs)
Iceweasel 30.0.0 (Linux): Executed 92 of 92 SUCCESS (0 secs/0.202 secs)
Chrome 36.0.1985 (Linux): Executed 184 of 92 SUCCESS (0.274 secs/0.413 secs)
Iceweasel 30.0.0 (Linux): Executed 92 of 92 SUCCESS (0.303 secs/0.202 secs)
TOTAL: 276 SUCCESS
配置:
module.exports = function(config) {
config.set({
basePath : 'www',
frameworks : [ 'jasmine' ],
files : [ 'js/*' ],
exclude : [ 'spec/lib/*.js' ],
reporters : [ 'progress', 'junit', 'html', 'coverage' ],
coverageReporter : {
type : 'html',
dir : 'coverage/'
},
preprocessors : {
'js/*.js' : 'coverage',
},
junitReporter : {
outputFile : 'test-results.xml'
},
colors : true,
logLevel : config.LOG_INFO,
autoWatch : true,
browsers : [ 'Firefox', 'Chrome' ],
captureTimeout : 20000,
reportSlowerThan : 500,
plugins : [ 'karma-jasmine', 'karma-coverage', 'karma-html-reporter', 'karma-chrome-launcher', 'karma-junit-reporter', 'karma-phantomjs-launcher', 'karma-firefox-launcher' ]
});
};
你的配置文件是怎样的? – andreaspfr
@ seven-ply http://paste.debian.net/110248/ –
当您启动测试时,Chrome上是否有现有选项卡?有时我也遇到了与Safari相同的问题,通常就是这样。 – MarcoL