0

マイナスイオンアプリのユニットテスト用にジャスミンとカルマを統合しています。 私はこれに従いますblogkarma chrome not loading.its 2回の試行後に諦めます。

私がkarma startコマンドを実行すると、この結果が得られます。

23 02 2017 16:39:18.508:WARN [カルマ]:いいえ捕獲ブラウザ、オープン 23 02 2017 16:39:18.517:INFOは[​​カルマ]:カルマV1.5.0サーバーはhttp://0.0.0.0:9876/ 23 02 2017年に開始しました16:39:18.517:INFO [ランチャー]:無制限の同時実行性を備えたブラウザChromeを起動します。 23 02 2017 16:39:18.536:INFO [ランチャー]:ブラウザを起動しています 23 02 2017 16:40:18.537:WARN [ランチャー]クロムは60000ミリ秒でキャプチャしていない、殺している。 23 02 2017 16:40:18.910:INFO [ランチャー]:再びChromeを起動しようとしています(1/2)。 23 02 2017 16:41:18.911:WARN [ランチャー]:クロムは60000ミリ秒で捕獲されず、殺しました。 23 02 2017 16:41:19.357:INFO [ランチャー]:Chromeをもう一度起動しようとしています(2/2)。 PhantomJSで試してみました

同じエラー無制限の同時実行 23 02 2017 17と

発射ブラウザPhantomJS:44:30.214:INFO [ランチャー]:

23 02 2017 17ブラウザPhantomJSを開始:45:30.215:WARN [ランチャー]:PhantomJSは60000ミリ秒で捕らえていない。

23 02 2017 17:45:30.238:INFO [ランチャー]:もう一度PhantomJSを起動しようとしています(1/2)。 23 02 2017 17:46:30.239:WARN [ランチャー]:PhantomJSは60000ミリ秒で捕獲せず、殺しました。

23 02 2017 17:46:30.246:INFO [ランチャー]:PhantomJSを再開しようとしました(2/2)。

23 02 2017 17:47:30.247:WARN [ランチャー]:PhantomJSは60000 msでキャプチャしていません。

23 02 2017 17:47:30.254:ERROR [ランチャー]:PhantomJSが2回失敗しました(タイムアウト)。あきらめる。

コンフィグ

// Karma configuration 
 
// Generated on Thu Feb 23 2017 10:39:27 GMT+0530 (IST) 
 

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

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

 

 
    // frameworks to use 
 
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 
 
    frameworks: ['jasmine'], 
 

 

 
    // list of files/patterns to load in the browser 
 
    files: [ 
 
     '../www/lib/ionic/js/ionic.bundle.js', 
 
     '../www/js/**/*.js', 
 
     '../tests/unit-tests/**/*.js', 
 
     '../node_modules/angular-mocks/angular-mocks.js' 
 
    ], 
 

 

 

 
    // list of files to exclude 
 
    exclude: [ 
 
    ], 
 

 

 
    // preprocess matching files before serving them to the browser 
 
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 
 
    preprocessors: { 
 
    }, 
 

 

 
    // test results reporter to use 
 
    // possible values: 'dots', 'progress' 
 
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter 
 
    reporters: ['progress'], 
 

 

 
    // web server port 
 
    port: 9876, 
 

 

 
    // enable/disable colors in the output (reporters and logs) 
 
    colors: true, 
 

 

 
    // level of logging 
 
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 
 
    logLevel: config.LOG_INFO, 
 

 

 
    // enable/disable watching file and executing tests whenever any file changes 
 
    autoWatch: true, 
 

 

 
    // start these browsers 
 
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 
 
    // browsers: ['PhantomJS'], 
 
    browsers: ['Chrome'], 
 
    // customLaunchers: { 
 
    // Chrome_no_sandbox: { 
 
    //  base: 'Chrome', 
 
    //  flags: ['--no-sandbox'] 
 
    // } 
 
    // }, 
 
    plugins:[ 
 
      'karma-jasmine', 
 
      'karma-phantomjs-launcher', 
 
      'karma-chrome-launcher' 
 
      ], 
 
    
 

 

 

 

 
    // Continuous Integration mode 
 
    // if true, Karma captures browsers, runs the tests and exits 
 
    singleRun: false, 
 

 

 
    // Concurrency level 
 
    // how many browser should be started simultaneous 
 
    concurrency: Infinity, 
 
    
 
    }) 
 
}

感謝を助けてください!

+0

同じポートが他のアプリケーションで使用されているかどうかを確認してください。 –

+1

他のプロセスで使用されていないことを確認しました。 開いているURLは次のようになります http:// localhost:9876 /?id = 74605681 –

+0

karma.conf.jsをアップロードしてください –

答えて

0

Thisは、ファイルをkarma.conf.jsするには、以下のコードを追加してみてくださいと言う:

browsers: ['Chrome_no_sandbox'], 
    customLaunchers: { 
     Chrome_no_sandbox: { 
     base: 'Chrome', 
     flags: ['--no-sandbox'] 
     } 
    } 
+1

同じ結果です。 –

+0

使用しているクロムのバージョン。 –

+0

クロム:バージョン56.0.2924.87(64ビット) Ubuntu 16。04LTS –

関連する問題