Creation
To create a promise in protractor, use the following code snippet:
var deferred = protractor.promise.defer();
var promise = deferred.promise;
Callbacks
The callbacks are invoked asynchronously.
You would be able to register one (or more) "on success" callbacks using the following code snippet:
promise.then(function() {
...
});
you can additionally register one (or more) "on error" callback:
promise.then(null, function() {
...
});
These registrations could be chained:
promise.then(function() {
...
}).then(function() {
...
}).then(null, function() {
...
}).then(function() {
}, function() {
...
}).then(onSuccess, onFailure);
Resolution
Success
The "on success" callbacks are invoked once the promise is resolved successfully:
deferred.fulfill(value);
Failure
The "on failure" callbacks are invoked once the promise is resolved successfully:
deferred.reject(new Error('a problem occurs'));
In your code, you missed the resolution step. You have to fulfill the promise. A more complete reference is obtainable within the Webdriver.js documentation