Hello,
I’m getting an error when trying to use step “I.usePlaywrightTo”.
The test looks like this:
Scenario.only('Test',() => {
I.usePlaywrightTo('Try to get userId from response', async ({ page }) => {
let response = await page.waitForResponse(`/api/user/create`);
await page.click('button#create');
// response = JSON.parse(response.body().toString());
// console.log(response);
});
});
The error is:
– FAILURES:
1) Tests
Test:
Not async function!
function (_x) {
return _ref2.apply(this, arguments);
}
Native helpers API is asynchronous, please update this function be async
Error: Not async function!
function (_x) {
return _ref2.apply(this, arguments);
What am I doing wrong? How should I update this function to make it async?