alexcrack / angular-ui-notification

Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating
MIT License
536 stars 169 forks source link

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

Open eprevot opened 8 years ago

eprevot commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

+1

gkniazkov commented 7 years ago

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

This solution works for me