mousedown
event. |
| [move(x, y, options)](./puppeteer.mouse.move.md) | | Dispatches a mousemove
event. |
| [up(options)](./puppeteer.mouse.up.md) | | Dispatches a mouseup
event. |
+| [wheel(options)](./puppeteer.mouse.wheel.md) | | Dispatches a mousewheel
event. |
diff --git a/new-docs/puppeteer.mouse.wheel.md b/new-docs/puppeteer.mouse.wheel.md
new file mode 100644
index 00000000000..0b5aab75f74
--- /dev/null
+++ b/new-docs/puppeteer.mouse.wheel.md
@@ -0,0 +1,42 @@
+
+
+[Home](./index.md) > [puppeteer](./puppeteer.md) > [Mouse](./puppeteer.mouse.md) > [wheel](./puppeteer.mouse.wheel.md)
+
+## Mouse.wheel() method
+
+Dispatches a `mousewheel` event.
+
+Signature:
+
+```typescript
+wheel(options?: MouseWheelOptions): PromiseMouseWheelOptions
. |
+
+Returns:
+
+Promise<void>
+
+## Example
+
+An example of zooming into an element:
+
+```js
+await page.goto('https://mdn.mozillademos.org/en-US/docs/Web/API/Element/wheel_event$samples/Scaling_an_element_via_the_wheel?revision=1587366');
+
+const elem = await page.$('div');
+const boundingBox = await elem.boundingBox();
+await page.mouse.move(
+ boundingBox.x + boundingBox.width / 2,
+ boundingBox.y + boundingBox.height / 2
+);
+
+await page.mouse.wheel({ deltaY: -100 })
+
+```
+
diff --git a/new-docs/puppeteer.mousewheeloptions.deltax.md b/new-docs/puppeteer.mousewheeloptions.deltax.md
new file mode 100644
index 00000000000..1b060aef695
--- /dev/null
+++ b/new-docs/puppeteer.mousewheeloptions.deltax.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [puppeteer](./puppeteer.md) > [MouseWheelOptions](./puppeteer.mousewheeloptions.md) > [deltaX](./puppeteer.mousewheeloptions.deltax.md)
+
+## MouseWheelOptions.deltaX property
+
+Signature:
+
+```typescript
+deltaX?: number;
+```
diff --git a/new-docs/puppeteer.mousewheeloptions.deltay.md b/new-docs/puppeteer.mousewheeloptions.deltay.md
new file mode 100644
index 00000000000..5cfb6f6c46c
--- /dev/null
+++ b/new-docs/puppeteer.mousewheeloptions.deltay.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [puppeteer](./puppeteer.md) > [MouseWheelOptions](./puppeteer.mousewheeloptions.md) > [deltaY](./puppeteer.mousewheeloptions.deltay.md)
+
+## MouseWheelOptions.deltaY property
+
+Signature:
+
+```typescript
+deltaY?: number;
+```
diff --git a/new-docs/puppeteer.mousewheeloptions.md b/new-docs/puppeteer.mousewheeloptions.md
new file mode 100644
index 00000000000..7ff07c3a7ad
--- /dev/null
+++ b/new-docs/puppeteer.mousewheeloptions.md
@@ -0,0 +1,20 @@
+
+
+[Home](./index.md) > [puppeteer](./puppeteer.md) > [MouseWheelOptions](./puppeteer.mousewheeloptions.md)
+
+## MouseWheelOptions interface
+
+
+Signature:
+
+```typescript
+export interface MouseWheelOptions
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [deltaX](./puppeteer.mousewheeloptions.deltax.md) | number | |
+| [deltaY](./puppeteer.mousewheeloptions.deltay.md) | number | |
+
diff --git a/src/common/Input.ts b/src/common/Input.ts
index b395170a71b..30443c92c09 100644
--- a/src/common/Input.ts
+++ b/src/common/Input.ts
@@ -288,6 +288,14 @@ export interface MouseOptions {
clickCount?: number;
}
+/**
+ * @public
+ */
+export interface MouseWheelOptions {
+ deltaX?: number;
+ deltaY?: number;
+}
+
/**
* The Mouse class operates in main-frame CSS pixels
* relative to the top-left corner of the viewport.
@@ -446,6 +454,38 @@ export class Mouse {
clickCount,
});
}
+
+ /**
+ * Dispatches a `mousewheel` event.
+ * @param options - Optional: `MouseWheelOptions`.
+ *
+ * @example
+ * An example of zooming into an element:
+ * ```js
+ * await page.goto('https://mdn.mozillademos.org/en-US/docs/Web/API/Element/wheel_event$samples/Scaling_an_element_via_the_wheel?revision=1587366');
+ *
+ * const elem = await page.$('div');
+ * const boundingBox = await elem.boundingBox();
+ * await page.mouse.move(
+ * boundingBox.x + boundingBox.width / 2,
+ * boundingBox.y + boundingBox.height / 2
+ * );
+ *
+ * await page.mouse.wheel({ deltaY: -100 })
+ * ```
+ */
+ async wheel(options: MouseWheelOptions = {}): Promise