@applitools/driver 1.3.3 → 1.3.4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  ## Unreleased
4
4
 
5
5
 
6
+ ## 1.3.4 - 2021/11/18
7
+
8
+ - fix capabilities parsing for native apps
9
+
6
10
  ## 1.3.3 - 2021/11/14
7
11
 
8
12
  - do not throw if `getCookies` method is missed in spec driver
@@ -4,7 +4,9 @@ exports.parseCapabilities = void 0;
4
4
  function parseCapabilities(capabilities) {
5
5
  var _a, _b, _c, _d, _e, _f, _g, _h;
6
6
  const info = {
7
- browserName: ((_a = capabilities.browserName) !== null && _a !== void 0 ? _a : (_b = capabilities.desired) === null || _b === void 0 ? void 0 : _b.browserName) || undefined,
7
+ browserName: !capabilities.app
8
+ ? ((_a = capabilities.browserName) !== null && _a !== void 0 ? _a : (_b = capabilities.desired) === null || _b === void 0 ? void 0 : _b.browserName) || undefined
9
+ : undefined,
8
10
  browserVersion: ((_c = capabilities.browserVersion) !== null && _c !== void 0 ? _c : capabilities.version) || undefined,
9
11
  platformName: ((_e = (_d = capabilities.platformName) !== null && _d !== void 0 ? _d : capabilities.platform) !== null && _e !== void 0 ? _e : (_f = capabilities.desired) === null || _f === void 0 ? void 0 : _f.platformName) || undefined,
10
12
  platformVersion: capabilities.platformVersion || undefined,
package/dist/driver.js CHANGED
@@ -156,8 +156,8 @@ class Driver {
156
156
  if (this.isNative) {
157
157
  const barsHeight = await ((_r = (_q = this._spec).getBarsHeight) === null || _r === void 0 ? void 0 : _r.call(_q, this.target).catch(() => undefined));
158
158
  if (barsHeight) {
159
- this._driverInfo.statusBarHeight = Math.max(barsHeight.statusBarHeight, driverInfo.statusBarHeight);
160
- this._driverInfo.navigationBarHeight = Math.max(barsHeight.navigationBarHeight, driverInfo.navigationBarHeight);
159
+ this._driverInfo.statusBarHeight = Math.max(this._driverInfo.statusBarHeight, barsHeight.statusBarHeight);
160
+ this._driverInfo.navigationBarHeight = Math.max(this._driverInfo.navigationBarHeight, barsHeight.navigationBarHeight);
161
161
  }
162
162
  if (this.isAndroid) {
163
163
  this._driverInfo.statusBarHeight /= this.pixelRatio;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -20,7 +20,7 @@ export declare class MockDriver {
20
20
  browserVersion: any;
21
21
  };
22
22
  executeScript(script: any, args?: any[]): Promise<any>;
23
- findElement(selector: any, rootElement: any): Promise<any>;
23
+ findElement(selector: any, rootElement?: any): Promise<any>;
24
24
  findElements(selector: any, rootElement: any): Promise<any>;
25
25
  switchToFrame(reference: any): Promise<this>;
26
26
  switchToParentFrame(): Promise<this>;