@wdio/utils 6.0.8 → 6.0.13
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/build/index.js +6 -0
- package/build/utils.js +17 -0
- package/package.json +4 -3
package/build/index.js
CHANGED
|
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "isFunctionAsync", {
|
|
|
57
57
|
return _utils.isFunctionAsync;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "transformCommandLogResult", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _utils.transformCommandLogResult;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
60
66
|
Object.defineProperty(exports, "wrapCommand", {
|
|
61
67
|
enumerable: true,
|
|
62
68
|
get: function () {
|
package/build/utils.js
CHANGED
|
@@ -5,12 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.overwriteElementCommands = overwriteElementCommands;
|
|
7
7
|
exports.commandCallStructure = commandCallStructure;
|
|
8
|
+
exports.transformCommandLogResult = transformCommandLogResult;
|
|
8
9
|
exports.isValidParameter = isValidParameter;
|
|
9
10
|
exports.getArgumentType = getArgumentType;
|
|
10
11
|
exports.safeRequire = safeRequire;
|
|
11
12
|
exports.isFunctionAsync = isFunctionAsync;
|
|
12
13
|
exports.filterSpecArgs = filterSpecArgs;
|
|
13
14
|
|
|
15
|
+
var _isBase = _interopRequireDefault(require("is-base64"));
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
|
|
19
|
+
const SCREENSHOT_REPLACEMENT = '"<Screenshot[base64]>"';
|
|
20
|
+
|
|
14
21
|
function overwriteElementCommands(propertiesObject) {
|
|
15
22
|
const elementOverrides = propertiesObject['__elementOverrides__'] ? propertiesObject['__elementOverrides__'].value : {};
|
|
16
23
|
|
|
@@ -54,6 +61,8 @@ function commandCallStructure(commandName, args) {
|
|
|
54
61
|
const callArgs = args.map(arg => {
|
|
55
62
|
if (typeof arg === 'string' && (arg.startsWith('!function(') || arg.startsWith('return (function'))) {
|
|
56
63
|
arg = '<fn>';
|
|
64
|
+
} else if (typeof arg === 'string' && (0, _isBase.default)(arg)) {
|
|
65
|
+
arg = SCREENSHOT_REPLACEMENT;
|
|
57
66
|
} else if (typeof arg === 'string') {
|
|
58
67
|
arg = `"${arg}"`;
|
|
59
68
|
} else if (typeof arg === 'function') {
|
|
@@ -71,6 +80,14 @@ function commandCallStructure(commandName, args) {
|
|
|
71
80
|
return `${commandName}(${callArgs})`;
|
|
72
81
|
}
|
|
73
82
|
|
|
83
|
+
function transformCommandLogResult(result) {
|
|
84
|
+
if (typeof result.file === 'string' && (0, _isBase.default)(result.file)) {
|
|
85
|
+
return SCREENSHOT_REPLACEMENT;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
|
|
74
91
|
function isValidParameter(arg, expectedType) {
|
|
75
92
|
let shouldBeArray = false;
|
|
76
93
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.13",
|
|
4
4
|
"description": "A WDIO helper utility to provide several utility functions used across the project.",
|
|
5
5
|
"author": "Christian Bromann <christian@saucelabs.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-utils",
|
|
@@ -31,10 +31,11 @@
|
|
|
31
31
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@wdio/logger": "6.0.
|
|
34
|
+
"@wdio/logger": "6.0.12",
|
|
35
|
+
"is-base64": "^1.1.0"
|
|
35
36
|
},
|
|
36
37
|
"publishConfig": {
|
|
37
38
|
"access": "public"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "dab0fc8fe4406eb3e02b9ad6c6898692de2d10f7"
|
|
40
41
|
}
|