量角器调试问题 - 等待调试器断开连接 [英] Protractor Debugging Issue - Waiting for the debugger to disconnect

查看:60
本文介绍了量角器调试问题 - 等待调试器断开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 VSCode 上调试量角器脚本.

I am trying to debug protractor scripts on VSCode.

我编辑了 launch.json 文件,但调试控制台抛出以下错误.

I edited the launch.json file but the debug console throws the below error.

这是 VSCode 调试控制台输出:

Here is the VSCode Debug Console Output:

C:\Program Files\nodejs\node.exe --inspect-brk=45448 conf.js C:\Users\abc\AppData\Roaming\npm\node_modules\protractor\example/conf.js 

Debugger listening on ws://127.0.0.1:45448/ab61a2d7-4b40-456b-86cb-838e94dfe5b0

Debugger attached.

Waiting for the debugger to disconnect...

我也无法在网上的任何地方找到解决方案.

I am not able to find a solution anywhere online either.

推荐答案

在 VSCode 中设置断点时,需要运行以下命令:

When you set your breakpoint in VSCode, you'll need to run the following:

node --inspect-brk ./node_modules/.bin/protractor conf.js

以上路径假设 Protractor 安装在项目本地的 node_modules/.bin/ 目录中.

The path above assumes Protractor is installed in your node_modules/.bin/ directory locally in your project.

接下来导航到 chrome://inspect.您将不得不跳过 Protractor 的入口点,然后您应该点击断点.确保您使用的是节点 8 以避免获得 polyfill-ed 承诺.

Next navigate to chrome://inspect. You will have to skip the entry point of Protractor and then you should hit your breakpoint. Make sure you are using node 8 to avoid getting polyfill-ed promises.

我们在 ng-conf 视频中详细介绍了这一点.我们使用一个脚本 使用此 e2e-debug 命令 相当于上面的.

We go over this in detail in the ng-conf video. We kick off the test with a script that uses this e2e-debug command which is the equivalent to the above.

这篇关于量角器调试问题 - 等待调试器断开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆