@applitools/driver 1.11.4 → 1.11.6

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/driver.js CHANGED
@@ -201,9 +201,9 @@ class Driver {
201
201
  const userAgentInfo = (0, user_agent_1.parseUserAgent)(this._driverInfo.userAgent);
202
202
  const userAgentDataInfo = browserInfo.userAgentData && (0, user_agent_data_1.parseUserAgentData)(browserInfo.userAgentData);
203
203
  this._driverInfo.browserName =
204
- (_r = (_q = userAgentInfo.browserName) !== null && _q !== void 0 ? _q : userAgentDataInfo.browserName) !== null && _r !== void 0 ? _r : this._driverInfo.browserName;
204
+ (_r = (_q = userAgentInfo.browserName) !== null && _q !== void 0 ? _q : userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.browserName) !== null && _r !== void 0 ? _r : this._driverInfo.browserName;
205
205
  this._driverInfo.browserVersion =
206
- (_t = (_s = userAgentInfo.browserVersion) !== null && _s !== void 0 ? _s : userAgentDataInfo.browserVersion) !== null && _t !== void 0 ? _t : this._driverInfo.browserVersion;
206
+ (_t = (_s = userAgentInfo.browserVersion) !== null && _s !== void 0 ? _s : userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.browserVersion) !== null && _t !== void 0 ? _t : this._driverInfo.browserVersion;
207
207
  (_u = (_24 = this._driverInfo).isMobile) !== null && _u !== void 0 ? _u : (_24.isMobile = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.isMobile);
208
208
  (_v = (_25 = this._driverInfo).isChromium) !== null && _v !== void 0 ? _v : (_25.isChromium = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.isChromium);
209
209
  if (this._driverInfo.isMobile) {
package/dist/element.js CHANGED
@@ -191,21 +191,22 @@ class Element {
191
191
  catch (err) {
192
192
  this._logger.warn(`Unable to get the attribute 'contentSize' due to the following error: '${err.message}'`);
193
193
  }
194
- const type = await this.getAttribute('type');
195
- if (type === 'XCUIElementTypeScrollView') {
196
- const elementRegion = await this._spec.getElementRegion(this.driver.target, this.target);
197
- const [childElement] = await this.driver.elements({
198
- type: 'xpath',
199
- selector: '//XCUIElementTypeScrollView[1]/*', // We cannot be sure that our element is the first one
200
- });
201
- const childElementRegion = await this._spec.getElementRegion(this.driver.target, childElement.target);
202
- return {
203
- ...elementRegion,
204
- height: childElementRegion.y + childElementRegion.height - elementRegion.y,
205
- };
194
+ if (this.driver.isIOS) {
195
+ const type = await this.getAttribute('type');
196
+ if (type === 'XCUIElementTypeScrollView') {
197
+ const elementRegion = await this._spec.getElementRegion(this.driver.target, this.target);
198
+ const [childElement] = await this.driver.elements({
199
+ type: 'xpath',
200
+ selector: '//XCUIElementTypeScrollView[1]/*', // We cannot be sure that our element is the first one
201
+ });
202
+ const childElementRegion = await this._spec.getElementRegion(this.driver.target, childElement.target);
203
+ return {
204
+ ...elementRegion,
205
+ height: childElementRegion.y + childElementRegion.height - elementRegion.y,
206
+ };
207
+ }
206
208
  }
207
- else
208
- return this._spec.getElementRegion(this.driver.target, this.target);
209
+ return this._spec.getElementRegion(this.driver.target, this.target);
209
210
  }
210
211
  async getContentSize(options = {}) {
211
212
  if (this._state.contentSize)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.11.4",
3
+ "version": "1.11.6",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -87,9 +87,9 @@
87
87
  }
88
88
  },
89
89
  "dependencies": {
90
- "@applitools/logger": "1.1.29",
91
- "@applitools/snippets": "2.4.7",
92
- "@applitools/utils": "1.3.15",
90
+ "@applitools/logger": "1.1.30",
91
+ "@applitools/snippets": "2.4.8",
92
+ "@applitools/utils": "1.3.16",
93
93
  "semver": "7.3.7"
94
94
  },
95
95
  "devDependencies": {