I am using Puppeteer to insert some text (an email address) into an input field on a web page. By reading online docs and blogs, I found two ways to do it. To input the value "directly" by using:
page.$eval('input[type="email"]', element => element.setAttribute("value", "me@mydomain.com"))
or to input the text as a user would do, by using:
page.keyboard.type("me@mydomain.com")
What are the pros/cons of the two commands? When shall I prefer one over the other?