javascript - Protractor - need to find a happy meduim between the default behavour and jasmine-bail-fast -


i can share frustration lot of professionals default protractor behavior on test failure - keeps running tests , have wait until finishes fix error.

i read related posts , came across jasmine-bail-fast solution. link related post provided here: exit protractor e2e test on fail?

however, solution puts me on other side of pickle. not want terminate testing suite when failed close confirmation message or ran similar minor issues.

i have ability control when exit script via exitonfailure() function or similar. instance, if had block of code:

> browser.wait(function()  >       return browser.iselementpresent(acceptbudgetbutton); >     }, 30000, 'error - unable save budget changes because accept budget button not visible. terminating test run.'); 

and put exitonfailure() after block, want test run exit immediately. however, want test keep on running if exitonfailure() not there.

is there feasible way achieve goal , take control of own destiny?

thank help!

you can handle browser.wait() success , failure cases appropriately:

var ec = protractor.expectedconditions; browser.wait(ec.presenceof(acceptbudgetbutton), 30000).then(     function () {         // success     },      function () {         // failure         console.log('error - unable save budget changes because accept budget button not visible. terminating test run.');         jasmine.getenv().bailfast();     } }); 

also, using fail() function fails test.


Comments