@applitools/driver 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/element.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/element.js
CHANGED
|
@@ -328,25 +328,25 @@ class Element {
|
|
|
328
328
|
}
|
|
329
329
|
const actions = [];
|
|
330
330
|
const xPadding = Math.floor(scrollableRegion.width * 0.1);
|
|
331
|
-
const
|
|
331
|
+
const yTrack = Math.floor(scrollableRegion.y + scrollableRegion.height / 2); // center
|
|
332
332
|
const xLeft = scrollableRegion.y + xPadding;
|
|
333
333
|
const xDirection = remainingOffset.y > 0 ? 'right' : 'left';
|
|
334
334
|
let xRemaining = Math.abs(remainingOffset.x);
|
|
335
335
|
while (xRemaining > 0) {
|
|
336
336
|
const xRight = scrollableRegion.x + Math.min(xRemaining + xPadding, scrollableRegion.width - xPadding);
|
|
337
337
|
const [xStart, xEnd] = xDirection === 'right' ? [xRight, xLeft] : [xLeft, xRight];
|
|
338
|
-
actions.push({ action: 'press', x: xStart, y:
|
|
338
|
+
actions.push({ action: 'press', x: xStart, y: yTrack }, { action: 'wait', ms: 1500 }, { action: 'moveTo', x: xEnd, y: yTrack }, { action: 'release' });
|
|
339
339
|
xRemaining -= xRight - xLeft;
|
|
340
340
|
}
|
|
341
|
-
const yPadding = Math.floor(scrollableRegion.height * 0.
|
|
342
|
-
const
|
|
341
|
+
const yPadding = Math.floor(scrollableRegion.height * 0.1);
|
|
342
|
+
const xTrack = Math.floor(scrollableRegion.x + 5); // a little bit off left border
|
|
343
343
|
const yTop = scrollableRegion.y + yPadding;
|
|
344
344
|
const yDirection = remainingOffset.y > 0 ? 'down' : 'up';
|
|
345
345
|
let yRemaining = Math.abs(remainingOffset.y) + (await this.getTouchPadding()) * 2;
|
|
346
346
|
while (yRemaining > 0) {
|
|
347
347
|
const yBottom = scrollableRegion.y + Math.min(yRemaining + yPadding, scrollableRegion.height - yPadding);
|
|
348
348
|
const [yStart, yEnd] = yDirection === 'down' ? [yBottom, yTop] : [yTop, yBottom];
|
|
349
|
-
actions.push({ action: 'press', x:
|
|
349
|
+
actions.push({ action: 'press', x: xTrack, y: yStart }, { action: 'wait', ms: 1500 }, { action: 'moveTo', x: xTrack, y: yEnd }, { action: 'wait', ms: 1500 }, { action: 'release' });
|
|
350
350
|
yRemaining -= yBottom - yTop;
|
|
351
351
|
}
|
|
352
352
|
if (actions.length > 0) {
|