cheezy / page-object

Gem to implement PageObject pattern in watir-webdriver and selenium-webdriver
MIT License
653 stars 220 forks source link

Add support for Angular (not AngularJS) #450

Open magynhard opened 7 years ago

magynhard commented 7 years ago

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?

vveliev commented 7 years ago

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

titusfortner commented 7 years ago

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. :-)

cheezy commented 7 years ago

@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.

SeanMNorton commented 4 years ago

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.