問題描述
在升級到 Protractor 4.0.0 并因重大更改調整配置后,我們終于啟動了測試.
After upgrading to Protractor 4.0.0 and adjusting the config because of the breaking changes, we finally have our tests launching.
現在,問題是在測試運行后它失敗了:
Now, the problem is that after a test run it fails with:
[09:52:22] E/launcher - "process.on('uncaughtException'" error, see launcher
[09:52:22] E/launcher - Process exited with error code 199
如何調試此問題并了解其原因?
How to debug this problem and understand what is causing it?
嘗試在疑難解答"模式下運行 Protractor:
Tried to run Protractor in "troubleshoot" mode:
$ protractor config/local.conf.js --troubleshoot
但得到完全相同的輸出,但沒有關于錯誤的詳細信息.
but got exactly the same output with no details about the error.
推薦答案
這是目前正在修復應該是一個熱修復很快.快速修復(在熱修復發布之前)是更改 node_modules 中的代碼或恢復到 3.3.0.
This is currently being fixed and there should be a hot fix out soon. The quick fix (before the hot fix is released) is to change the code in your node_modules or revert to 3.3.0.
編輯 node_modules/protractor/built/launcher.js
將第 168 行的 uncaughtException
替換為:
Edit node_modules/protractor/built/launcher.js
replace the uncaughtException
at line 168 with:
process.on('uncaughtException', function (e) {
var errorCode = exitCodes_1.ErrorHandler.parseError(e);
if (errorCode) {
var protractorError = e;
exitCodes_1.ProtractorError.log(logger, errorCode, protractorError.message, protractorError.stack);
process.exit(errorCode);
}
else {
logger.error(e.message);
logger.error(e.stack);
process.exit(exitCodes_1.ProtractorError.CODE);
}
});
這篇關于量角器運行后出現 uncaughtException的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!