botium-core 1.14.8 → 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.
@@ -77,7 +77,7 @@ var express__default = /*#__PURE__*/_interopDefaultLegacy(express);
77
77
  var bodyParser__default = /*#__PURE__*/_interopDefaultLegacy(bodyParser);
78
78
 
79
79
  var name = "botium-core";
80
- var version$1 = "1.14.8";
80
+ var version$1 = "1.14.9";
81
81
  var description = "The Selenium for Chatbots";
82
82
  var main = "index.js";
83
83
  var module$1 = "dist/botium-es.js";
@@ -1970,12 +1970,6 @@ const validateConvo$2 = convo => {
1970
1970
  if (optionalSet.size > 1) {
1971
1971
  validationResult.errors.push(new Error(`Step ${i + 1}: Failed to decompile conversation. Mixed optional flag is not allowed inside one step.`));
1972
1972
  }
1973
- if (optionalSet.size === 1 && optionalSet.has(true)) {
1974
- const nextStep = convo.conversation[i + 1];
1975
- if (!nextStep || nextStep.sender !== 'bot') {
1976
- validationResult.errors.push(new Error(`Step ${i + 1}: Optional bot convo step has to be followed by a bot convo step.`));
1977
- }
1978
- }
1979
1973
  }
1980
1974
  if (!validateSender$1(step.sender)) {
1981
1975
  validationResult.errors.push(new Error(`Step ${i + 1}: Sender #${step.sender} is invalid.`));
@@ -2019,6 +2013,10 @@ const convoStepToLines$2 = step => {
2019
2013
  } else {
2020
2014
  if (step.messageText) {
2021
2015
  lines.push((step.optional ? '?' : '') + (step.not ? '!' : '') + step.messageText);
2016
+ } else {
2017
+ if (step.optional) {
2018
+ lines.push('?');
2019
+ }
2022
2020
  }
2023
2021
  if (step.buttons && step.buttons.length > 0) lines.push('BUTTONS' + _formatAppendArgs(step.buttons.filter(b => b.text).map(b => flatString(b.text))));
2024
2022
  if (step.media && step.media.length > 0) lines.push('MEDIA' + _formatAppendArgs(step.media.filter(m => !m.buffer && m.mediaUri).map(m => m.mediaUri)));
@@ -3161,7 +3159,7 @@ class Convo$6 {
3161
3159
  });
3162
3160
  transcriptStep.botBegin = new Date();
3163
3161
  if (!botMsg) {
3164
- botMsg = await container.WaitBotSays(convoStep.channel);
3162
+ botMsg = await container.WaitBotSays(convoStep.channel, convoStepParameters?.stepTimeout);
3165
3163
  }
3166
3164
  transcriptStep.botEnd = new Date();
3167
3165
  transcriptStep.actual = new BotiumMockMessage_1(botMsg);
@@ -3169,6 +3167,9 @@ class Convo$6 {
3169
3167
  debug$k(`${this.header.name}: bot says (cleaned by binary and base64 data and sourceData) ${JSON.stringify(coreMsg, null, 2)}`);
3170
3168
  } catch (err) {
3171
3169
  transcriptStep.botEnd = new Date();
3170
+ if (convoStep.optional) {
3171
+ continue;
3172
+ }
3172
3173
  const failErr = botiumErrorFromErr$1(`${this.header.name}/${convoStep.stepTag}: error waiting for bot - ${err.message}`, err);
3173
3174
  debug$k(failErr);
3174
3175
  try {