I'm trying to write end-to-end tests. I'm using cytoscape.js and angular 11. Cytoscape.js constantly renders a canvas to make graph visualization. So change detection is always triggered. To eliminate that I'm using the runOutsideAngular method of ngZone
like below
this.ngZone.runOutsideAngular(() => {
this._g.cy = cytoscape({
container: containerElem,
zoom: 1,
});
});
So with this way change detection is not fired constantly.
I'm also checking the detected changes in my main angular component with the below code.
ngAfterViewChecked(): void {
console.log('change detected!');
}
My problem is with end-to-end testing. In tests even if there aren't any changes (I'm opening the developer console and checking) and the website looks idle, I see that the test still waits for something. It WAITS LIKE 5-6 seconds. This makes all my tests take too much time.
I'm suspecting from waitForAngular. But since there are not changes, it shouldn't be the reason.
Any ideas? Thank you