使用--element-explorer无法运行ng e2e [英] Run ng e2e with --element-explorer not working

查看:86
本文介绍了使用--element-explorer无法运行ng e2e的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚如何调试端到端测试。我在一个有角度的项目中使用量角器,并使用 protractor-cucumber-framework 自定义框架。

I'm trying to figure out how I can debug my end to end tests. I'm usage protractor in an angular project and using the protractor-cucumber-framework custom framework.

Given('[...]', async () => {
  await page.goToMeetupsListPage();
  const profile: Profile = getMichel();
  await page.setProfile(JSON.stringify(profile));
  await page.refreshPage();
});

我正在为此功能设置一个断点。

I'm setting a break point in this kind of function.

然后我运行命令 ng e2e --element-explorer ,该命令应该查找断点。

Then I run the command ng e2e --element-explorer which is supposed to look for break points.

然后我在启动时收到此错误:

Then I get this error on launch:

/Users/.../node_modules/protractor/built/debugger.js:212
                    doneDeferred.fulfill(true);
                                 ^
TypeError: doneDeferred.fulfill is not a function
    at Socket.tester.once (/Users/b.../node_modules/protractor/built/debugger.js:212:34)
    at Object.onceWrapper (events.js:273:13)
    at Socket.emit (events.js:182:13)
    at Socket.EventEmitter.emit (domain.js:441:20)
    at TCP._handle.close (net.js:611:12)



<我不知道发生了什么。我尝试删除每个 async / await 关键字,但仍显示相同的消息。知道吗?

I have no idea what's happening. I tried removing every async/await keywords but still the same message. Any idea?

推荐答案

显然-element-explorer 参数似乎没有调试端到端测试。相反,您需要使用-inspect-brk

Apparently --element-explorer param seems not to work for debugging e2e tests. Instead you need to run manually protractor with --inspect-brk

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

然后只需遵循官方指南

这篇关于使用--element-explorer无法运行ng e2e的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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