For some reasons, I am trying to replace TestCafe Async / Await with Promises. Below is the chunk of code where I used the promises in place of await.
But getting an error like: A call to an async function is not awaited. Use the "await" keyword before actions, assertions or chains of them
to ensure that they run in the right sequence.
If you don't want to use async/await, you can return a Promise from the test function:
fixture `Example`
.page `example.com`;
test(`example`, t => {
let promise = Promise.resolve(t);
return promise
.then(result => {
return result.typeText('...');
})
.then(result => {
return result.click('...');
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With