karma-ng-scenario icon indicating copy to clipboard operation
karma-ng-scenario copied to clipboard

Selector failure in afterEach may trigger an infinite loop

Open bsod90 opened this issue 8 years ago • 0 comments

The scenario is following:

  1. Spec constantly fails for some reason
  2. Spec failure triggers an afterEach()
  3. afterEach() tries to do something that requires calling an 'element' (reLogin in my case).
  4. element() fails
  5. Exception handler at angular-scenario:33243 call done() with failure for the SPEC
try {
        behavior.call(self, $window, $document, done);
      } catch(e) {
        if (e.type && e.type === 'selector') {
          done(e.message);
        } else {
          throw e;
        }
      }
  1. spec failure retriggers afterEach()
  2. loop

bsod90 avatar Mar 07 '16 22:03 bsod90