@applitools/driver 1.8.5 → 1.8.8

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 +10 -1
  2. package/package.json +2 -2
package/dist/element.js CHANGED
@@ -120,7 +120,16 @@ class Element {
120
120
  this._logger.log('Extracting region of native element with selector', this.selector);
121
121
  const region = await this._spec.getElementRegion(this.driver.target, this.target);
122
122
  this._logger.log('Extracted native region', region);
123
- return this.driver.normalizeRegion(region);
123
+ const normalizedRegion = await this.driver.normalizeRegion(region);
124
+ // if element is a child of scrolling element, then region location should be adjusted
125
+ const scrollingElement = await this.context.getScrollingElement();
126
+ if (scrollingElement) {
127
+ const scrollingRegion = await this._spec.getElementRegion(this.driver.target, scrollingElement.target);
128
+ if (utils.geometry.contains(scrollingRegion, region) && !this.equals(scrollingElement)) {
129
+ return utils.geometry.offset(normalizedRegion, await scrollingElement.getScrollOffset());
130
+ }
131
+ }
132
+ return normalizedRegion;
124
133
  }
125
134
  });
126
135
  this._logger.log('Extracted region', region);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.8.5",
3
+ "version": "1.8.8",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -75,7 +75,7 @@
75
75
  "dependencies": {
76
76
  "@applitools/logger": "1.1.5",
77
77
  "@applitools/snippets": "2.2.3",
78
- "@applitools/types": "1.4.2",
78
+ "@applitools/types": "1.4.3",
79
79
  "@applitools/utils": "1.3.0"
80
80
  },
81
81
  "devDependencies": {