Waiting for the error message to appear seems to be a bit tricky. I tried using browser.driver.manage().timeouts().implicitlyWait() but had to resort to using browser.driver.sleep() instead.
this.getErrorMessage = function () {
var defer = protractor.promise.defer();
browser.driver.sleep(2000); //This method works
browser.driver.manage().timeouts().implicitlyWait(2000); // This method does not work as expected
browser.driver.findElement(By.xpath(_error_msg_xpath)).getText().then(function (errorMsg) {
defer.fulfill(errorMsg);
});
return defer.promise;
};