Skip to content

Instantly share code, notes, and snippets.

@danrasmuson
Created October 31, 2014 14:13
Show Gist options
  • Select an option

  • Save danrasmuson/0de34f9d0c1435d1f517 to your computer and use it in GitHub Desktop.

Select an option

Save danrasmuson/0de34f9d0c1435d1f517 to your computer and use it in GitHub Desktop.
var deferred = protractor.promise.defer();
var promise = deferred.promise;
promise.then(function() {
...
});
promise.then(function() {
...
}).then(function() {
...
}).then(null, function() {
...
}).then(function() {
}, function() {
...
}).then(onSuccess, onFailure);
// success
deferred.fulfill(value);
//failure
deferred.reject(new Error('a problem occurs'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment