angular/angular.js — pull request #2455 by dereksantos (2013-04-20 04:14:42+00:00)
Title: feat(Future): add ready function to Future object

The ready function allows you to execute a callback function after the Future has been fulfilled. This facilitates deeply nested e2e tests. The ready function takes one argument, either the value of the fulfilled future or an error

Example:

element('#myButton').click().ready(function() {
expect(element('#someElement').html()).toContain('expected value');
});

This will help with an issue like #882

Before(doesn't work):

expect(element('#NavList').text()).toContain(activeLink.text());

After(works):

activeLink.text().ready(function(value) {
expect(element('#NavList').text()).toContain(value);
});