To fill an input field using Puppeteer and JavaScript, we call the page.evaluate method.
For instance, we write
await page.evaluate(() => {
const email = document.querySelector("#email");
email.value = "test@example.com";
});
to call page.evaluate with a callback that gets the input with querySelector.
And we set its value to the input value.