@applitools/driver 1.12.3 → 1.13.0

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
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.13.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.12.4...js/driver@1.13.0) (2023-07-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * added auto applitools lib detection ([#1707](https://github.com/applitools/eyes.sdk.javascript1/issues/1707)) ([7d439b5](https://github.com/applitools/eyes.sdk.javascript1/commit/7d439b52af55f3b0596c9d35d6ba85c717448023))
9
+
10
+ ## [1.12.4](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.12.3...js/driver@1.12.4) (2023-06-28)
11
+
12
+
13
+ ### Dependencies
14
+
15
+ * @applitools/utils bumped from 1.4.0 to 1.5.0
16
+ #### Features
17
+
18
+ * handled abandoned tunnels ([#1669](https://github.com/applitools/eyes.sdk.javascript1/issues/1669)) ([e01a9f6](https://github.com/applitools/eyes.sdk.javascript1/commit/e01a9f6f7543fc5e6bd842acf6ee8de8cfb49998))
19
+ * @applitools/logger bumped from 2.0.4 to 2.0.5
20
+
21
+
3
22
  ## [1.12.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.12.2...js/driver@1.12.3) (2023-06-21)
4
23
 
5
24
 
@@ -1,8 +1,32 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.extractCapabilitiesViewport = exports.extractCapabilitiesEnvironment = void 0;
27
+ const utils = __importStar(require("@applitools/utils"));
4
28
  function extractCapabilitiesEnvironment(capabilities) {
5
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
29
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
6
30
  if (capabilities.capabilities)
7
31
  capabilities = capabilities.capabilities;
8
32
  const environment = {
@@ -17,7 +41,7 @@ function extractCapabilitiesEnvironment(capabilities) {
17
41
  isW3C: isW3C(capabilities),
18
42
  isMobile: isMobile(capabilities),
19
43
  isChrome: isChrome(capabilities),
20
- isECClient: Boolean(capabilities['applitools:isECClient']),
44
+ isECClient: !!capabilities['applitools:isECClient'],
21
45
  };
22
46
  if (environment === null || environment === void 0 ? void 0 : environment.isMobile) {
23
47
  environment.deviceName =
@@ -27,6 +51,14 @@ function extractCapabilitiesEnvironment(capabilities) {
27
51
  environment.isAndroid = isAndroid(capabilities);
28
52
  if (!environment.browserName) {
29
53
  environment.isNative = true;
54
+ if (environment.isAndroid) {
55
+ environment.isApplitoolsLib = !!((_t = capabilities.optionalIntentArguments) === null || _t === void 0 ? void 0 : _t.includes('NML_API_KEY'));
56
+ }
57
+ else if (environment.isIOS) {
58
+ environment.isApplitoolsLib = utils.types.isString(capabilities.processArguments)
59
+ ? capabilities.processArguments.includes('NML_API_KEY')
60
+ : !!((_v = (_u = capabilities.processArguments) === null || _u === void 0 ? void 0 : _u.env) === null || _v === void 0 ? void 0 : _v.NML_API_KEY);
61
+ }
30
62
  }
31
63
  else if (environment.isIOS &&
32
64
  capabilities.CFBundleIdentifier &&
package/dist/driver.js CHANGED
@@ -174,10 +174,11 @@ class Driver {
174
174
  return this._driverInfo;
175
175
  }
176
176
  async getCapabilities({ force } = {}) {
177
- var _a, _b, _c, _d, _e;
177
+ var _a, _b, _c, _d, _e, _f, _g;
178
178
  if (((_a = this._driverInfo) === null || _a === void 0 ? void 0 : _a.capabilities) === undefined || force) {
179
179
  (_b = this._driverInfo) !== null && _b !== void 0 ? _b : (this._driverInfo = {});
180
- this._driverInfo.capabilities = (_e = (await ((_d = (_c = this._spec).getCapabilities) === null || _d === void 0 ? void 0 : _d.call(_c, this.target)))) !== null && _e !== void 0 ? _e : null;
180
+ await ((_d = (_c = this._spec).getCapabilities) === null || _d === void 0 ? void 0 : _d.call(_c, this.target));
181
+ this._driverInfo.capabilities = (_g = (await ((_f = (_e = this._spec).getCapabilities) === null || _f === void 0 ? void 0 : _f.call(_e, this.target)))) !== null && _g !== void 0 ? _g : null;
181
182
  this._logger.log('Extracted driver capabilities', this._driverInfo.capabilities);
182
183
  }
183
184
  return this._driverInfo.capabilities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.12.3",
3
+ "version": "1.13.0",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -73,9 +73,9 @@
73
73
  "test": "run --top-level mocha './test/**/*.spec.ts'"
74
74
  },
75
75
  "dependencies": {
76
- "@applitools/logger": "2.0.4",
76
+ "@applitools/logger": "2.0.5",
77
77
  "@applitools/snippets": "2.4.21",
78
- "@applitools/utils": "1.4.0",
78
+ "@applitools/utils": "1.5.0",
79
79
  "semver": "7.3.7"
80
80
  },
81
81
  "devDependencies": {
package/types/types.d.ts CHANGED
@@ -32,6 +32,7 @@ export type Environment = {
32
32
  isW3C?: boolean;
33
33
  isEC?: boolean;
34
34
  isECClient?: boolean;
35
+ isApplitoolsLib?: boolean;
35
36
  isWeb?: boolean;
36
37
  isNative?: boolean;
37
38
  isMobile?: boolean;