2016-07-18 17 views
1

分度器とキュウリを使って私の角型アプリケーションをテストしようとしていますが、期待値が偽であればモカを使って作成します仕様はコンソールに表示されません。分度器とCucumber.js:期待は期待通りに機能しません。

ルートhttp://localhost:9000/#/form29/form29に関連するHTML "

... 

<h4 class="title"> 
    The title 
</h4> 

... 

そして、私のステップは、それをファイルには、次のとおりです。

//form29_steps.js

var chai = require('chai'), 
     chaiAsPromised = require('chai-as-promised'), 
     assert; 

chai.use(chaiAsPromised); 
expect = chai.expect; 

module.exports = function() { 

    this.Given(/^I am in the form 29 page$/, function (done) { 
     browser.get('http://localhost:9000/#/form29/form29'); 
     done(); 
    }); 

    this.Then(/^should be the title "(.*)"/,function(title, done){ 
     var el = element(by.css('.title')); 

     el.getText().then(function(text){ 
      //a false expect 
      expect(title).to.eq('Aaaaa'); 
      done(); 
     }); 

    }); 

}; 

その有効なのOKを期待する場合、予想が失敗したときにエラーが発生するとは期待できず、次のように表示されます。

[16:14:08] E/launcher - "process.on('uncaughtException'" error, see launcher 
[16:14:08] E/launcher - Process exited with error code 199 

私は同じことをしようとしたが、これは、私は私が望むエラーが出るだけでなく

this.Then(/^should be the title "(.*)"/,function(title, done){ 
    var el = element(by.css('.title')); 

    expect(title).to.eq('A'); 
    done(); 
}); 

働くと約束を使用していない:

Message: 
    AssertionError: expected 'Formulario 29' to equal 'A' 
     at World.<anonymous> (/protractor/test/e2e/features/step_definitions/form29_steps.js:18:20) 
     at _combinedTickCallback (internal/process/next_tick.js:67:7) 
     at process._tickCallback (internal/process/next_tick.js:98:9) 

なぜこれが起こるのか?

+0

キャッチされない例外は、さまざまなことを意味する可能性がありますが、[私は最近それを持っていました](http://stackoverflow.com/questions/38397965/uncaughtexception-after-a-protractor-run)。 – alecxe

答えて

2
[16:14:08] E/launcher - "process.on('uncaughtException'" error, see launcher 
[16:14:08] E/launcher - Process exited with error code 199 

上記エラーは、約束にほとんど関連する様々な理由に起因することができます。しかし、それは正しいメッセージを投げるべきです。ここには、正確なエラーメッセージをキャッチするために、ここではすでにhttps://github.com/angular/protractor/issues/3384が提供されています。

問題をデバッグするために上記のフォーラムで述べたように、分度器の依存関係のファイルをlauncher.tsに変更することができます。

関連する問題