@applitools/driver 1.9.24 → 1.9.25

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.
Files changed (2) hide show
  1. package/dist/element.js +5 -5
  2. package/package.json +2 -2
package/dist/element.js CHANGED
@@ -398,6 +398,11 @@ class Element {
398
398
  const currentScrollOffset = await this.getScrollOffset();
399
399
  if (!(options === null || options === void 0 ? void 0 : options.force) && utils.geometry.equals(offset, currentScrollOffset))
400
400
  return currentScrollOffset;
401
+ if (((_a = this.driver.helper) === null || _a === void 0 ? void 0 : _a.name) === 'android' && utils.geometry.equals(offset, { x: 0, y: 0 })) {
402
+ await this.driver.helper.scrollToTop(this);
403
+ this._state.scrollOffset = offset;
404
+ return this._state.scrollOffset;
405
+ }
401
406
  const contentSize = await this.getContentSize();
402
407
  const scrollableRegion = await this.getClientRegion();
403
408
  const maxOffset = {
@@ -405,11 +410,6 @@ class Element {
405
410
  y: Math.round(scrollableRegion.height * (contentSize.height / scrollableRegion.height - 1)),
406
411
  };
407
412
  const requiredOffset = { x: Math.min(offset.x, maxOffset.x), y: Math.min(offset.y, maxOffset.y) };
408
- if (((_a = this.driver.helper) === null || _a === void 0 ? void 0 : _a.name) === 'android' && utils.geometry.equals(requiredOffset, { x: 0, y: 0 })) {
409
- await this.driver.helper.scrollToTop(this);
410
- this._state.scrollOffset = requiredOffset;
411
- return this._state.scrollOffset;
412
- }
413
413
  let effectiveRegion = scrollableRegion;
414
414
  let remainingOffset = utils.geometry.equals(requiredOffset, { x: 0, y: 0 })
415
415
  ? { x: -maxOffset.x, y: -maxOffset.y } // if it has to be scrolled to the very beginning, then scroll maximum amount of pixels
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.9.24",
3
+ "version": "1.9.25",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -85,7 +85,7 @@
85
85
  "semver": "7.3.7"
86
86
  },
87
87
  "devDependencies": {
88
- "@applitools/bongo": "^2.1.6",
88
+ "@applitools/bongo": "^2.2.0",
89
89
  "@applitools/scripts": "^1.1.0",
90
90
  "@types/mocha": "^9.1.1",
91
91
  "@types/node": "^17.0.31",