Tip
This plugin is enabled in the ⭐️ recommended.
Add delay between mousedown and mouseup for
Locator.click(),
Locator.dblclick(),
Mouse.click() and
Mouse.dblclick().
Deprecated methods (ex: Page.click()) class are not modified.
If you set the delay property when you call the method, your value will be
used.
This plugin supports the following options:
delay:min(default100): Minimum delay in milliseconds.max(default500): Maximum delay in milliseconds.
Use the plugin with default options.
import { chromium } from "playwright-ghost";
import plugins from "playwright-ghost/plugins";
const browser = await chromium.launch({
plugins: [plugins.humanize.click()],
});
// ...Use the plugin and specify the delay between 50 and 200 milliseconds.
import { chromium } from "playwright-ghost";
import plugins from "playwright-ghost/plugins";
const browser = await chromium.launch({
plugins: [plugins.humanize.click({ delay: { min: 50, max: 200 } })],
});
// ...If you want to import only this plugin, you can use the
"playwright-ghost/plugins/humanize/click" path in the import.
import { chromium } from "playwright-ghost";
import humanizeClickPlugin from "playwright-ghost/plugins/humanize/click";
const browser = await chromium.launch({
plugins: [humanizeClickPlugin()],
});
// ...