I'm trying to debug Protractor-E2E-Tests
but my test doesn't pause on browser.debugger()
. My attempt to achieve this is to
browser.debugger()
to my test's code grunt serve
to start my application protractor debug protractor.conf.js
my console output for step 3 is the following:
Starting background Express server
debugger listening on port 5858
Express server listening on 9000, in development mode
my console ouput for step 4 is the following:
$ protractor debug protractor.conf.js
Starting debugger agent.
debugger listening on port 5858
Starting selenium standalone server...
connecting... ok
debug> Selenium standalone server started at http://192.168.1.101:57265/wd/hub
.........
Finished in 10.737 seconds
So it runs the test without pausing as intended...
Here's my protractor.conf.js:
'use strict';
exports.config = {
allScriptsTimeout: 110000,
baseUrl: 'http://localhost:' + (process.env.PORT || '9000'),
// list of files / patterns to load in the browser
specs: [
'e2e/**/*.spec.js'
],
capabilities: {
'browserName': 'chrome'
},
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
edit
and here's my test's code:
it('should help to debug', function(done) {
console.log('before debugger'); //gets displayed in console
browser.debugger();
console.log('after debugger'); //gets displayed in console as well, but shouldn't
done();
});
Any help is appreciated!
I'm on windows, I have Angular universal. When I had both debugger()
and pause()
worked for me. It paused and I could navigate in cmd:
browser.pause();
browser.debugger();
use browser.pause(); --see details at http://angular.github.io/protractor/#/api?view=Protractor.prototype.pause
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.