@applitools/driver 1.11.38 → 1.11.39
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 +5 -3
- package/dist/user-agent.js +6 -4
- package/package.json +2 -2
package/dist/driver.js
CHANGED
|
@@ -649,7 +649,7 @@ class Driver {
|
|
|
649
649
|
}
|
|
650
650
|
async setViewportSize(size) {
|
|
651
651
|
const environment = await this.getEnvironment();
|
|
652
|
-
if (environment.isMobile)
|
|
652
|
+
if (environment.isMobile && !environment.isEmulation)
|
|
653
653
|
return;
|
|
654
654
|
if (this._spec.setViewportSize) {
|
|
655
655
|
this._logger.log('Setting viewport size to', size, 'using spec method');
|
|
@@ -702,10 +702,12 @@ class Driver {
|
|
|
702
702
|
return normalizedSize;
|
|
703
703
|
}
|
|
704
704
|
async getOrientation() {
|
|
705
|
-
var _a, _b;
|
|
705
|
+
var _a, _b, _c;
|
|
706
706
|
const environment = await this.getEnvironment();
|
|
707
707
|
if (!environment.isMobile)
|
|
708
708
|
return undefined;
|
|
709
|
+
if (environment.isEmulation)
|
|
710
|
+
return (_a = this._viewport) === null || _a === void 0 ? void 0 : _a.orientation;
|
|
709
711
|
if (environment.isAndroid) {
|
|
710
712
|
this._logger.log('Extracting device orientation using adb command on android');
|
|
711
713
|
const rotation = await this.execute('mobile:shell', {
|
|
@@ -728,7 +730,7 @@ class Driver {
|
|
|
728
730
|
}
|
|
729
731
|
}
|
|
730
732
|
this._logger.log('Extracting device orientation');
|
|
731
|
-
const orientation = await ((
|
|
733
|
+
const orientation = await ((_c = (_b = this._spec).getOrientation) === null || _c === void 0 ? void 0 : _c.call(_b, this.target));
|
|
732
734
|
this._logger.log('Extracted device orientation:', orientation);
|
|
733
735
|
return orientation;
|
|
734
736
|
}
|
package/dist/user-agent.js
CHANGED
|
@@ -60,7 +60,7 @@ const WINDOWS_VERSIONS = {
|
|
|
60
60
|
'15.0.0': '11',
|
|
61
61
|
};
|
|
62
62
|
function extractUserAgentEnvironment(userAgent) {
|
|
63
|
-
var _a, _b;
|
|
63
|
+
var _a, _b, _c, _d;
|
|
64
64
|
let userAgentLegacy, userAgentObject;
|
|
65
65
|
if (utils.types.isString(userAgent)) {
|
|
66
66
|
userAgentLegacy = userAgent.trim();
|
|
@@ -74,9 +74,11 @@ function extractUserAgentEnvironment(userAgent) {
|
|
|
74
74
|
...extractUserAgentLegacyBrowser(userAgentLegacy),
|
|
75
75
|
};
|
|
76
76
|
const userAgentEnvironment = userAgentObject && extractUserAgentObjectEnvironment(userAgentObject);
|
|
77
|
-
const environment = { ...
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
const environment = { ...userAgentEnvironment };
|
|
78
|
+
(_a = environment.platformName) !== null && _a !== void 0 ? _a : (environment.platformName = userAgentLegacyEnvironment.platformName);
|
|
79
|
+
(_b = environment.platformVersion) !== null && _b !== void 0 ? _b : (environment.platformVersion = userAgentLegacyEnvironment.platformVersion);
|
|
80
|
+
environment.browserName = (_c = userAgentLegacyEnvironment.browserName) !== null && _c !== void 0 ? _c : environment.browserName;
|
|
81
|
+
environment.browserVersion = (_d = userAgentLegacyEnvironment.browserVersion) !== null && _d !== void 0 ? _d : environment.browserVersion;
|
|
80
82
|
return environment;
|
|
81
83
|
}
|
|
82
84
|
exports.extractUserAgentEnvironment = extractUserAgentEnvironment;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/driver",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.39",
|
|
4
4
|
"description": "Applitools universal framework wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"@applitools/logger": "1.1.48",
|
|
85
|
-
"@applitools/snippets": "2.4.
|
|
85
|
+
"@applitools/snippets": "2.4.19",
|
|
86
86
|
"@applitools/utils": "1.3.32",
|
|
87
87
|
"semver": "7.3.7"
|
|
88
88
|
},
|