@applitools/driver
Advanced tools
Comparing version 1.15.3 to 1.16.0
# Changelog | ||
## [1.16.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.15.3...js/driver@1.16.0) (2023-12-18) | ||
### Features | ||
* add set of env variables to skip/ignore some optional automations ([#2097](https://github.com/applitools/eyes.sdk.javascript1/issues/2097)) ([bd3b08c](https://github.com/applitools/eyes.sdk.javascript1/commit/bd3b08c3d2997eb98d545b308a1f15501192178e)) | ||
## [1.15.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.15.2...js/driver@1.15.3) (2023-12-12) | ||
@@ -4,0 +11,0 @@ |
@@ -88,8 +88,13 @@ "use strict"; | ||
if (reset) { | ||
this._driverInfo = undefined; | ||
this._environment = undefined; | ||
this._viewport = undefined; | ||
this._features = undefined; | ||
this._helper = undefined; | ||
this._state = {}; | ||
if (utils.general.getEnvValue('AVOID_DRIVER_STATE_REST', 'boolean')) { | ||
this._logger.log(`Skipping reset of the driver state`); | ||
} | ||
else { | ||
this._driverInfo = undefined; | ||
this._environment = undefined; | ||
this._viewport = undefined; | ||
this._features = undefined; | ||
this._helper = undefined; | ||
this._state = {}; | ||
} | ||
} | ||
@@ -422,8 +427,14 @@ const spec = this._spec; | ||
if (this._helper === undefined) { | ||
const environment = await this.getEnvironment(); | ||
this._logger.log(`Extracting helper for ${environment.isIOS ? 'ios' : 'android'}`); | ||
this._helper = environment.isIOS | ||
? await helper_ios_1.HelperIOS.make({ spec: this._spec, driver: this }) | ||
: await helper_android_1.HelperAndroid.make({ spec: this._spec, driver: this }); | ||
this._logger.log(`Extracted helper of type ${(_a = this._helper) === null || _a === void 0 ? void 0 : _a.name}`); | ||
if (utils.general.getEnvValue('IGNORE_HELPER_LIB', 'boolean')) { | ||
this._logger.log(`Skipping helper lib extraction`); | ||
this._helper = null; | ||
} | ||
else { | ||
const environment = await this.getEnvironment(); | ||
this._logger.log(`Extracting helper for ${environment.isIOS ? 'ios' : 'android'}`); | ||
this._helper = environment.isIOS | ||
? await helper_ios_1.HelperIOS.make({ spec: this._spec, driver: this }) | ||
: await helper_android_1.HelperAndroid.make({ spec: this._spec, driver: this }); | ||
this._logger.log(`Extracted helper of type ${(_a = this._helper) === null || _a === void 0 ? void 0 : _a.name}`); | ||
} | ||
} | ||
@@ -749,21 +760,26 @@ this._logger.log(`Returning helper for of type ${(_c = (_b = this._helper) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : null}`); | ||
if (environment.isAndroid) { | ||
this._logger.log('Extracting device orientation using adb command on android'); | ||
const rotation = await this.execute('mobile:shell', { | ||
command: "dumpsys window | grep 'mCurrentRotation' | cut -d = -f2", | ||
}) | ||
.then(rotation => { var _a; return (_a = rotation === null || rotation === void 0 ? void 0 : rotation.trim) === null || _a === void 0 ? void 0 : _a.call(rotation); }) | ||
.catch(() => null); | ||
if (rotation) { | ||
let orientation = undefined; | ||
if (rotation === 'ROTATION_0' || rotation === '0') | ||
orientation = 'portrait'; | ||
else if (rotation === 'ROTATION_90' || rotation === '3') | ||
orientation = 'landscape-secondary'; | ||
else if (rotation === 'ROTATION_180' || rotation === '2') | ||
orientation = 'portrait-secondary'; | ||
else if (rotation === 'ROTATION_270' || rotation === '1') | ||
orientation = 'landscape'; | ||
this._logger.log('Extracted device orientation:', orientation); | ||
return orientation; | ||
if (utils.general.getEnvValue('AVOID_ADB_USAGE', 'boolean')) { | ||
this._logger.log(`Skipping device orientation extraction using adb command on android`); | ||
} | ||
else { | ||
this._logger.log('Extracting device orientation using adb command on android'); | ||
const rotation = await this.execute('mobile:shell', { | ||
command: "dumpsys window | grep 'mCurrentRotation' | cut -d = -f2", | ||
}) | ||
.then(rotation => { var _a; return (_a = rotation === null || rotation === void 0 ? void 0 : rotation.trim) === null || _a === void 0 ? void 0 : _a.call(rotation); }) | ||
.catch(() => null); | ||
if (rotation) { | ||
let orientation = undefined; | ||
if (rotation === 'ROTATION_0' || rotation === '0') | ||
orientation = 'portrait'; | ||
else if (rotation === 'ROTATION_90' || rotation === '3') | ||
orientation = 'landscape-secondary'; | ||
else if (rotation === 'ROTATION_180' || rotation === '2') | ||
orientation = 'portrait-secondary'; | ||
else if (rotation === 'ROTATION_270' || rotation === '1') | ||
orientation = 'landscape'; | ||
this._logger.log('Extracted device orientation:', orientation); | ||
return orientation; | ||
} | ||
} | ||
} | ||
@@ -770,0 +786,0 @@ this._logger.log('Extracting device orientation'); |
{ | ||
"name": "@applitools/driver", | ||
"version": "1.15.3", | ||
"version": "1.16.0", | ||
"description": "Applitools universal framework wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
266482
4250