Skip to content

protractor tests : using $interval instead of $timeout for notify duration management #78

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

Open
eprevot opened this issue Apr 12, 2016 · 3 comments

Comments

@eprevot
Copy link

eprevot commented Apr 12, 2016

I use this module in my application to display notifications that disappear after a few seconds, and I write protractor e2e tests : the notifications are not testable.
This issue comes from the $timeout service to manage notification duration : protractor waits for $timeouts (and $http) before to run actions and expectations. So notification with duration can't be tested as they disappear before protractor tests them.
I think you are aware of this since you used the ignoreSynchronization parameter in your own protractor tests. But this is not a solution, we should still be able to let protractor wait for the end of $http requests.
In documentation (https://github.com/angular/protractor/blob/master/docs/timeouts.md), protractor team advises to replace $timeout services by $interval services to this kind of issue.

Have you considered using $interval instead of $timeout ?

@remibd
Copy link

remibd commented Apr 18, 2016

Hi!
I have encountred the same issue: once a notification is fired, Protractor waits for it to disappear and and times out. It blocks e2e testing on any application using ui-notification.

@baconcutter
Copy link

+1

gkniazkov added a commit to gkniazkov/angular-ui-notification that referenced this issue Aug 31, 2016
…rack#78)

Benefits:
 * Protractor doesn't wait untill timeouts will finish after calling clearAll
@gkniazkov
Copy link

Hi guys, please, take a look on this pull request (see PR description).

This solution works for me

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

No branches or pull requests

4 participants