Jasmine/Protractor: stop test on failure in beforeEach

前端 未结 4 1380
梦谈多话
梦谈多话 2021-02-15 08:18

I am currently writing tests protractor and I was wondering if there is some possibility to cancel test execution as soon as something in the beforeEach fails (and return some u

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-15 09:07

    with jasmine2 we can set throwOnExpectationFailure to true.

    For example in protractor config:

    //protractor.conf.js
    exports.config = {
      //...
      onPrepare: () => {
        jasmine.getEnv().throwOnExpectationFailure(true);
      }
    };
    

提交回复
热议问题