diff --git a/docs/debugging.md b/docs/debugging.md index 7e886cf79..b6ec782a9 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -124,12 +124,13 @@ protractor debug debugging/failureConf.js This uses the [node debugger](http://nodejs.org/api/debugger.html). Enter `c` to start execution and continue after the breakpoint. -We use `browser.debugger();` instead of node's `debugger;` statement so that -the test pauses after the get command has been executed. Using `debugger;` +`browser.debugger();` is different from from node's `debugger;` statement because +it adds a breakpoint task asynchronous queue. This means the example above will +pause after the `get` statement has been executing. Using `debugger;` pauses the test after the get command is scheduled but has not yet -been sent to the browser. +been executed. -Protractor's `debugger` method works by scheduling a node debug breakpoint +Protractor's `debugger()` method works by scheduling a node debug breakpoint on the control flow. When `debugger()` is called, it also inserts all the client side scripts diff --git a/lib/protractor.js b/lib/protractor.js index 5f40f5175..87f9ed54f 100644 --- a/lib/protractor.js +++ b/lib/protractor.js @@ -563,8 +563,8 @@ Protractor.prototype.getLocationAbsUrl = function() { }; /** - * Pauses the test and injects some helper functions into the browser, so that - * debugging may be done in the browser console. + * Adds a task to the control flow to pause the test and inject helper functions + * into the browser, so that debugging may be done in the browser console. * * This should be used under node in debug mode, i.e. with * protractor debug