@applitools/driver 1.11.5 → 1.11.7

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 +18 -14
  2. package/package.json +4 -4
package/dist/element.js CHANGED
@@ -53,6 +53,9 @@ class Element {
53
53
  if (specUtils.isSimpleCommonSelector(this._selector)) {
54
54
  this._commonSelector = this._selector;
55
55
  }
56
+ else if (utils.types.isString(this._selector)) {
57
+ this._commonSelector = { selector: this._selector };
58
+ }
56
59
  else if (this._selector && this._spec.untransformSelector) {
57
60
  this._commonSelector = this._spec.untransformSelector(this._spec.transformSelector(this._selector));
58
61
  }
@@ -191,21 +194,22 @@ class Element {
191
194
  catch (err) {
192
195
  this._logger.warn(`Unable to get the attribute 'contentSize' due to the following error: '${err.message}'`);
193
196
  }
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
- };
197
+ if (this.driver.isIOS) {
198
+ const type = await this.getAttribute('type');
199
+ if (type === 'XCUIElementTypeScrollView') {
200
+ const elementRegion = await this._spec.getElementRegion(this.driver.target, this.target);
201
+ const [childElement] = await this.driver.elements({
202
+ type: 'xpath',
203
+ selector: '//XCUIElementTypeScrollView[1]/*', // We cannot be sure that our element is the first one
204
+ });
205
+ const childElementRegion = await this._spec.getElementRegion(this.driver.target, childElement.target);
206
+ return {
207
+ ...elementRegion,
208
+ height: childElementRegion.y + childElementRegion.height - elementRegion.y,
209
+ };
210
+ }
206
211
  }
207
- else
208
- return this._spec.getElementRegion(this.driver.target, this.target);
212
+ return this._spec.getElementRegion(this.driver.target, this.target);
209
213
  }
210
214
  async getContentSize(options = {}) {
211
215
  if (this._state.contentSize)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.11.5",
3
+ "version": "1.11.7",
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": {