page-object icon indicating copy to clipboard operation
page-object copied to clipboard

Add support for Angular (not AngularJS)

Open magynhard opened this issue 7 years ago • 4 comments

I'm going to use page-object to test Angular apps.

As far as i can see, there is support for AngularJS (ajax calls count), but not for Angular (2+). https://github.com/cheezy/page-object/tree/master/lib/page-object/javascript

Is there a plan to support angular?

magynhard avatar Sep 21 '17 06:09 magynhard

create PR ;) it's should not be hard if Angular have ajax count buildin

vveliev avatar Sep 21 '17 13:09 vveliev

There is a watir_angular gem that is still in beta that needs to have requirements honed. For instance I don't like the way it is currently initialized. But It should already be compatible with page object gem. If it isn't let's get it fixed so it is. Would love help on it since I don't actually use angular. :-)

titusfortner avatar Sep 21 '17 19:09 titusfortner

@entwanderer do you know the JavaScript that will return the number of current ajax requests? In AngularJS it is 'angular.element(document.body).injector().get('$http').pendingRequests.length;'. If you can find the equivalent code for Angular then I can easily add it.

cheezy avatar Sep 22 '17 19:09 cheezy

window.getAllAngularTestabilities().filter(zone=>!zone.isStable()).length;

isStable() checks that pendingCount and pendingMacroTasks are both zero and does not return the number of requests pending Getting the actual number of pending requests has been deprecated.

SeanMNorton avatar Dec 04 '19 17:12 SeanMNorton