Just starting out with typescript, so go easy on me. I'm currently refactoring some selenium tests using protractor and angular.
I've created a method to wrap
browser.wait(ExpectedConditions.presenceOf(element));
My tests were passing fine when the code above was inline, but now they're failing. Should the extracted method below be async since browser.wait returns a promise..?
async waitForAsync(element) {
browser.wait(ExpectedConditions.presenceOf(element));
}
[Edit]
If I have a method getElementText()
getElementText(element){
return element.getText(); // getText returns a promise
}
I just want to be able to call it like this
const myText = getElementText(element);
and have it return the text instead of the promise. Should I make this method async?