I've taken a look through past issues, and to the best of my knowledge, it does not appear to be addressed (these issues appear similar, but all seem to be closed):
Version Information:
Steps to reproduce:
e2e.conf.coffee
): Copied from https://github.com/angular/protractor/blob/master/docs/referenceConf.js
exports.config =
seleniumServerJar: null
seleniumPort: null
seleniumArgs: []
chromeOnly: true
seleniumAddress: null
sauceUser: null
sauceKey: null
sauceSeleniumAddress: null
specs: ["e2e/*.coffee"]
exclude: []
capabilities:
browserName: "chrome"
count: 1
shardTestFiles: false
maxInstances: 1
multiCapabilities: []
maxSessions: -1
baseUrl: "http://localhost:8081"
rootElement: "body"
allScriptsTimeout: 11000
getPageTimeout: 10000
framework: "jasmine"
jasmineNodeOpts:
isVerbose: true
showColors: true
includeStackTrace: true
defaultTimeoutInterval: 30000
e2e/spec.coffee
describe 'Page', () ->
it 'should debug properly', () ->
browser.get '/'
x = 'There is only X'
y = 1
z = ++y
browser.debugger()
protractor debug e2e.conf.coffee
Expected Result:
repl
mode and accessing a variableResults:
Breakpoint is set in timers.js
, and can't access any variables in scope other than browser
:
protractor debug src/test/e2e.conf.coffee
Using ChromeDriver directly...
Hit SIGUSR1 - starting debugger agent.
debugger listening on port 5858
connecting... ok
break in timers.js:79
77 }
78
79 function listOnTimeout() {
80 var msecs = this.msecs;
81 var list = this;
debug> repl
Press Ctrl + C to leave debug repl
> x
ReferenceError: x is not defined
> y
ReferenceError: y is not defined
> z
ReferenceError: z is not defined
> browser
{ controlFlow: [Function],
schedule: [Function],
getSession: [Function],
getCapabilities: [Function],
quit: [Function],
...
}
I understand why this confusing, but this is actually working as intended. browser.debugger
pauses outside of the scope of your it block, so x, y, and z are in fact not expected to be defined.
The reason that browser.debugger
is exposed is precisely because we don't want to set a breakpoint inside the it block - we want to set it on the control flow in-between when the commands execute.
You can still use good old debugger
and run with the --debug
flag to actually pause within the it block.
Using good old debugger and running protractor with the --debug flag doesn't pause execution at all for me. :-/
what the heck is the point of the above browser.debugger() mode then? If not to debug your test...
Most helpful comment
what the heck is the point of the above browser.debugger() mode then? If not to debug your test...