I want the execution to stop immediately if one of my test fails but in my code, it keeps on executing the other tests. How can I do that?

While running Jest Selenium Webdriver test, I want the execution to stop immediately if one of my test fails but in my code, it keeps on executing the other tests. How can I do that?

Hi Ana,

You can put your test cases in a try block and quit the driver in the catch block immediately when there is any exception. This would suffice your use case. You can refer to this sample repo for reference: https://github.com/LambdaTest/jest-selenium-webdriver-sample/blob/master/test/single.test.js