botium-core 1.14.7 → 1.14.9
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 +9 -8
- package/dist/botium-cjs.js.map +1 -1
- package/dist/botium-es.js +9 -8
- package/dist/botium-es.js.map +1 -1
- package/package.json +1 -1
- package/src/scripting/Convo.js +5 -1
- package/src/scripting/helper.js +4 -7
- package/src/scripting/logichook/asserter/BaseTextAsserter.js +16 -1
- package/test/convo/convos/welcome_multiple_botsteps_opt.convo.txt +22 -0
- package/test/convo/transcript.spec.js +54 -0
- package/test/scripting/asserters/convoStepParameters.spec.js +6 -0
- package/test/scripting/asserters/convos/convo_step_parameter_optional_with_timeout.convo.txt +16 -0
- package/test/scripting/txt/decompile.spec.js +0 -25
package/dist/botium-es.js
CHANGED
|
@@ -35,7 +35,7 @@ import express from 'express';
|
|
|
35
35
|
import bodyParser from 'body-parser';
|
|
36
36
|
|
|
37
37
|
var name = "botium-core";
|
|
38
|
-
var version$1 = "1.14.
|
|
38
|
+
var version$1 = "1.14.9";
|
|
39
39
|
var description = "The Selenium for Chatbots";
|
|
40
40
|
var main = "index.js";
|
|
41
41
|
var module = "dist/botium-es.js";
|
|
@@ -1928,12 +1928,6 @@ const validateConvo$2 = convo => {
|
|
|
1928
1928
|
if (optionalSet.size > 1) {
|
|
1929
1929
|
validationResult.errors.push(new Error(`Step ${i + 1}: Failed to decompile conversation. Mixed optional flag is not allowed inside one step.`));
|
|
1930
1930
|
}
|
|
1931
|
-
if (optionalSet.size === 1 && optionalSet.has(true)) {
|
|
1932
|
-
const nextStep = convo.conversation[i + 1];
|
|
1933
|
-
if (!nextStep || nextStep.sender !== 'bot') {
|
|
1934
|
-
validationResult.errors.push(new Error(`Step ${i + 1}: Optional bot convo step has to be followed by a bot convo step.`));
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
1931
|
}
|
|
1938
1932
|
if (!validateSender$1(step.sender)) {
|
|
1939
1933
|
validationResult.errors.push(new Error(`Step ${i + 1}: Sender #${step.sender} is invalid.`));
|
|
@@ -1977,6 +1971,10 @@ const convoStepToLines$2 = step => {
|
|
|
1977
1971
|
} else {
|
|
1978
1972
|
if (step.messageText) {
|
|
1979
1973
|
lines.push((step.optional ? '?' : '') + (step.not ? '!' : '') + step.messageText);
|
|
1974
|
+
} else {
|
|
1975
|
+
if (step.optional) {
|
|
1976
|
+
lines.push('?');
|
|
1977
|
+
}
|
|
1980
1978
|
}
|
|
1981
1979
|
if (step.buttons && step.buttons.length > 0) lines.push('BUTTONS' + _formatAppendArgs(step.buttons.filter(b => b.text).map(b => flatString(b.text))));
|
|
1982
1980
|
if (step.media && step.media.length > 0) lines.push('MEDIA' + _formatAppendArgs(step.media.filter(m => !m.buffer && m.mediaUri).map(m => m.mediaUri)));
|
|
@@ -3119,7 +3117,7 @@ class Convo$6 {
|
|
|
3119
3117
|
});
|
|
3120
3118
|
transcriptStep.botBegin = new Date();
|
|
3121
3119
|
if (!botMsg) {
|
|
3122
|
-
botMsg = await container.WaitBotSays(convoStep.channel);
|
|
3120
|
+
botMsg = await container.WaitBotSays(convoStep.channel, convoStepParameters?.stepTimeout);
|
|
3123
3121
|
}
|
|
3124
3122
|
transcriptStep.botEnd = new Date();
|
|
3125
3123
|
transcriptStep.actual = new BotiumMockMessage_1(botMsg);
|
|
@@ -3127,6 +3125,9 @@ class Convo$6 {
|
|
|
3127
3125
|
debug$k(`${this.header.name}: bot says (cleaned by binary and base64 data and sourceData) ${JSON.stringify(coreMsg, null, 2)}`);
|
|
3128
3126
|
} catch (err) {
|
|
3129
3127
|
transcriptStep.botEnd = new Date();
|
|
3128
|
+
if (convoStep.optional) {
|
|
3129
|
+
continue;
|
|
3130
|
+
}
|
|
3130
3131
|
const failErr = botiumErrorFromErr$1(`${this.header.name}/${convoStep.stepTag}: error waiting for bot - ${err.message}`, err);
|
|
3131
3132
|
debug$k(failErr);
|
|
3132
3133
|
try {
|