@applitools/driver 1.9.22 → 1.9.23
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 +19 -17
- package/package.json +2 -2
package/dist/driver.js
CHANGED
|
@@ -144,8 +144,8 @@ class Driver {
|
|
|
144
144
|
this._currentContext = context;
|
|
145
145
|
}
|
|
146
146
|
async init() {
|
|
147
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
148
|
-
var
|
|
147
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
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
151
|
const capabilitiesInfo = capabilities ? (0, capabilities_1.parseCapabilities)(capabilities, this._customConfig) : undefined;
|
|
@@ -156,29 +156,29 @@ class Driver {
|
|
|
156
156
|
(_e = (await this.getOrientation().catch(() => undefined))) !== null && _e !== void 0 ? _e : this._driverInfo.orientation;
|
|
157
157
|
}
|
|
158
158
|
if (this.isWeb) {
|
|
159
|
-
(_f = (
|
|
160
|
-
(_g = (
|
|
161
|
-
(_h = (
|
|
159
|
+
(_f = (_4 = this._driverInfo).pixelRatio) !== null && _f !== void 0 ? _f : (_4.pixelRatio = await this.execute(snippets.getPixelRatio));
|
|
160
|
+
(_g = (_5 = this._driverInfo).viewportScale) !== null && _g !== void 0 ? _g : (_5.viewportScale = await this.execute(snippets.getViewportScale));
|
|
161
|
+
(_h = (_6 = this._driverInfo).userAgent) !== null && _h !== void 0 ? _h : (_6.userAgent = await this.execute(snippets.getUserAgent));
|
|
162
162
|
if (this._driverInfo.userAgent) {
|
|
163
163
|
const userAgentInfo = (0, user_agent_1.parseUserAgent)(this._driverInfo.userAgent);
|
|
164
164
|
this._driverInfo.browserName = (_j = userAgentInfo.browserName) !== null && _j !== void 0 ? _j : this._driverInfo.browserName;
|
|
165
165
|
this._driverInfo.browserVersion = (_k = userAgentInfo.browserVersion) !== null && _k !== void 0 ? _k : this._driverInfo.browserVersion;
|
|
166
166
|
if (this._driverInfo.isMobile) {
|
|
167
|
-
(_l = (
|
|
168
|
-
(_m = (
|
|
167
|
+
(_l = (_7 = this._driverInfo).platformName) !== null && _l !== void 0 ? _l : (_7.platformName = userAgentInfo.platformName);
|
|
168
|
+
(_m = (_8 = this._driverInfo).platformVersion) !== null && _m !== void 0 ? _m : (_8.platformVersion = userAgentInfo.platformVersion);
|
|
169
169
|
}
|
|
170
170
|
else {
|
|
171
171
|
this._driverInfo.platformName = (_o = userAgentInfo.platformName) !== null && _o !== void 0 ? _o : this._driverInfo.platformName;
|
|
172
172
|
this._driverInfo.platformVersion = (_p = userAgentInfo.platformVersion) !== null && _p !== void 0 ? _p : this._driverInfo.platformVersion;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
(_q = (
|
|
176
|
-
(_r = (
|
|
175
|
+
(_q = (_9 = this._driverInfo).features) !== null && _q !== void 0 ? _q : (_9.features = {});
|
|
176
|
+
(_r = (_10 = this._driverInfo.features).allCookies) !== null && _r !== void 0 ? _r : (_10.allCookies = /chrome/i.test(this._driverInfo.browserName) && !this._driverInfo.isMobile);
|
|
177
177
|
}
|
|
178
178
|
else {
|
|
179
179
|
// this value always excludes the height of the navigation bar, and sometimes it also excludes the height of the status bar
|
|
180
180
|
let windowSize = await this._spec.getWindowSize(this.target);
|
|
181
|
-
(_s = (
|
|
181
|
+
(_s = (_11 = this._driverInfo).displaySize) !== null && _s !== void 0 ? _s : (_11.displaySize = windowSize);
|
|
182
182
|
if (((_t = this.orientation) === null || _t === void 0 ? void 0 : _t.startsWith('landscape')) &&
|
|
183
183
|
this._driverInfo.displaySize.height > this._driverInfo.displaySize.width) {
|
|
184
184
|
this._driverInfo.displaySize = {
|
|
@@ -215,17 +215,17 @@ class Driver {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
// bar sizes have to be scaled on android
|
|
218
|
-
(
|
|
219
|
-
(
|
|
218
|
+
(_12 = this._driverInfo).statusBarSize && (_12.statusBarSize = this._driverInfo.statusBarSize / this.pixelRatio);
|
|
219
|
+
(_13 = this._driverInfo).navigationBarSize && (_13.navigationBarSize = this._driverInfo.navigationBarSize / this.pixelRatio);
|
|
220
220
|
windowSize = utils.geometry.scale(windowSize, 1 / this.pixelRatio);
|
|
221
|
-
(
|
|
221
|
+
(_14 = this._driverInfo).displaySize && (_14.displaySize = utils.geometry.scale(this._driverInfo.displaySize, 1 / this.pixelRatio));
|
|
222
222
|
}
|
|
223
223
|
if (this.isIOS) {
|
|
224
224
|
if ((_0 = this.orientation) === null || _0 === void 0 ? void 0 : _0.startsWith('landscape'))
|
|
225
225
|
this._driverInfo.statusBarSize = 0;
|
|
226
226
|
}
|
|
227
227
|
// calculate viewport location
|
|
228
|
-
(_1 = (
|
|
228
|
+
(_1 = (_15 = this._driverInfo).viewportLocation) !== null && _1 !== void 0 ? _1 : (_15.viewportLocation = {
|
|
229
229
|
x: this.orientation === 'landscape' ? this.navigationBarSize : 0,
|
|
230
230
|
y: this.statusBarSize,
|
|
231
231
|
});
|
|
@@ -256,9 +256,11 @@ class Driver {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
// init helper lib
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
259
|
+
if (!((_3 = this._customConfig) === null || _3 === void 0 ? void 0 : _3.disableHelper)) {
|
|
260
|
+
this._helper = this.isIOS
|
|
261
|
+
? await helper_ios_1.HelperIOS.make({ spec: this._spec, driver: this, logger: this._logger })
|
|
262
|
+
: await helper_android_1.HelperAndroid.make({ spec: this._spec, driver: this, logger: this._logger });
|
|
263
|
+
}
|
|
262
264
|
}
|
|
263
265
|
this._logger.log('Combined driver info', this._driverInfo);
|
|
264
266
|
return this;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/driver",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.23",
|
|
4
4
|
"description": "Applitools universal framework wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@applitools/logger": "1.1.16",
|
|
82
82
|
"@applitools/snippets": "2.4.5",
|
|
83
|
-
"@applitools/types": "1.5.
|
|
83
|
+
"@applitools/types": "1.5.9",
|
|
84
84
|
"@applitools/utils": "1.3.10"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|