angular-notify icon indicating copy to clipboard operation
angular-notify copied to clipboard

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

Open mpellerin42 opened this issue 8 years ago • 4 comments

Hi,

I use this module in my application, and I started to write e2e tests with protractor. There is no problem when writing tests for function using notification which stay on screen, but notification with duration attribute 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 expectation. So notification with duration can't be tested as they disappears before protractor tests them. In documentation (https://github.com/angular/protractor/blob/master/docs/timeouts.md), protractor team precognise to replace $timeout services by $interval services to this kind of issue.

Can you try that to allow protractor testing of notifications with duration ?

mpellerin42 avatar Aug 26 '15 11:08 mpellerin42

:+1: We are running into the same issue, and using $interval would solve a big headache for us.

holm avatar Oct 07 '15 12:10 holm

I have made a fork that changes to $interval here: https://github.com/peakon/angular-notify

holm avatar Oct 09 '15 09:10 holm

Coud that be used in the main branch ? Otherwise we will have to implement our own...

samudurand avatar Jan 14 '16 08:01 samudurand

@holm thanks for your fork, it works for me :+1:

mpospelov avatar Apr 08 '16 13:04 mpospelov