@applitools/driver 1.8.7 → 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.
- package/dist/element.js +9 -2
- package/package.json +1 -1
package/dist/element.js
CHANGED
|
@@ -121,8 +121,15 @@ class Element {
|
|
|
121
121
|
const region = await this._spec.getElementRegion(this.driver.target, this.target);
|
|
122
122
|
this._logger.log('Extracted native region', region);
|
|
123
123
|
const normalizedRegion = await this.driver.normalizeRegion(region);
|
|
124
|
-
|
|
125
|
-
|
|
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;
|
|
126
133
|
}
|
|
127
134
|
});
|
|
128
135
|
this._logger.log('Extracted region', region);
|