@applitools/driver 1.9.27 → 1.9.29
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/capabilities.js +8 -18
- package/dist/driver.js +4 -1
- package/package.json +4 -4
- package/types/capabilities.d.ts +1 -1
package/dist/capabilities.js
CHANGED
|
@@ -1,41 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseCapabilities = void 0;
|
|
4
|
-
function parseCapabilities(capabilities
|
|
5
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
4
|
+
function parseCapabilities(capabilities) {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
6
6
|
if (capabilities.capabilities)
|
|
7
7
|
capabilities = capabilities.capabilities;
|
|
8
|
-
if (!(customConfig === null || customConfig === void 0 ? void 0 : customConfig.keepPlatformNameAsIs)) {
|
|
9
|
-
// We use `startsWith` for just a theorerical reason. It's not based on any concrete case that we knew of at the time of writing this code.
|
|
10
|
-
if ((_a = capabilities.platformName) === null || _a === void 0 ? void 0 : _a.startsWith('android')) {
|
|
11
|
-
capabilities.platformName = capabilities.platformName.charAt(0).toUpperCase() + capabilities.platformName.slice(1);
|
|
12
|
-
}
|
|
13
|
-
// We use `startsWith` for just a theorerical reason. It's not based on any concrete case that we knew of at the time of writing this code.
|
|
14
|
-
if ((_b = capabilities.platformName) === null || _b === void 0 ? void 0 : _b.startsWith('ios')) {
|
|
15
|
-
capabilities.platformName = 'iOS' + capabilities.platformName.slice(3);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
8
|
const info = {
|
|
19
9
|
browserName: !capabilities.app && !capabilities.bundleId
|
|
20
|
-
? ((
|
|
10
|
+
? ((_a = capabilities.browserName) !== null && _a !== void 0 ? _a : (_b = capabilities.desired) === null || _b === void 0 ? void 0 : _b.browserName) || undefined
|
|
21
11
|
: undefined,
|
|
22
|
-
browserVersion: ((
|
|
23
|
-
platformName: ((
|
|
12
|
+
browserVersion: ((_c = capabilities.browserVersion) !== null && _c !== void 0 ? _c : capabilities.version) || undefined,
|
|
13
|
+
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,
|
|
24
14
|
platformVersion: capabilities.platformVersion || undefined,
|
|
25
15
|
isW3C: isW3C(capabilities),
|
|
26
16
|
isMobile: isMobile(capabilities),
|
|
27
17
|
};
|
|
28
18
|
if (info.isMobile) {
|
|
29
|
-
info.deviceName = ((
|
|
19
|
+
info.deviceName = ((_h = (_g = capabilities.desired) === null || _g === void 0 ? void 0 : _g.deviceName) !== null && _h !== void 0 ? _h : capabilities.deviceName) || undefined;
|
|
30
20
|
info.isNative = info.isMobile && !info.browserName;
|
|
31
21
|
info.isIOS = isIOS(capabilities);
|
|
32
22
|
info.isAndroid = isAndroid(capabilities);
|
|
33
|
-
info.orientation = (
|
|
23
|
+
info.orientation = (_k = ((_j = capabilities.deviceOrientation) !== null && _j !== void 0 ? _j : capabilities.orientation)) === null || _k === void 0 ? void 0 : _k.toLowerCase();
|
|
34
24
|
}
|
|
35
25
|
if (info.isNative) {
|
|
36
26
|
info.displaySize = extractDisplaySize(capabilities);
|
|
37
27
|
info.pixelRatio = capabilities.pixelRatio;
|
|
38
|
-
info.statusBarSize = (
|
|
28
|
+
info.statusBarSize = (_l = capabilities.statBarHeight) !== null && _l !== void 0 ? _l : (_m = capabilities.viewportRect) === null || _m === void 0 ? void 0 : _m.top;
|
|
39
29
|
if (info.displaySize && info.orientation && capabilities.viewportRect) {
|
|
40
30
|
info.navigationBarSize =
|
|
41
31
|
info.orientation === 'landscape'
|
package/dist/driver.js
CHANGED
|
@@ -148,7 +148,7 @@ class Driver {
|
|
|
148
148
|
var _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
|
|
149
149
|
const capabilities = await ((_b = (_a = this._spec).getCapabilities) === null || _b === void 0 ? void 0 : _b.call(_a, this.target));
|
|
150
150
|
this._logger.log('Driver capabilities', capabilities);
|
|
151
|
-
const capabilitiesInfo = capabilities ? (0, capabilities_1.parseCapabilities)(capabilities
|
|
151
|
+
const capabilitiesInfo = capabilities ? (0, capabilities_1.parseCapabilities)(capabilities) : undefined;
|
|
152
152
|
const driverInfo = await ((_d = (_c = this._spec).getDriverInfo) === null || _d === void 0 ? void 0 : _d.call(_c, this.target));
|
|
153
153
|
this._driverInfo = { ...capabilitiesInfo, ...driverInfo };
|
|
154
154
|
if (this.isMobile) {
|
|
@@ -172,6 +172,9 @@ class Driver {
|
|
|
172
172
|
this._driverInfo.platformVersion = (_p = userAgentInfo.platformVersion) !== null && _p !== void 0 ? _p : this._driverInfo.platformVersion;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
+
if (!this._driverInfo.isMobile && (this.isAndroid || this.isIOS)) {
|
|
176
|
+
this._driverInfo.isMobile = true;
|
|
177
|
+
}
|
|
175
178
|
(_q = (_9 = this._driverInfo).features) !== null && _q !== void 0 ? _q : (_9.features = {});
|
|
176
179
|
(_r = (_10 = this._driverInfo.features).allCookies) !== null && _r !== void 0 ? _r : (_10.allCookies = /chrome/i.test(this._driverInfo.browserName) && !this._driverInfo.isMobile);
|
|
177
180
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/driver",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.29",
|
|
4
4
|
"description": "Applitools universal framework wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@applitools/logger": "1.1.
|
|
90
|
+
"@applitools/logger": "1.1.20",
|
|
91
91
|
"@applitools/snippets": "2.4.5",
|
|
92
|
-
"@applitools/types": "1.5.
|
|
93
|
-
"@applitools/utils": "1.3.
|
|
92
|
+
"@applitools/types": "1.5.13",
|
|
93
|
+
"@applitools/utils": "1.3.12",
|
|
94
94
|
"semver": "7.3.7"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
package/types/capabilities.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type * as types from '@applitools/types';
|
|
2
2
|
declare type Capabilities = Record<string, any>;
|
|
3
|
-
export declare function parseCapabilities(capabilities: Capabilities
|
|
3
|
+
export declare function parseCapabilities(capabilities: Capabilities): types.DriverInfo;
|
|
4
4
|
export {};
|