botium-core 1.13.10 → 1.13.12
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/botium-cjs.js +14 -11
- package/dist/botium-cjs.js.map +1 -1
- package/dist/botium-es.js +35 -32
- package/dist/botium-es.js.map +1 -1
- package/package.json +1 -1
- package/src/Defaults.js +0 -1
- package/src/scripting/helper.js +6 -2
- package/test/driver/capabilities.spec.js +7 -7
package/dist/botium-cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ var randomatic = require('randomatic');
|
|
|
14
14
|
var lodash = require('lodash');
|
|
15
15
|
var boolean$1 = require('boolean');
|
|
16
16
|
var events = require('events');
|
|
17
|
-
var debug$
|
|
17
|
+
var debug$n = require('debug');
|
|
18
18
|
var vm2 = require('vm2');
|
|
19
19
|
var isClass = require('is-class');
|
|
20
20
|
var crypto = require('crypto');
|
|
@@ -54,7 +54,7 @@ var randomatic__default = /*#__PURE__*/_interopDefaultLegacy(randomatic);
|
|
|
54
54
|
var lodash__default = /*#__PURE__*/_interopDefaultLegacy(lodash);
|
|
55
55
|
var boolean__default = /*#__PURE__*/_interopDefaultLegacy(boolean$1);
|
|
56
56
|
var events__default = /*#__PURE__*/_interopDefaultLegacy(events);
|
|
57
|
-
var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug$
|
|
57
|
+
var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug$n);
|
|
58
58
|
var vm2__default = /*#__PURE__*/_interopDefaultLegacy(vm2);
|
|
59
59
|
var isClass__default = /*#__PURE__*/_interopDefaultLegacy(isClass);
|
|
60
60
|
var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
|
|
@@ -81,7 +81,7 @@ var express__default = /*#__PURE__*/_interopDefaultLegacy(express);
|
|
|
81
81
|
var bodyParser__default = /*#__PURE__*/_interopDefaultLegacy(bodyParser);
|
|
82
82
|
|
|
83
83
|
var name = "botium-core";
|
|
84
|
-
var version$1 = "1.13.
|
|
84
|
+
var version$1 = "1.13.12";
|
|
85
85
|
var description = "The Selenium for Chatbots";
|
|
86
86
|
var main = "index.js";
|
|
87
87
|
var module$1 = "dist/botium-es.js";
|
|
@@ -552,7 +552,6 @@ var Defaults$1 = {
|
|
|
552
552
|
[Capabilities.TEMPDIR]: 'botiumwork',
|
|
553
553
|
[Capabilities.CLEANUPTEMPDIR]: true,
|
|
554
554
|
[Capabilities.WAITFORBOTTIMEOUT]: 10000,
|
|
555
|
-
[Capabilities.SIMULATE_WRITING_SPEED]: false,
|
|
556
555
|
[Capabilities.SIMPLEREST_PING_RETRIES]: 6,
|
|
557
556
|
[Capabilities.SIMPLEREST_PING_TIMEOUT]: 10000,
|
|
558
557
|
[Capabilities.SIMPLEREST_PING_VERB]: 'GET',
|
|
@@ -1203,7 +1202,7 @@ LogicHookConsts.DEFAULT_USER_INPUTS;
|
|
|
1203
1202
|
const {
|
|
1204
1203
|
NodeVM: NodeVM$2
|
|
1205
1204
|
} = vm2__default["default"];
|
|
1206
|
-
const debug$
|
|
1205
|
+
const debug$m = debug__default["default"]('botium-core-asserterUtils');
|
|
1207
1206
|
const {
|
|
1208
1207
|
BotiumError: BotiumError$6
|
|
1209
1208
|
} = BotiumError_1;
|
|
@@ -1258,7 +1257,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
|
|
|
1258
1257
|
_fetchAsserters() {
|
|
1259
1258
|
this.caps[Capabilities.ASSERTERS].forEach(asserter => {
|
|
1260
1259
|
if (this.asserters[asserter.ref]) {
|
|
1261
|
-
debug$
|
|
1260
|
+
debug$m(`${asserter.ref} asserter already exists, overwriting.`);
|
|
1262
1261
|
}
|
|
1263
1262
|
this.asserters[asserter.ref] = this._loadClass(asserter, 'asserter');
|
|
1264
1263
|
if (asserter.global) {
|
|
@@ -1269,7 +1268,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
|
|
|
1269
1268
|
_fetchLogicHooks() {
|
|
1270
1269
|
this.caps[Capabilities.LOGIC_HOOKS].forEach(logicHook => {
|
|
1271
1270
|
if (this.logicHooks[logicHook.ref]) {
|
|
1272
|
-
debug$
|
|
1271
|
+
debug$m(`${logicHook.ref} logic hook already exists, overwriting.`);
|
|
1273
1272
|
}
|
|
1274
1273
|
this.logicHooks[logicHook.ref] = this._loadClass(logicHook, 'logichook');
|
|
1275
1274
|
if (logicHook.global) {
|
|
@@ -1280,7 +1279,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
|
|
|
1280
1279
|
_fetchUserInputs() {
|
|
1281
1280
|
this.caps[Capabilities.USER_INPUTS].forEach(userInput => {
|
|
1282
1281
|
if (this.userInputs[userInput.ref]) {
|
|
1283
|
-
debug$
|
|
1282
|
+
debug$m(`${userInput.ref} userinput already exists, overwriting.`);
|
|
1284
1283
|
}
|
|
1285
1284
|
this.userInputs[userInput.ref] = this._loadClass(userInput, 'userinput');
|
|
1286
1285
|
});
|
|
@@ -1485,7 +1484,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
|
|
|
1485
1484
|
loadErr.push(`Failed to fetch ${ref} ${hookType} from ${src} - ${err.message} `);
|
|
1486
1485
|
}
|
|
1487
1486
|
}
|
|
1488
|
-
loadErr.forEach(debug$
|
|
1487
|
+
loadErr.forEach(debug$m);
|
|
1489
1488
|
}
|
|
1490
1489
|
throw new Error(`Failed to fetch ${ref} ${hookType}, no idea how to load ...`);
|
|
1491
1490
|
}
|
|
@@ -1696,6 +1695,7 @@ var Enums = {
|
|
|
1696
1695
|
};
|
|
1697
1696
|
Enums.E_SCRIPTING_MEMORY_COLUMN_MODE;
|
|
1698
1697
|
|
|
1698
|
+
const debug$l = debug__default["default"]('botium-core-scripting-helper');
|
|
1699
1699
|
const {
|
|
1700
1700
|
E_SCRIPTING_MEMORY_COLUMN_MODE: E_SCRIPTING_MEMORY_COLUMN_MODE$1
|
|
1701
1701
|
} = Enums;
|
|
@@ -2246,7 +2246,7 @@ const calculateWer$1 = (str, pattern) => {
|
|
|
2246
2246
|
continue;
|
|
2247
2247
|
}
|
|
2248
2248
|
const wordCount = wildcardPart.split(' ').length;
|
|
2249
|
-
const subsetPhrases = _getSubsets(botMessageWords,
|
|
2249
|
+
const subsetPhrases = _getSubsets(botMessageWords, Math.min(wordCount, botMessageWords.length)).map(subset => subset.join(' '));
|
|
2250
2250
|
let subsetPhraseFound = null;
|
|
2251
2251
|
for (const subsetPhrase of subsetPhrases) {
|
|
2252
2252
|
const localWer = wordErrorRate__default["default"].wordErrorRate(subsetPhrase, wildcardPart).toFixed(2);
|
|
@@ -2255,7 +2255,9 @@ const calculateWer$1 = (str, pattern) => {
|
|
|
2255
2255
|
wer = localWer;
|
|
2256
2256
|
}
|
|
2257
2257
|
}
|
|
2258
|
-
|
|
2258
|
+
if (lodash__default["default"].isNil(subsetPhraseFound)) {
|
|
2259
|
+
throw new Error('Word Error Asserter: Something went wrong here, please try to modify your assertion!');
|
|
2260
|
+
}
|
|
2259
2261
|
errors.push(_getErrors(_getWords(wildcardPart), _getWords(subsetPhraseFound)));
|
|
2260
2262
|
}
|
|
2261
2263
|
let errCount = 0;
|
|
@@ -2264,6 +2266,7 @@ const calculateWer$1 = (str, pattern) => {
|
|
|
2264
2266
|
errCount += err.filter(err => err === true).length;
|
|
2265
2267
|
allCount += err.length;
|
|
2266
2268
|
}
|
|
2269
|
+
debug$l(`Word Error Rate Asserter - Compared Bot Message '${botMessage}' / '${utt}': ${(errCount / allCount).toFixed(2)}`);
|
|
2267
2270
|
return (errCount / allCount).toFixed(2);
|
|
2268
2271
|
};
|
|
2269
2272
|
var helper = {
|