@applitools/driver
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -6,2 +6,6 @@ # Change Log | ||
## 1.3.2 - 2021/11/14 | ||
- adjust scrolling algorithm on native devices | ||
## 1.3.1 - 2021/11/14 | ||
@@ -8,0 +12,0 @@ |
@@ -331,3 +331,3 @@ "use strict"; | ||
const xPadding = Math.floor(scrollableRegion.width * 0.1); | ||
const yCenter = Math.floor(scrollableRegion.y + scrollableRegion.height / 2); | ||
const yTrack = Math.floor(scrollableRegion.y + scrollableRegion.height / 2); // center | ||
const xLeft = scrollableRegion.y + xPadding; | ||
@@ -339,7 +339,7 @@ const xDirection = remainingOffset.y > 0 ? 'right' : 'left'; | ||
const [xStart, xEnd] = xDirection === 'right' ? [xRight, xLeft] : [xLeft, xRight]; | ||
actions.push({ action: 'press', x: xStart, y: yCenter }, { action: 'wait', ms: 1500 }, { action: 'moveTo', x: xEnd, y: yCenter }, { action: 'release' }); | ||
actions.push({ action: 'press', x: xStart, y: yTrack }, { action: 'wait', ms: 1500 }, { action: 'moveTo', x: xEnd, y: yTrack }, { action: 'release' }); | ||
xRemaining -= xRight - xLeft; | ||
} | ||
const yPadding = Math.floor(scrollableRegion.height * 0.08); | ||
const xCenter = Math.floor(scrollableRegion.x + scrollableRegion.width / 2); // 0 | ||
const yPadding = Math.floor(scrollableRegion.height * 0.1); | ||
const xTrack = Math.floor(scrollableRegion.x + 5); // a little bit off left border | ||
const yTop = scrollableRegion.y + yPadding; | ||
@@ -351,3 +351,3 @@ const yDirection = remainingOffset.y > 0 ? 'down' : 'up'; | ||
const [yStart, yEnd] = yDirection === 'down' ? [yBottom, yTop] : [yTop, yBottom]; | ||
actions.push({ action: 'press', x: xCenter, y: yStart }, { action: 'wait', ms: 1500 }, { action: 'moveTo', x: xCenter, y: yEnd }, { action: 'wait', ms: 1500 }, { action: 'release' }); | ||
actions.push({ action: 'press', x: xTrack, y: yStart }, { action: 'wait', ms: 1500 }, { action: 'moveTo', x: xTrack, y: yEnd }, { action: 'wait', ms: 1500 }, { action: 'release' }); | ||
yRemaining -= yBottom - yTop; | ||
@@ -354,0 +354,0 @@ } |
{ | ||
"name": "@applitools/driver", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Applitools universal framework wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
130787