I am using ng2-idle to automatically log out after a while. I initialize it in my appComponent constructor:
import {Idle, DEFAULT_INTERRUPTSOURCES} from '@ng-idle/core';
export class AppComponent {
constructor(
private idle:Idle) {
idle.setIdle(21600);
idle.setTimeout(1);
idle.setInterrupts(DEFAULT_INTERRUPTSOURCES);
idle.onTimeout.subscribe(() => { this.logout(); });
};
After a successful login, I ran it in my LoginComponent using this.idle.watch()(Idle is injected into the constructor).
All this works fine, but when I go to run my protractor tests, they time out, I think, because the protractor has to wait for the timeout to take, which will take some time, since I set ng2-idle for 6 hours!
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
If I do not initialize the use Idle.watch(), then the tests are executed.
, Idle.stop(); onPrepare protractor reset Idle.watch(); onComplete.
var idle = require('@ng-idle/core'); confractor conf, :
ReferenceError:
, ng2-idle ?