Before all my tests (running in jasmine under protractor) I have to login to my system and if login fails I should not run any test. But even when I use proccess.exit
(which is node feature to halt program execution), tests are still executed and all failed .
beforeAll(function(done){
mainPage.resize();
loginPage.login(env.regularUser).then(function(){
mainPage.navigate();
mainPage.waitLoading();
done();
}, function(){
process.exit(1);
});
});
How can I prevent tests execution in beforeAll
block?
If I understand correctly, this is the same or a related problem to:
In other words, this is something a testing framework (in this case jasmine
) should have. At the moment, this is an open feature request.
As a current workaround, use jasmine-bail-fast
third-party package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With