You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
I am having an issue when testing an angular 2 app with protractor which, AFAIK, boils down to how Zone.js is tracking websockets.
My app relies on websockets for push notifications. The socket is kept opened and, so, the zone is never stable, the angular2 app is never stable and protractor waits forever.
It would be great to have an option not to monitor WS and WSS the same way as standard HTTP(S) requests.
Reacted by tje512, Vladimir Makaev, Stephen Wille, Domas Trijonis and Taras Halynskyi
That's a shame as that's really the big advantage of protractor (it's angular integration). So it's essentially broke for Angular 2 if you use websockets (which a lot of people will for hot reloading during development).
We have the same issue in an app that uses Firebase. We'd have to disable protractor support for Angular to get it working but that's essentially making us use plain Selenium with a lot of custom waits.
We ended up going for Cypress, it feels much more solid and natural for Angular testing. I know this isn't a proper answer to the question, but we got so much more by moving to Cypress
Failed: Timed out waiting for asynchronous Angular tasks to finish after 40 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular
At the same time if you uncomment the line in app.e2e-spec.ts you'd get them pass.
Essentially it all goes down to Angular Testability constantly returning false for isStable()
if you go to https://ng2-todo-app.firebaseapp.com/tasks and in console enter:
Activity
vicb commentedon Jul 20, 2016
Do you have a simple repro case ?
lpenet commentedon Jul 20, 2016
As I am using java and tomcat on server side, providing you a plunker might be a bit difficult.
But, well, I think any case where the client connects to a server with a websocket that gets suspended is concerned.
AshMcConnell commentedon Mar 3, 2017
@lpenet we are having trouble getting protractor to test our app with a websocket. Did you ever get a workaround?
lpenet commentedon Mar 3, 2017
AshMcConnell commentedon Mar 3, 2017
Thanks Ludovic
That's a shame as that's really the big advantage of protractor (it's angular integration). So it's essentially broke for Angular 2 if you use websockets (which a lot of people will for hot reloading during development).
Has anyone else got any workarounds?
JiaLiPassion commentedon Mar 3, 2017
@AshMcConnell , can you post a reproduce repo?
AshMcConnell commentedon Mar 3, 2017
I'll try to create one
hungerregnuh commentedon Apr 1, 2017
@JiaLiPassion, a similar issue is being looked at over in the angularfire2 project as well, angular/angularfire#779
JiaLiPassion commentedon Apr 2, 2017
@hungerregnuh , I will check it later.
VladimirMakaev commentedon Dec 4, 2017
We have the same issue in an app that uses Firebase. We'd have to disable protractor support for Angular to get it working but that's essentially making us use plain Selenium with a lot of custom waits.
AshMcConnell commentedon Dec 4, 2017
We ended up going for Cypress, it feels much more solid and natural for Angular testing. I know this isn't a proper answer to the question, but we got so much more by moving to Cypress
JiaLiPassion commentedon Dec 4, 2017
@VladimirMakaev , @AshMcConnell , please provide some reproduce repo so I can try to resolve the issue. thanks.
VladimirMakaev commentedon Dec 4, 2017
@JiaLiPassion I've reproduced the issue here https://github.com/VladimirMakaev/todo-angular-firebase
If you run:
You'd see the tests failing with
At the same time if you uncomment the line in
app.e2e-spec.tsyou'd get them pass.VladimirMakaev commentedon Dec 4, 2017
Essentially it all goes down to Angular Testability constantly returning false for isStable()
if you go to https://ng2-todo-app.firebaseapp.com/tasks and in console enter:
JiaLiPassion commentedon Jul 21, 2019
close for now, issue is in angular repo.