jeudi 21 juillet 2016

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

I can share frustration with a lot of professionals about default protractor behavior on test failure - it just keeps running the tests and you have to wait until it finishes to fix the error.

I read the related posts and came across jasmine-bail-fast solution. Link to related post is provided here: Exit Protractor e2e test on fail?

However, this solution puts me on the other side of the pickle. I do NOT want to terminate the testing suite when it failed to close the confirmation message or ran into similar minor issues.

I would like to have the ability to control when to exit the script via exitonfailure() function or something similar. For instance, if had this block of code:

> browser.wait(function() 
>       return browser.isElementPresent(acceptBudgetButton);
>     }, 30000, 'Error - Unable to save budget changes because Accept Budget button is not visible. Terminating test run.');

and put exitonfailure() after this block, I want my test run to exit immediately. However, I want to test keep on running if exitonfailure() is not there.

Is there a feasible way to achieve this goal and take control of my own destiny?

Thank you for your help!

Aucun commentaire:

Enregistrer un commentaire