jeudi 28 février 2019

Hijack the it() that protractor provides

I need to hijack the it() that the protractor provides to this:

let it_save = it;
it = function(str, fn, to){
  try{
    it_save(str, fn, to);
  }catch(e){
    fail(e);
  }
};

I don't want to do this in every spec file in the beforeAll function. I tried putting this code in onPrepare config option but that throws an error. Is there any way I could achieve this in one place?

Also is there any other way I can fail fast as soon as a error is thrown inside an it? Right now even if an error is thrown the it function runs for the specified defaultTimeoutInterval.

Aucun commentaire:

Enregistrer un commentaire