Tell us about your environment:
What steps will reproduce the problem?
The code that reproduces the issue is:
const puppeteer = require('puppeteer');
async function run() {
const browser = await puppeteer.launch({
headless: false,
slowMo: 250
});
const page = await browser.newPage();
page.setViewport({ width: 1280, height: 700 });
await page.goto('https://www.labs.octasimo.com/puppeteer/test-page-type-delay.html', {
waitUntil: 'networkidle0'
});
await page.type('.firstname', 'Mickey', {delay: 10});
await page.type('.lastname', 'Mouse', {delay: 10});
await page.waitFor(5000);
await browser.close();
}
run();
What is the expected result?
That puppeteer respects the delay option passed in page.type method.
What happens instead?
delay option passed in page.type method gets overwritten by slowMo option passed to puppeteer.launch method.
@octasimo, thanks for filing this.
There are no exceptions for the slowMo option: it slows down all interactions between pptr and browser. We'd like to keep it this way to be predictable and to keep codebase simple.
Closing this for now; we can reconsider this later if there's more demand.
@aslushnikov
I think we should allow individual delays. Browsers run differently on different CPUs, and it's nice to have the ability to slow down certain browser actions to make sure they produce the same results.
I think we should allow individual delays. Browsers run differently on different CPUs, and it's nice to have the ability to slow down certain browser actions to make sure they produce the same results.
@sojungko this is polyfillable atop of Puppeteer API: you can use ES6 Proxy to wrap Puppeteer's objects to insert timeouts before or after method calls.
Most helpful comment
@aslushnikov
I think we should allow individual delays. Browsers run differently on different CPUs, and it's nice to have the ability to slow down certain browser actions to make sure they produce the same results.