You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/src/utils/test/playwright/drag-element.ts
+15-2Lines changed: 15 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,18 @@ import type { ElementHandle, Locator } from '@playwright/test';
10
10
11
11
importtype{E2EPage}from'./';
12
12
13
+
/**
14
+
* Drags an element by the given number of pixels on the X and Y axes.
15
+
*
16
+
* @param el The element to drag.
17
+
* @param page The E2E Page object.
18
+
* @param dragByX The number of pixels to drag on the X axis. Negative values drag left, positive values drag right.
19
+
* @param dragByY The number of pixels to drag on the Y axis. Negative values drag up, positive values drag down.
20
+
* @param startXCoord The X coordinate to start the drag from. Defaults to the center of the element.
21
+
* @param startYCoord The Y coordinate to start the drag from. Defaults to the center of the element.
22
+
* @param releaseDrag Whether to release the drag at the end of the gesture. Defaults to `true`.
23
+
* @param steps The number of steps to divide the drag into. More steps reduce velocity; fewer steps increase it. Use this to control whether velocity-based thresholds (e.g. full-swipe) are triggered, particularly in Safari where gesture velocity is calculated relative to animation frames. Defaults to `10`.
0 commit comments