2👍
There is at least one problem with your custom wait function is that you don’t have a return
. But, anyway, there is a presenceOf
built-in ExpectedCondition
that fits your use case:
var EC = protractor.ExpectedConditions;
browser.wait(EC.presenceOf(element), 5000);
Source:stackexchange.com