Here's the deal - getText() method returns promise, it's okay in case when you are using it inside of expect(), but when I'm trying to return string
value of an element into variable, it returns promise. Here is the code:
var text = mainPage.counter().getText().then((text) => {
return text;
})
Is there any way to get the text and assign it to a variable?