I want to wait for the error message comes out. However, when I use browser.driver.manage().timeouts().implicitlyWait(), but I have to use browser.driver.sleep()
this.getErrorMessage = function () {
var defer = protractor.promise.defer();
browser.driver.sleep(2000); //This works
browser.driver.manage().timeouts().implicitlyWait(2000); // This does not work
browser.driver.findElement(By.xpath(_error_msg_xpath)).getText().then(function (errorMsg) {
defer.fulfill(errorMsg);
});
return defer.promise;
};