Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Conditionnally exclude websocket #381

Closed

Description

@lpenet

Hi.

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.

Activity

  1. vicb commented on Jul 20, 2016

    @vicb
    Contributor

    Do you have a simple repro case ?

  2. lpenet commented on Jul 20, 2016

    @lpenet
    Author

    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.

  3. AshMcConnell commented on Mar 3, 2017

    @AshMcConnell

    @lpenet we are having trouble getting protractor to test our app with a websocket. Did you ever get a workaround?

  4. lpenet commented on Mar 3, 2017

    @lpenet
    Author
  5. AshMcConnell commented on Mar 3, 2017

    @AshMcConnell

    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?

  6. JiaLiPassion commented on Mar 3, 2017

    @JiaLiPassion
    Collaborator

    @AshMcConnell , can you post a reproduce repo?

  7. AshMcConnell commented on Mar 3, 2017

    @AshMcConnell

    I'll try to create one

  8. hungerregnuh commented on Apr 1, 2017

    @hungerregnuh

    @JiaLiPassion, a similar issue is being looked at over in the angularfire2 project as well, angular/angularfire#779

  9. JiaLiPassion commented on Apr 2, 2017

    @JiaLiPassion
    Collaborator

    @hungerregnuh , I will check it later.

  10. VladimirMakaev commented on Dec 4, 2017

    @VladimirMakaev

    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.

  11. AshMcConnell commented on Dec 4, 2017

    @AshMcConnell

    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

  12. JiaLiPassion commented on Dec 4, 2017

    @JiaLiPassion
    Collaborator

    @VladimirMakaev , @AshMcConnell , please provide some reproduce repo so I can try to resolve the issue. thanks.

  13. VladimirMakaev commented on Dec 4, 2017

    @VladimirMakaev

    @JiaLiPassion I've reproduced the issue here https://github.com/VladimirMakaev/todo-angular-firebase
    If you run:

    npm run e2e
    

    You'd see the tests failing with

    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.

    // browser.ignoreSynchronization = true;
    
  14. VladimirMakaev commented on Dec 4, 2017

    @VladimirMakaev

    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:

    window.getAllAngularTestabilities()[0].isStable()
    

    image

  15. JiaLiPassion commented on Jul 21, 2019

    @JiaLiPassion
    Collaborator

    close for now, issue is in angular repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions