Protractor does a number of things that are really helpful. They're all based on the ideas that Edwin brought up. Protractor knows that the app you're testing is an Angular app, so it knows you're using certain services and so it'll actually load those services in and watch them for you.
For example, in a typical end-to-end test (using WebDriverJS or some other framework) you have lots of waits/sleeps. You click a button that requires an Ajax request and then you have to put in a 3-4 second sleep to wait until that Ajax call returns. Well, in Angular, all Ajax requests are (or should be) done using the $http
module. Protractor watches the $http
module and automatically adds in sleeps for you while your requests are pending and your page is rendering. So you no longer have to guess how long a request is going to take and then you don't have to worry about your tests failing because a request took too long.
It also allows you to find elements based on things like the input's ng-model
or by {{bindings}}
on the page or by an ng-repeat
element so that you can easily and quickly find the elements that you want to test.
Julie actually explains why she developed Protractor over using WebDriver in this video and she answers this very question at the end during the Q&A session (though the quality of the video is pretty rough so it can be annoying to watch).