Search code examples
jasmineprotractornode-inspector

How to use node-inspector with protractor?


To use node inspector you normally run app using:

 node-inspector app.js

But if I'm using protractor I use the protractor binary, which in turn runs node.

I had a look at the docs for protractor and webdriverjs but can't see a way to re-configure protractor (jasmine) to use the node-inspector binary.

I'm starting to look at files in the protractor folder like cli.js, runner.js. These allow me to config node with flags, but not the actual node binary. Plus digging around in these files is starting to feel a bit hacky.

Is there a nice simple way to configure protractor to use node-inspector?


Solution

  • You should run the node inspector with these arguments:

    $ npm install -g node-inspector
    $ node --debug-brk node_modules/protractor/lib/cli.js protractor.conf.js
    
    # Open a new terminal and run the node inspector:
    $ node-inspector
    
    # Open your browser with this url: http://127.0.0.1:8080/debug?port=5858