Reputation: 71
I have to use async and await everywhere in my code. How can I get the code below to work with async/await? The code below results in a timeout.
await browser.waitUntil(
async () => (await (await selector).getAttribute("value")) === pricePerUnit
The origin code worked just fine.
selector.setValue(selection)
browser.waitUntil(() => {
return selector.getAttribute('value') === selection
})
Upvotes: 0
Views: 1962
Reputation: 1149
Try this:
await browser.waitUntil(
async () => (await $('#someText').getText()) === 'I am now different',
{
timeout: 5000,
timeoutMsg: 'expected text to be different after 5s'
}
);
Upvotes: 1