1

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?

Baptiste Arnaud
  • 2,522
  • 3
  • 25
  • 55

1 Answers1

1

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.

Baptiste Arnaud
  • 2,522
  • 3
  • 25
  • 55
  • Yup! For future reference, element-explorer is going away (very very soon) because the control flow is going away. The control flow is selenium-webdriver's promise manager. A quick review of your above code, it looks like you are using async / await. In order to use async / await you would need to turn off the control flow promise manager so element-explorer will not work for you. – cnishina Jan 02 '19 at 20:52