How to stop protractor from running further testcases on failure?

前端 未结 4 875
轮回少年
轮回少年 2020-12-15 04:13

Is there a way of quitting test suite and stop executing further test cases, if a test case fails in protractor?

4条回答
  •  鱼传尺愫
    2020-12-15 05:08

    jasmine-bail-fast didn't work in my case. Not sure if it was because of some conflicts with my other report plugins.

    In case anyone is having the same problem. You can try protractor-fast-fail

    import failFast from 'protractor-fail-fast';
    
    exports.config = {
      // if import statement doesn't work, use this instead of import for older versions of node
      // plugins: [{
      //  package: 'protractor-fail-fast'
      // }],
    
      onPrepare: function() {
        jasmine.getEnv().addReporter(failFast.init());
      },
    
      afterLaunch: function() {
        failFast.clean(); 
      }  
    }
    

    Worked perfectly well for me.

    EDIT: added import statement in code snippet to reflect readme of projactor-fast-fail

提交回复
热议问题