@applitools/driver 1.11.43 → 1.11.45
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 +16 -15
- package/package.json +3 -3
- package/types/element.d.ts +1 -1
package/dist/driver.js
CHANGED
|
@@ -250,8 +250,8 @@ class Driver {
|
|
|
250
250
|
return this._environment;
|
|
251
251
|
}
|
|
252
252
|
async getViewport() {
|
|
253
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
254
|
-
var
|
|
253
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
254
|
+
var _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
255
255
|
if (!this._viewport) {
|
|
256
256
|
const environment = await this.getEnvironment();
|
|
257
257
|
const driverInfo = await this.getDriverInfo();
|
|
@@ -268,10 +268,10 @@ class Driver {
|
|
|
268
268
|
const capabilitiesViewport = capabilities ? (0, capabilities_1.extractCapabilitiesViewport)(capabilities) : null;
|
|
269
269
|
this._logger.log('Extracted capabilities viewport', capabilitiesViewport);
|
|
270
270
|
this._viewport = { ...capabilitiesViewport, ...this._viewport };
|
|
271
|
-
(_a = (
|
|
271
|
+
(_a = (_u = this._viewport).pixelRatio) !== null && _a !== void 0 ? _a : (_u.pixelRatio = 1);
|
|
272
272
|
// this value always excludes the height of the navigation bar, and sometimes it also excludes the height of the status bar
|
|
273
273
|
let windowSize = await this._spec.getWindowSize(this.target);
|
|
274
|
-
(_b = (
|
|
274
|
+
(_b = (_v = this._viewport).displaySize) !== null && _b !== void 0 ? _b : (_v.displaySize = windowSize);
|
|
275
275
|
if (((_c = this._viewport.orientation) === null || _c === void 0 ? void 0 : _c.startsWith('landscape')) &&
|
|
276
276
|
this._viewport.displaySize.height > this._viewport.displaySize.width) {
|
|
277
277
|
this._viewport.displaySize = utils.geometry.rotate(this._viewport.displaySize, 90);
|
|
@@ -304,19 +304,20 @@ class Driver {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
// bar sizes have to be scaled on android
|
|
307
|
-
(
|
|
308
|
-
(
|
|
307
|
+
(_w = this._viewport).statusBarSize && (_w.statusBarSize = this._viewport.statusBarSize / this._viewport.pixelRatio);
|
|
308
|
+
(_x = this._viewport).navigationBarSize && (_x.navigationBarSize = this._viewport.navigationBarSize / this._viewport.pixelRatio);
|
|
309
309
|
windowSize = utils.geometry.scale(windowSize, 1 / this._viewport.pixelRatio);
|
|
310
|
-
(
|
|
310
|
+
(_y = this._viewport).displaySize && (_y.displaySize = utils.geometry.scale(this._viewport.displaySize, 1 / this._viewport.pixelRatio));
|
|
311
|
+
(_l = (_z = this._viewport).navigationBarSize) !== null && _l !== void 0 ? _l : (_z.navigationBarSize = 0);
|
|
311
312
|
}
|
|
312
|
-
if (environment.isIOS) {
|
|
313
|
-
if ((
|
|
313
|
+
else if (environment.isIOS) {
|
|
314
|
+
if ((_m = this._viewport.orientation) === null || _m === void 0 ? void 0 : _m.startsWith('landscape'))
|
|
314
315
|
this._viewport.statusBarSize = 0;
|
|
315
316
|
}
|
|
316
|
-
(
|
|
317
|
+
(_o = (_0 = this._viewport).statusBarSize) !== null && _o !== void 0 ? _o : (_0.statusBarSize = 0);
|
|
317
318
|
// calculate viewport location
|
|
318
|
-
(
|
|
319
|
-
x: this._viewport.orientation === 'landscape' ? (
|
|
319
|
+
(_p = (_1 = this._viewport).viewportLocation) !== null && _p !== void 0 ? _p : (_1.viewportLocation = {
|
|
320
|
+
x: this._viewport.orientation === 'landscape' ? (_q = this._viewport.navigationBarSize) !== null && _q !== void 0 ? _q : 0 : 0,
|
|
320
321
|
y: this._viewport.statusBarSize,
|
|
321
322
|
});
|
|
322
323
|
// calculate viewport size
|
|
@@ -324,7 +325,7 @@ class Driver {
|
|
|
324
325
|
this._viewport.viewportSize = { ...this._viewport.displaySize };
|
|
325
326
|
this._viewport.viewportSize.height -= this._viewport.statusBarSize;
|
|
326
327
|
if (environment.isAndroid) {
|
|
327
|
-
this._viewport.viewportSize[((
|
|
328
|
+
this._viewport.viewportSize[((_r = this._viewport.orientation) === null || _r === void 0 ? void 0 : _r.startsWith('landscape')) ? 'width' : 'height'] -=
|
|
328
329
|
this._viewport.navigationBarSize;
|
|
329
330
|
}
|
|
330
331
|
}
|
|
@@ -356,8 +357,8 @@ class Driver {
|
|
|
356
357
|
const browserViewport = await this.execute(snippets.getViewport);
|
|
357
358
|
this._viewport = { ...browserViewport, ...this._viewport };
|
|
358
359
|
}
|
|
359
|
-
(
|
|
360
|
-
(
|
|
360
|
+
(_s = (_2 = this._viewport).pixelRatio) !== null && _s !== void 0 ? _s : (_2.pixelRatio = 1);
|
|
361
|
+
(_t = (_3 = this._viewport).viewportScale) !== null && _t !== void 0 ? _t : (_3.viewportScale = 1);
|
|
361
362
|
this._logger.log('Extracted viewport', this._viewport);
|
|
362
363
|
}
|
|
363
364
|
return this._viewport;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/driver",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.45",
|
|
4
4
|
"description": "Applitools universal framework wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"postversion": "bongo postversion"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@applitools/logger": "1.1.
|
|
84
|
+
"@applitools/logger": "1.1.51",
|
|
85
85
|
"@applitools/snippets": "2.4.19",
|
|
86
|
-
"@applitools/utils": "1.3.
|
|
86
|
+
"@applitools/utils": "1.3.34",
|
|
87
87
|
"semver": "7.3.7"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
package/types/element.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare class Element<T extends SpecType> {
|
|
|
37
37
|
constructor(options: ElementOptions<T>);
|
|
38
38
|
get target(): NonNullable<T["element"]>;
|
|
39
39
|
get selector(): Selector<T> | undefined;
|
|
40
|
-
get commonSelector(): CommonSelector
|
|
40
|
+
get commonSelector(): CommonSelector | null;
|
|
41
41
|
get index(): number | undefined;
|
|
42
42
|
get context(): Context<T>;
|
|
43
43
|
get driver(): import("./driver").Driver<T>;
|