Expose a testability public interface #14565
Description
Do you want to request a feature or report a bug?
This is a new feature request.
What is the current behavior?
There is no public interface for determining when an Angular application is ready for automated testing. There are only undocumented, private interfaces like $browser.notifyWhenNoOutstandingRequests
and $$testability
.
What is the motivation / use case for changing the behavior?
I need to manipulate an Angular web page in an automated fashion for testing purposes. I am currently relying on $browser
and notifyWhenNoOutstandingRequests
to determine when a navigation action has completed and all relevant data has been loaded so that I can manipulate the page.
It would be a Big Problem if this mechanism were to disappear or change on me, so I am very interested in getting a proper public API that can meet this need.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular?
This is still a problem in the latest version of Angular (1.5.5). I am unaware if similar functionality existed in the past.
Other information (e.g. stacktraces, related issues, suggestions how to fix)
It was suggested on Issue #13310 that making $$testability.whenStable(callback)
public would be the right way to solve the problem for me. Also acceptable for me is exposing the notifyWhenNoOutstandingRequests
function I'm currently using or something functionally equivalent. I understand that the popular Protractor framework relies on this internally, so it seems like an important interface to the broader Angular community, and it should therefore be made part of the officially documented public interface.