Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protractor times out when Carousel is present #1319

Closed
giggio opened this issue Feb 16, 2017 · 4 comments
Closed

Protractor times out when Carousel is present #1319

giggio opened this issue Feb 16, 2017 · 4 comments

Comments

@giggio
Copy link

giggio commented Feb 16, 2017

Bug description:

Protractor times out when Carousel is present.
You will get this message:

Timed out waiting for asynchronous Angular tasks to finish after 11 seconds.

Link to minimally-working plunker that reproduces the issue:

You can use any of your carousel plunkers. Simply run protractor against it, and it will timeout.

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 2.4.3

ng-bootstrap: 1.0.0-alpha16

Bootstrap: 4.0.0-alpha.5

Protractor: 5.0.0

@giggio
Copy link
Author

giggio commented Feb 16, 2017

It seems earlier versions had similar problems with Angular 1. See angular-ui/bootstrap#2454

@wesleycho
Copy link
Member

My gut feeling here is that this is a Protractor issue, not an ng-bootstrap issue.

@wesleycho
Copy link
Member

wesleycho commented May 25, 2017

I took a look at this, and this appears to be inconsistent. Here is an app generated by Angular CLI that illustrates this: https://github.com/wesleycho/carousel-protractor .

What seems to happen is that actions are blocked until the page navigation is complete, but in the meantime the carousel is already running. This smells like a Protractor issue to me.

@ivarvolt
Copy link

ivarvolt commented Jan 27, 2018

Protractor hangs when there are intervals used. For Protractor to work interval has to be run outside of Angular scope. This can be achieved using ngZone.

So I had the same problem. Right now my workaround is:

set carouselConfig.interval = 0;
(Seems if I dont define it, some default is used? if its 0 then interval wont be started.)

To have the carousel interval functionality in component:

  @ViewChild(NgbCarousel)
  private carousel: NgbCarousel;

In ngOnInit I have code:

    this.ngZone.runOutsideAngular(()=>{
      setInterval(() => {
        this.ngZone.run( () => {
          this.carousel.next();
        });
      },3000);
    });

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

No branches or pull requests

4 participants