@@ -1120,8 +1120,10 @@ Protractor.prototype.debugger = function() {
1120
1120
* browser.pause() in your test to enter the protractor debugger from that
1121
1121
* point in the control flow.
1122
1122
* Does not require changes to the command line (no need to add 'debug').
1123
+ *
1124
+ * @param {=number } opt_debugPort Optional port to use for the debugging process
1123
1125
*/
1124
- Protractor . prototype . pause = function ( ) {
1126
+ Protractor . prototype . pause = function ( opt_debugPort ) {
1125
1127
// Patch in a function to help us visualize what's going on in the control
1126
1128
// flow.
1127
1129
webdriver . promise . ControlFlow . prototype . getControlFlowText = function ( ) {
@@ -1171,6 +1173,10 @@ Protractor.prototype.pause = function() {
1171
1173
return asString ;
1172
1174
} ;
1173
1175
1176
+ if ( opt_debugPort ) {
1177
+ process . debugPort = opt_debugPort ;
1178
+ }
1179
+
1174
1180
// Call this private function instead of sending SIGUSR1 because Windows.
1175
1181
process . _debugProcess ( process . pid ) ;
1176
1182
var flow = webdriver . promise . controlFlow ( ) ;
@@ -1179,7 +1185,7 @@ Protractor.prototype.pause = function() {
1179
1185
console . log ( 'Starting WebDriver debugger in a child process. Pause is ' +
1180
1186
'still beta, please report issues at github.com/angular/protractor' ) ;
1181
1187
var nodedebug = require ( 'child_process' ) .
1182
- fork ( __dirname + '/wddebugger.js' , [ 'localhost:5858' ] ) ;
1188
+ fork ( __dirname + '/wddebugger.js' , [ process . debugPort ] ) ;
1183
1189
process . on ( 'exit' , function ( ) {
1184
1190
nodedebug . kill ( 'SIGTERM' ) ;
1185
1191
} ) ;
0 commit comments