@percy/webdriver-utils 1.29.4-beta.4 → 1.29.4-beta.6
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.
|
@@ -8,12 +8,12 @@ export default class DesktopMetaData {
|
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
10
10
|
browserName() {
|
|
11
|
-
var _this$capabilities
|
|
12
|
-
return (_this$capabilities = this.capabilities) === null || _this$capabilities === void 0
|
|
11
|
+
var _this$capabilities;
|
|
12
|
+
return (_this$capabilities = this.capabilities) === null || _this$capabilities === void 0 || (_this$capabilities = _this$capabilities.browserName) === null || _this$capabilities === void 0 ? void 0 : _this$capabilities.toLowerCase();
|
|
13
13
|
}
|
|
14
14
|
browserVersion() {
|
|
15
|
-
var _this$capabilities2
|
|
16
|
-
return (_this$capabilities2 = this.capabilities) === null || _this$capabilities2 === void 0
|
|
15
|
+
var _this$capabilities2;
|
|
16
|
+
return (_this$capabilities2 = this.capabilities) === null || _this$capabilities2 === void 0 || (_this$capabilities2 = _this$capabilities2.browserVersion) === null || _this$capabilities2 === void 0 ? void 0 : _this$capabilities2.split('.')[0];
|
|
17
17
|
}
|
|
18
18
|
osName() {
|
|
19
19
|
var _this$capabilities3, _osName, _this$capabilities4;
|
|
@@ -25,8 +25,8 @@ export default class DesktopMetaData {
|
|
|
25
25
|
|
|
26
26
|
// showing major version
|
|
27
27
|
osVersion() {
|
|
28
|
-
var _this$capabilities5
|
|
29
|
-
return (_this$capabilities5 = this.capabilities) === null || _this$capabilities5 === void 0
|
|
28
|
+
var _this$capabilities5;
|
|
29
|
+
return (_this$capabilities5 = this.capabilities) === null || _this$capabilities5 === void 0 || (_this$capabilities5 = _this$capabilities5.osVersion) === null || _this$capabilities5 === void 0 ? void 0 : _this$capabilities5.toLowerCase();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// combination of browserName + browserVersion + osVersion + osName
|
|
@@ -2,10 +2,10 @@ import DesktopMetaData from './desktopMetaData.js';
|
|
|
2
2
|
import MobileMetaData from './mobileMetaData.js';
|
|
3
3
|
export default class MetaDataResolver {
|
|
4
4
|
static resolve(driver, capabilities, opts) {
|
|
5
|
-
var _capabilities$platfor, _capabilities$device
|
|
5
|
+
var _capabilities$platfor, _capabilities$device;
|
|
6
6
|
if (!driver) throw new Error('Please pass a Driver object');
|
|
7
7
|
const platform = opts.platformName || opts.platform;
|
|
8
|
-
if (['ios', 'android'].includes(platform.toLowerCase()) || ['ios', 'android'].includes(capabilities === null || capabilities === void 0
|
|
8
|
+
if (['ios', 'android'].includes(platform.toLowerCase()) || ['ios', 'android'].includes(capabilities === null || capabilities === void 0 || (_capabilities$platfor = capabilities.platformName) === null || _capabilities$platfor === void 0 ? void 0 : _capabilities$platfor.toLowerCase()) || ['ipad', 'iphone'].includes(capabilities === null || capabilities === void 0 || (_capabilities$device = capabilities.device) === null || _capabilities$device === void 0 || (_capabilities$device = _capabilities$device.toString()) === null || _capabilities$device === void 0 ? void 0 : _capabilities$device.toLowerCase()) || (opts === null || opts === void 0 ? void 0 : opts.deviceName) !== undefined) {
|
|
9
9
|
return new MobileMetaData(driver, capabilities);
|
|
10
10
|
} else {
|
|
11
11
|
return new DesktopMetaData(driver, capabilities);
|
|
@@ -9,32 +9,32 @@ export default class MobileMetaData {
|
|
|
9
9
|
return true;
|
|
10
10
|
}
|
|
11
11
|
browserName() {
|
|
12
|
-
var _this$capabilities
|
|
13
|
-
return (_this$capabilities = this.capabilities) === null || _this$capabilities === void 0
|
|
12
|
+
var _this$capabilities;
|
|
13
|
+
return (_this$capabilities = this.capabilities) === null || _this$capabilities === void 0 || (_this$capabilities = _this$capabilities.browserName) === null || _this$capabilities === void 0 ? void 0 : _this$capabilities.toLowerCase();
|
|
14
14
|
}
|
|
15
15
|
browserVersion() {
|
|
16
|
-
var _this$capabilities$
|
|
17
|
-
const bsVersion = (_this$capabilities$
|
|
16
|
+
var _this$capabilities$br, _this$capabilities2;
|
|
17
|
+
const bsVersion = (_this$capabilities$br = this.capabilities.browserVersion) === null || _this$capabilities$br === void 0 ? void 0 : _this$capabilities$br.split('.');
|
|
18
18
|
if ((bsVersion === null || bsVersion === void 0 ? void 0 : bsVersion.length) > 0) {
|
|
19
19
|
return bsVersion[0];
|
|
20
20
|
}
|
|
21
|
-
return (_this$capabilities2 = this.capabilities) === null || _this$capabilities2 === void 0
|
|
21
|
+
return (_this$capabilities2 = this.capabilities) === null || _this$capabilities2 === void 0 || (_this$capabilities2 = _this$capabilities2.version) === null || _this$capabilities2 === void 0 ? void 0 : _this$capabilities2.split('.')[0];
|
|
22
22
|
}
|
|
23
23
|
osName() {
|
|
24
|
-
var _this$capabilities3
|
|
25
|
-
let osName = (_this$capabilities3 = this.capabilities) === null || _this$capabilities3 === void 0
|
|
24
|
+
var _this$capabilities3;
|
|
25
|
+
let osName = (_this$capabilities3 = this.capabilities) === null || _this$capabilities3 === void 0 || (_this$capabilities3 = _this$capabilities3.os) === null || _this$capabilities3 === void 0 ? void 0 : _this$capabilities3.toLowerCase();
|
|
26
26
|
if (osName === 'mac' && this.browserName() === 'iphone') {
|
|
27
27
|
osName = 'ios';
|
|
28
28
|
}
|
|
29
29
|
return osName;
|
|
30
30
|
}
|
|
31
31
|
osVersion() {
|
|
32
|
-
var _this$capabilities4
|
|
33
|
-
return (_this$capabilities4 = this.capabilities) === null || _this$capabilities4 === void 0
|
|
32
|
+
var _this$capabilities4;
|
|
33
|
+
return (_this$capabilities4 = this.capabilities) === null || _this$capabilities4 === void 0 || (_this$capabilities4 = _this$capabilities4.osVersion) === null || _this$capabilities4 === void 0 ? void 0 : _this$capabilities4.split('.')[0];
|
|
34
34
|
}
|
|
35
35
|
deviceName() {
|
|
36
|
-
var _this$capabilities5
|
|
37
|
-
return (_this$capabilities5 = this.capabilities) === null || _this$capabilities5 === void 0
|
|
36
|
+
var _this$capabilities5;
|
|
37
|
+
return (_this$capabilities5 = this.capabilities) === null || _this$capabilities5 === void 0 || (_this$capabilities5 = _this$capabilities5.deviceName) === null || _this$capabilities5 === void 0 ? void 0 : _this$capabilities5.split('-')[0];
|
|
38
38
|
}
|
|
39
39
|
orientation() {
|
|
40
40
|
var _this$capabilities6;
|
|
@@ -113,7 +113,7 @@ export default class GenericProvider {
|
|
|
113
113
|
* value: { error: '', message: ''}
|
|
114
114
|
* }
|
|
115
115
|
*/
|
|
116
|
-
const errResponse = (e === null || e === void 0
|
|
116
|
+
const errResponse = (e === null || e === void 0 || (_e$response = e.response) === null || _e$response === void 0 ? void 0 : _e$response.body) && ((_JSON$parse = JSON.parse(e === null || e === void 0 || (_e$response2 = e.response) === null || _e$response2 === void 0 ? void 0 : _e$response2.body)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.value) || {};
|
|
117
117
|
const errMessage = (errResponse === null || errResponse === void 0 ? void 0 : errResponse.message) || (errResponse === null || errResponse === void 0 ? void 0 : errResponse.error) || (e === null || e === void 0 ? void 0 : e.message) || (e === null || e === void 0 ? void 0 : e.error) || (e === null || e === void 0 ? void 0 : e.value) || e.toString();
|
|
118
118
|
throw new Error(errMessage);
|
|
119
119
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/webdriver-utils",
|
|
3
|
-
"version": "1.29.4-beta.
|
|
3
|
+
"version": "1.29.4-beta.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"test:coverage": "yarn test --coverage"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@percy/config": "1.29.4-beta.
|
|
33
|
-
"@percy/sdk-utils": "1.29.4-beta.
|
|
32
|
+
"@percy/config": "1.29.4-beta.6",
|
|
33
|
+
"@percy/sdk-utils": "1.29.4-beta.6"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "7c33f03c17960885dbc29107add843d1851aa789"
|
|
36
36
|
}
|