selenium webdriver - Protractor Pause On Failure -


i new protractor , trying figure out how make test/runner pause on failure. ideally love transition nodejs debugger open suggestion.

my use case basically, when test fails see state ui in understand why test failed.

nick.

you can add jasmine config, stop when spec fails: (same how protractor-screenshot-reporter works)

for jasmine 1:

onprepare: function () {     exports.config = {         onprepare: function () {             jasmine.getenv().addreporter({                 reportspecresults: function (spec) {                     if (!spec.results().passed()) {                         spec.results().items_.foreach(function (v) {                             console.log(v.trace.stack);                         });                         browser.pause();                     }                 }             });         }     } } 

for jasmine2:

onprepare: function () {     jasmine.getenv().addreporter({         specdone: function (spec) {             if (spec.status === 'failed') {                 console.dir(spec.failedexpectations.length);                 console.log(spec.failedexpectations[0].message);                 console.log(spec.failedexpectations[0].stack);                 browser.pause();             }         }     }); } 

then typing "repl" in console switch interactive mode, can try out protractor commands.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -