我可以通过单独运行以下命令来调试e2e测试-
node --inspect-brk .\node_modules\protractor\bin\protractor .\e2e\protractor.conf.js但是,我会分别运行'ng e2e'和上面的调试命令,这将打开两个浏览器,一个用于e2e,另一个用于调试e2e。我希望在调试模式下立即运行e2e测试,并在package.json中为调试模式提供一个配置/命令。
我遇到命令让它和ng一起跑-
node --inspect-brk ./node_modules/\@angular/cli/bin/ng e2e ./protractor.conf.js我在package.json上关注过-
"e2e": "ng e2e -c=integration --suite e2e --webdriverUpdate=false"我试着按照以下方式使用调试命令-
"e2e-debug": "node --inspect-brk .\\node_modules\\@angular\\cli\\bin\\ng e2e -c=integration --suite e2e --webdriverUpdate=false" .\\e2e\\protractor.conf.js在击中chrome://inspect/#devices和检查时,它停在ng的第一线。我得到了未知的选项:'.\e2e\protractor.conf.js'错误,然后停止执行。
我从上面的命令中删除了.\e2e\protractor.conf.js并尝试了如下所示-
"e2e-debug": "node --inspect-brk .\\node_modules\\@angular\\cli\\bin\\ng e2e -c=integration --suite e2e --webdriverUpdate=false"为此,在检查时,它在ng的第一行停止,之后从未在调试器存在的任何规范文件处停止。它在没有停止的情况下完成了运行测试。
知道如何在调试时使用ng e2e命令和选项吗?
发布于 2020-09-17 17:18:33
我写了一篇关于调试量角器测试的文章。如果你还没有提到,请看一看。https://medium.com/@ganeshsirsi/how-to-debug-protractor-tests-in-visual-studio-code-e945fc971a74
https://stackoverflow.com/questions/63751250
复制相似问题