Search code examples
angularprotractore2e-testingangular-e2e

Run ng e2e with --element-explorer not working


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.

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)

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


Solution

  • 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
    

    Then just follow the official guide.