Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: make x/y more clear (#31606)

Max Schmitt5c8fe5c33c9a
diff --git a/docs/src/api/class-mouse.md b/docs/src/api/class-mouse.md
index 78319d9b93..08eb74a072 100644
--- a/docs/src/api/class-mouse.md
+++ b/docs/src/api/class-mouse.md
@@ -68,10 +68,14 @@ Shortcut for [`method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`
* since: v1.8
- `x` <[float]>
+X coordinate relative to the main frame's viewport in CSS pixels.
+
### param: Mouse.click.y
* since: v1.8
- `y` <[float]>
+Y coordinate relative to the main frame's viewport in CSS pixels.
+
### option: Mouse.click.button = %%-input-button-%%
* since: v1.8
@@ -93,10 +97,14 @@ Shortcut for [`method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`
* since: v1.8
- `x` <[float]>
+X coordinate relative to the main frame's viewport in CSS pixels.
+
### param: Mouse.dblclick.y
* since: v1.8
- `y` <[float]>
+Y coordinate relative to the main frame's viewport in CSS pixels.
+
### option: Mouse.dblclick.button = %%-input-button-%%
* since: v1.8
@@ -123,10 +131,14 @@ Dispatches a `mousemove` event.
* since: v1.8
- `x` <[float]>
+X coordinate relative to the main frame's viewport in CSS pixels.
+
### param: Mouse.move.y
* since: v1.8
- `y` <[float]>
+Y coordinate relative to the main frame's viewport in CSS pixels.
+
### option: Mouse.move.steps
* since: v1.8
- `steps` <[int]>
diff --git a/docs/src/api/class-touchscreen.md b/docs/src/api/class-touchscreen.md
index 79fd134dca..ac5405f30d 100644
--- a/docs/src/api/class-touchscreen.md
+++ b/docs/src/api/class-touchscreen.md
@@ -17,10 +17,14 @@ Dispatches a `touchstart` and `touchend` event with a single touch at the positi
* since: v1.8
- `x` <[float]>
+X coordinate relative to the main frame's viewport in CSS pixels.
+
### param: Touchscreen.tap.y
* since: v1.8
- `y` <[float]>
+Y coordinate relative to the main frame's viewport in CSS pixels.
+
## async method: Touchscreen.touch
* since: v1.46
diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index a5496980e2..68f260bfa2 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -18707,8 +18707,8 @@ export interface Mouse {
* Shortcut for [mouse.move(x, y[, options])](https://playwright.dev/docs/api/class-mouse#mouse-move),
* [mouse.down([options])](https://playwright.dev/docs/api/class-mouse#mouse-down),
* [mouse.up([options])](https://playwright.dev/docs/api/class-mouse#mouse-up).
- * @param x
- * @param y
+ * @param x X coordinate relative to the main frame's viewport in CSS pixels.
+ * @param y Y coordinate relative to the main frame's viewport in CSS pixels.
* @param options
*/
click(x: number, y: number, options?: {
@@ -18734,8 +18734,8 @@ export interface Mouse {
* [mouse.up([options])](https://playwright.dev/docs/api/class-mouse#mouse-up),
* [mouse.down([options])](https://playwright.dev/docs/api/class-mouse#mouse-down) and
* [mouse.up([options])](https://playwright.dev/docs/api/class-mouse#mouse-up).
- * @param x
- * @param y
+ * @param x X coordinate relative to the main frame's viewport in CSS pixels.
+ * @param y Y coordinate relative to the main frame's viewport in CSS pixels.
* @param options
*/
dblclick(x: number, y: number, options?: {
@@ -18768,8 +18768,8 @@ export interface Mouse {
/**
* Dispatches a `mousemove` event.
- * @param x
- * @param y
+ * @param x X coordinate relative to the main frame's viewport in CSS pixels.
+ * @param y Y coordinate relative to the main frame's viewport in CSS pixels.
* @param options
*/
move(x: number, y: number, options?: {
@@ -19678,8 +19678,8 @@ export interface Touchscreen {
*
* **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) the method will throw
* if `hasTouch` option of the browser context is false.
- * @param x
- * @param y
+ * @param x X coordinate relative to the main frame's viewport in CSS pixels.
+ * @param y Y coordinate relative to the main frame's viewport in CSS pixels.
*/
tap(x: number, y: number): Promise<void>;