This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
$http doesn't immediately increment $brower's outstandingRequestCount. Protractor issues result. #13782
Milestone
Comments
I think this might be since we put the request through a |
wbyoko
added a commit
to wbyoko/angular.js
that referenced
this issue
Jan 27, 2016
The issue is that using $http doesn't update $browser.outstandingRequestCount synchronously so that $browser.notifyWhenNoOutstandingRequests waits accordingly. Configuring this synchronization with the promise chain updates the outstandingRequestCount correctly. Closes angular#13782
wbyoko
added a commit
to wbyoko/angular.js
that referenced
this issue
Jan 27, 2016
The issue is that using $http doesn't update $browser.outstandingRequestCount synchronously so that $browser.notifyWhenNoOutstandingRequests waits accordingly. Configuring this synchronization with the promise chain updates the outstandingRequestCount correctly. Closes angular#13782
I have made pull requests for the 1.4 and master branches which fix this issue. The $q promise needing to be resolved async is the issue and Tests to confirm this interaction were added and when implemented locally protractor waited accordingly. |
gkalpak
added a commit
to gkalpak/angular.js
that referenced
this issue
Jan 28, 2016
This allows protractor to more reliably detect when all outstanding requests have been completed. Fixes angular#13782 Closes angular#13862
gkalpak
added a commit
to gkalpak/angular.js
that referenced
this issue
Jan 28, 2016
This allows protractor to more reliably detect when all outstanding requests have been completed. Fixes angular#13782 Closes angular#13862
wbyoko
added a commit
to wbyoko/angular.js
that referenced
this issue
Feb 10, 2016
The issue is that using $http doesn't update $browser.outstandingRequestCount synchronously so that $browser.notifyWhenNoOutstandingRequests waits accordingly. Configuring this synchronization with the promise chain updates the outstandingRequestCount correctly. Closes angular#13782
heathkit
added a commit
to heathkit/angular.js
that referenced
this issue
Feb 20, 2016
Services such as $location and $http will initiate async calls. Thus, we need to wrap the call to $browser.notifyWhenNoOutstandingRequest in $timeout() in order to give any potentially outstanding async calls a chance to run. Fixes angular#13782
heathkit
added a commit
to heathkit/angular.js
that referenced
this issue
Feb 20, 2016
Services such as $location and $http will initiate async calls. Thus, we need to wrap the call to $browser.notifyWhenNoOutstandingRequest in $timeout() in order to give any potentially outstanding async calls a chance to run. Fixes angular#13782
heathkit
added a commit
to heathkit/angular.js
that referenced
this issue
Feb 20, 2016
Services such as $location and $http will initiate async calls. Thus, we need to wrap the call to $browser.notifyWhenNoOutstandingRequest in $timeout() in order to give any potentially outstanding async calls a chance to run. Fixes angular#13782
heathkit
added a commit
to heathkit/angular.js
that referenced
this issue
Feb 23, 2016
Services such as $location and $http will initiate async calls. Thus, we need to wrap the call to $browser.notifyWhenNoOutstandingRequest in $timeout() in order to give any potentially outstanding async calls a chance to run. Fixes angular#13782
3 tasks
heathkit
added a commit
to heathkit/angular.js
that referenced
this issue
Mar 14, 2016
Services such as $location and $http will initiate async calls. Thus, we need to wrap the call to $browser.notifyWhenNoOutstandingRequest in $timeout() in order to give any potentially outstanding async calls a chance to run. Fixes angular#13782
gkalpak
pushed a commit
to gkalpak/angular.js
that referenced
this issue
Jul 15, 2016
…Count` Calling `$http` will not increment `$browser.outstandingRequestCount` until after all (potentially) asynchronous request interceptors have been processed and will decrement it before any (potentially) asynchronous response interceptors have been processed. This can lead to `$browser.notifyWhenNoOutstandingRequests` firing prematurely, which can be problematic in end-to-end tests. This commit fixes this, by synchronizing the increment/decrement operations with `$http`'s internal interceptor promise chain. Fixes angular#13782 Closes angular#13862
gkalpak
pushed a commit
to gkalpak/angular.js
that referenced
this issue
Jul 15, 2016
…Count` Calling `$http` will not increment `$browser.outstandingRequestCount` until after all (potentially) asynchronous request interceptors have been processed and will decrement it before any (potentially) asynchronous response interceptors have been processed. This can lead to `$browser.notifyWhenNoOutstandingRequests` firing prematurely, which can be problematic in end-to-end tests. This commit fixes this, by synchronizing the increment/decrement operations with `$http`'s internal interceptor promise chain. Fixes angular#13782 Closes angular#13862
3 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
http://jsfiddle.net/awtwff3x/ (using Angular 1.4.8)
The issue is that using $http doesn't seem to register with $browser.defer synchronously so that $browser.notifyWhenNoOutstandingRequests waits accordingly.
This has created an issue where protractor tests are flaky because they aren't waiting for resources to load.
Also seems with $timeout registering synchronously using a $timeout anywhere in a controller will allow for the $http request to register and have the protractor test wait correctly.
You can uncomment line 22 to see that requests queue after $timeout is used, otherwise notifyWhenNoOutstandingRequests returns synchronously.
Thanks.
The text was updated successfully, but these errors were encountered: