相关疑难解决方法(0)

Karma - Chrome失败2次(无法启动).放弃

我一直在尝试使用karma-chrome-launcher运行我的测试,但每次运行我的测试时都会抛出此错误:

INFO [启动器]:启动浏览器Chrome错误[启动器]:无法启动Chrome

INFO [launcher]: Trying to start Chrome again (1/2).
ERROR [launcher]: Cannot start Chrome

INFO [launcher]: Trying to start Chrome again (2/2).
ERROR [launcher]: Cannot start Chrome

ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.
Run Code Online (Sandbox Code Playgroud)

这是我的karma.conf.js代码:

// Karma configuration
// Generated on Mon Mar 23 2015 14:04:19 GMT-0300 (BRT)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: 'www',


    // frameworks to use
    // available …
Run Code Online (Sandbox Code Playgroud)

google-chrome jasmine karma-jasmine

21
推荐指数
3
解决办法
2万
查看次数

在本地运行业力时,phantomjs将无法启动

在我的Ubuntu VM上的项目上从本地安装运行Karma时,Karma将无法运行,因为PhantomJS无法启动.

版本信息:

  • PhantomJS(也在本地安装):1.9.16
  • 业力:0.12.31
  • karma-phantomjs-launcher:0.1.4
  • Ubuntu 14.04.2 LTS
  • 节点0.10.25

同样的脚本在我的Mac OS上运行得很好(我在运行它之前删除了全局的业力安装,但它仍然有效).

在Ubuntu上,如果我直接通过./node_modules/phantomjs/bin/phantomjs启动phantomjs,它就会正常启动.

这是shell输出:

> ./node_modules/karma/bin/karma start test/karma.conf.js

DEBUG [config]: autoWatch set to false, because of singleRun
DEBUG [plugin]: Loading karma-* from /srv/detectiveui/node_modules
DEBUG [plugin]: Loading plugin /srv/detectiveui/node_modules/karma-jasmine.
DEBUG [plugin]: Loading plugin /srv/detectiveui/node_modules/karma-phantomjs-launcher.
DEBUG [plugin]: Loading plugin /srv/detectiveui/node_modules/karma-spec-reporter.
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
DEBUG [temp-dir]: Creating temp dir at /tmp/karma-42625347
DEBUG [launcher]: /srv/detectiveui/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs /tmp/karma-42625347/capture.js
DEBUG [launcher]: Process PhantomJS exited with code 2 …
Run Code Online (Sandbox Code Playgroud)

phantomjs karma-runner ubuntu-14.04

6
推荐指数
1
解决办法
4439
查看次数