2017-03-08 4 views
0

私の.NETアプリケーションはAngular &となります。ユーザインターフェイスをテストするためにJasmineフレームワークを使用しています。単体テストログを取得するには?テストが実行された後にブラウザが終了する

KarmaがUIテストを開始するために実行されています。

開発段階で、私は

  1. がどのように私はテストのログを参照してください、今karma start

    を実行することにより、command promptを経由して、それを起動しますが?

  2. debugボタンを押す前でもブラウザが閉じているため、デバッグはほとんど不可能です。 Karma waitの作り方?

ご協力いただければ幸いです。 angularJSで始まったばかりです。申し訳ありませんが、上記の質問があまりにも素朴ではあるが、これを理解しているうちに既に過ごしました。

答えて

1

カルマのシングルランが有効になっています。

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 
     // angular-filesort sorts angular dependencies upon injection to prevent 
     // angular constants loading before angular itself 
     frameworks: ['bower', 'jasmine', 'angular-filesort'], 

     // list of files/patterns to load in the browser 
     files: gulpConfig.karma.files, 


     // list of files to exclude 
     exclude: gulpConfig.karma.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: ['Chrome', 'PhantomJS'], 


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

注:

あなた karma.config.jsで

変更singleRun

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

全ファイルへちょうどあなたがプロンプトから何が起こっているかを見ることができるように記者のいくつかの並べ替えを取得する。また、古き良きはCtrl + C

を使用する連続運転を終了するには

Here利用可能な記者のリストです。

関連する問題