@applitools/driver 1.5.7 → 1.7.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/dist/driver.js +12 -3
- package/dist/index.js +14 -0
- package/package.json +4 -4
- package/types/driver.d.ts +2 -0
- package/types/index.d.ts +1 -0
package/dist/driver.js
CHANGED
|
@@ -35,6 +35,7 @@ class Driver {
|
|
|
35
35
|
if (options.driver instanceof Driver)
|
|
36
36
|
return options.driver;
|
|
37
37
|
this._spec = options.spec;
|
|
38
|
+
this._customConfig = options.customConfig || {};
|
|
38
39
|
if (options.logger)
|
|
39
40
|
this._logger = options.logger;
|
|
40
41
|
if (this._spec.isDriver(options.driver)) {
|
|
@@ -385,7 +386,10 @@ class Driver {
|
|
|
385
386
|
const safeRegion = this.isIOS && !shouldIgnoreSafeRegion
|
|
386
387
|
? utils.geometry.intersect(scaledRegion, this._driverInfo.safeArea)
|
|
387
388
|
: scaledRegion;
|
|
388
|
-
const offsetRegion = utils.geometry.offsetNegative(safeRegion, {
|
|
389
|
+
const offsetRegion = utils.geometry.offsetNegative(safeRegion, {
|
|
390
|
+
x: this.isAndroid && this.orientation === 'landscape' && this.platformVersion > 7 ? this.navigationBarHeight : 0,
|
|
391
|
+
y: this.statusBarHeight,
|
|
392
|
+
});
|
|
389
393
|
if (offsetRegion.y < 0) {
|
|
390
394
|
offsetRegion.height += offsetRegion.y;
|
|
391
395
|
offsetRegion.y = 0;
|
|
@@ -416,7 +420,6 @@ class Driver {
|
|
|
416
420
|
var _a;
|
|
417
421
|
let size;
|
|
418
422
|
if (this.isNative) {
|
|
419
|
-
this._logger.log('Extracting viewport size from native driver');
|
|
420
423
|
if ((_a = this._driverInfo) === null || _a === void 0 ? void 0 : _a.viewportSize) {
|
|
421
424
|
size = this._driverInfo.viewportSize;
|
|
422
425
|
}
|
|
@@ -429,7 +432,13 @@ class Driver {
|
|
|
429
432
|
}
|
|
430
433
|
}
|
|
431
434
|
}
|
|
432
|
-
|
|
435
|
+
if (this._customConfig.useCeilForViewportSize) {
|
|
436
|
+
size = utils.geometry.ceil(size);
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
size = utils.geometry.round(size);
|
|
440
|
+
}
|
|
441
|
+
this._logger.log(`Extracting viewport size from native driver using '${this._customConfig.useCeilForViewportSize ? 'ceil' : 'round'}' method`);
|
|
433
442
|
}
|
|
434
443
|
else if (this._spec.getViewportSize) {
|
|
435
444
|
this._logger.log('Extracting viewport size from web driver using spec method');
|
package/dist/index.js
CHANGED
|
@@ -6,10 +6,24 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
9
14
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
15
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
16
|
};
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
12
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.specUtils = void 0;
|
|
13
26
|
__exportStar(require("./driver"), exports);
|
|
14
27
|
__exportStar(require("./context"), exports);
|
|
15
28
|
__exportStar(require("./element"), exports);
|
|
29
|
+
exports.specUtils = __importStar(require("./spec-utils"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/driver",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Applitools universal framework wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@applitools/snippets": "2.2.2",
|
|
77
|
-
"@applitools/types": "1.3.
|
|
78
|
-
"@applitools/utils": "1.2.
|
|
77
|
+
"@applitools/types": "1.3.1",
|
|
78
|
+
"@applitools/utils": "1.2.14"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@applitools/bongo": "^2.0.
|
|
81
|
+
"@applitools/bongo": "^2.0.3",
|
|
82
82
|
"@types/mocha": "^9.0.0",
|
|
83
83
|
"@types/node": "^16.3.3",
|
|
84
84
|
"@typescript-eslint/eslint-plugin": "^4.28.3",
|
package/types/driver.d.ts
CHANGED
|
@@ -10,12 +10,14 @@ export declare class Driver<TDriver, TContext, TElement, TSelector> {
|
|
|
10
10
|
private _currentContext;
|
|
11
11
|
private _driverInfo;
|
|
12
12
|
private _logger;
|
|
13
|
+
private _customConfig;
|
|
13
14
|
private _helper?;
|
|
14
15
|
protected readonly _spec: types.SpecDriver<TDriver, TContext, TElement, TSelector>;
|
|
15
16
|
constructor(options: {
|
|
16
17
|
spec: types.SpecDriver<TDriver, TContext, TElement, TSelector>;
|
|
17
18
|
driver: Driver<TDriver, TContext, TElement, TSelector> | TDriver;
|
|
18
19
|
logger?: any;
|
|
20
|
+
customConfig?: any;
|
|
19
21
|
});
|
|
20
22
|
get target(): TDriver;
|
|
21
23
|
get currentContext(): Context<TDriver, TContext, TElement, TSelector>;
|
package/types/index.d.ts
CHANGED