Help me please to achieve the expected result. I am going to fill each input field on the page with a text: '123'.
let inputList = await page.$$('.form input');
inputList.map(async item => {
await item.type('123');
});
Expected Result - 123 in each field.
Actual Result - 112233 on the last input field.
item.typecalls to run in parallel, so don't usemapbut afor … ofloop whereawaitstops the iteration.for ... ofworks for my case :-)mapanyway as you didn't want to produce a new array.