├── .eslintignore
├── .eslintrc.js
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── SUPPORT.md
├── pull_request_template.md
└── stale.yml
├── .gitignore
├── .npmignore
├── .tern-project
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── index.js
├── package-lock.json
├── package.json
├── report.js
├── rollup.config.js
├── samples
├── connectors
│ ├── custom
│ │ ├── Readme.md
│ │ ├── botium-connector-myapi.js
│ │ ├── botium.json
│ │ ├── package.json
│ │ └── spec
│ │ │ ├── botium.spec.js
│ │ │ └── convo
│ │ │ └── hello.convo.txt
│ ├── simplerest-async
│ │ ├── Readme.md
│ │ ├── botium-box.json
│ │ ├── botium-inbound.json
│ │ ├── botium-redis.json
│ │ ├── botiumFluent.js
│ │ └── jokebot.js
│ ├── simplerest-polling
│ │ ├── Readme.md
│ │ ├── botium.json
│ │ ├── botiumFluent.js
│ │ └── jokebot.js
│ └── simplerest
│ │ ├── botium.json
│ │ └── botiumFluent.js
├── extensions
│ ├── asserterHooks
│ │ ├── DummyAsserter.js
│ │ ├── README.md
│ │ ├── botium.json
│ │ ├── botiumFluent.js
│ │ ├── convos
│ │ │ └── txt
│ │ │ │ └── restaurant.convo.txt
│ │ └── package.json
│ └── logichooks
│ │ ├── botium.json
│ │ ├── botiumFluent.js
│ │ ├── convos
│ │ └── echo.convo.txt
│ │ └── custom
│ │ └── MyAsserter.js
├── postman
│ ├── Botium Agent Sample.postman_collection.json
│ ├── README.md
│ └── botiumFluent.js
└── scripting
│ ├── convofiles
│ ├── Book1.xlsx
│ ├── botium.json
│ ├── botiumFluent.js
│ ├── botiumFluentMemory.js
│ ├── botiumFluentXlsx.js
│ ├── botiumFluentXlsxUtt.js
│ ├── convos
│ │ ├── memory
│ │ │ └── restaurant.convo.txt
│ │ ├── txt
│ │ │ ├── hello.utterances.txt
│ │ │ └── restaurant.convo.txt
│ │ └── xlsx
│ │ │ └── Book2.xlsx
│ ├── helloworld.xlsx
│ └── helloworldQestionAnswer.xlsx
│ └── utterances
│ ├── .gitignore
│ ├── botium.json
│ ├── botiumFluent.js
│ └── botiumProcessUtterances.js
├── src
├── BotDriver.js
├── Capabilities.js
├── Commands.js
├── Defaults.js
├── Enums.js
├── Events.js
├── Fluent.js
├── Plugins.js
├── Source.js
├── containers
│ ├── BaseContainer.js
│ ├── GridContainer.js
│ ├── InProcessContainer.js
│ ├── PluginConnectorContainer.js
│ └── plugins
│ │ ├── SimpleRestContainer.js
│ │ └── index.js
├── grid
│ ├── agent
│ │ ├── AgentWorker.js
│ │ ├── agent.js
│ │ ├── agentworkerpool.js
│ │ ├── routes.js
│ │ ├── swagger.json
│ │ ├── swaggerDef.json
│ │ └── views
│ │ │ └── index.html
│ └── inbound
│ │ └── proxy.js
├── helpers
│ ├── CapabilitiesUtils.js
│ ├── HookUtils.js
│ ├── ProcessUtils.js
│ ├── Queue.js
│ ├── QueueTimeoutError.js
│ ├── RetryHelper.js
│ ├── SafeFileCopy.js
│ ├── TranscriptUtils.js
│ └── Utils.js
├── mocks
│ ├── BotiumMockAttachment.js
│ ├── BotiumMockCommand.js
│ ├── BotiumMockMessage.js
│ ├── BotiumMockRichMessageTypes.js
│ └── BotiumMockScripting.js
├── repos
│ ├── BaseRepo.js
│ ├── GitRepo.js
│ ├── LocalRepo.js
│ └── NoRepo.js
└── scripting
│ ├── BotiumError.js
│ ├── CompilerBase.js
│ ├── CompilerCsv.js
│ ├── CompilerJson.js
│ ├── CompilerMarkdown.js
│ ├── CompilerObjectBase.js
│ ├── CompilerTxt.js
│ ├── CompilerXlsx.js
│ ├── CompilerYaml.js
│ ├── Constants.js
│ ├── Convo.js
│ ├── MatchFunctions.js
│ ├── ScriptingMemory.js
│ ├── ScriptingProvider.js
│ ├── Utterance.js
│ ├── helper.js
│ ├── logichook
│ ├── LogicHookConsts.js
│ ├── LogicHookUtils.js
│ ├── PauseLogic.js
│ ├── asserter
│ │ ├── BaseCountAsserter.js
│ │ ├── BaseTextAsserter.js
│ │ ├── BotRepliesConsumedAsserter.js
│ │ ├── BotRepliesUnconsumedCountAsserter.js
│ │ ├── ButtonsAsserter.js
│ │ ├── ButtonsCountAsserter.js
│ │ ├── ButtonsCountRecAsserter.js
│ │ ├── CardsAsserter.js
│ │ ├── CardsCountAsserter.js
│ │ ├── CardsCountRecAsserter.js
│ │ ├── EntitiesAsserter.js
│ │ ├── EntityContentAsserter.js
│ │ ├── EntityValuesAsserter.js
│ │ ├── FormsAsserter.js
│ │ ├── IntentAsserter.js
│ │ ├── IntentConfidenceAsserter.js
│ │ ├── IntentUniqueAsserter.js
│ │ ├── JsonPathAsserter.js
│ │ ├── JsonPathCountAsserter.js
│ │ ├── MediaAsserter.js
│ │ ├── MediaCountAsserter.js
│ │ ├── MediaCountRecAsserter.js
│ │ ├── PauseAsserter.js
│ │ ├── ResponseLengthAsserter.js
│ │ ├── TextContainsAllAsserter.js
│ │ ├── TextContainsAllICAsserter.js
│ │ ├── TextContainsAnyAsserter.js
│ │ ├── TextContainsAnyICAsserter.js
│ │ ├── TextEqualsAnyAsserter.js
│ │ ├── TextEqualsAnyICAsserter.js
│ │ ├── TextRegexpAllAsserter.js
│ │ ├── TextRegexpAllICAsserter.js
│ │ ├── TextRegexpAnyAsserter.js
│ │ ├── TextRegexpAnyICAsserter.js
│ │ ├── TextWildcardAllAsserter.js
│ │ ├── TextWildcardAllICAsserter.js
│ │ ├── TextWildcardAnyAsserter.js
│ │ ├── TextWildcardAnyICAsserter.js
│ │ ├── TextWildcardExactAllAsserter.js
│ │ ├── TextWildcardExactAllICAsserter.js
│ │ ├── TextWildcardExactAnyAsserter.js
│ │ ├── TextWildcardExactAnyICAsserter.js
│ │ └── WerAsserter.js
│ ├── helpers.js
│ ├── logichooks
│ │ ├── AssignScriptingMemoryLogicHook.js
│ │ ├── ClearQueueLogicHook.js
│ │ ├── ClearScriptingMemoryLogicHook.js
│ │ ├── ConditionalBusinessHoursLogicHook.js
│ │ ├── ConditionalCapabilityValueBasedLogicHook.js
│ │ ├── ConditionalJsonPathBasedLogicHook.js
│ │ ├── ConditionalTimeBasedLogicHook.js
│ │ ├── ConvoStepParametersLogicHook.js
│ │ ├── IncludeLogicHook.js
│ │ ├── OrderedListToButtonLogicHook.js
│ │ ├── PauseLogicHook.js
│ │ ├── SetScriptingMemoryLogicHook.js
│ │ ├── UpdateCustomLogicHook.js
│ │ └── WaitForBotLogicHook.js
│ └── userinput
│ │ ├── ButtonInput.js
│ │ ├── FormInput.js
│ │ └── MediaInput.js
│ └── precompilers
│ ├── JsonToJson.js
│ ├── MarkdownRasa.js
│ ├── Script.js
│ └── index.js
└── test
├── compiler
├── compilercsv.spec.js
├── compilerjson.spec.js
├── compilermarkdown.spec.js
├── compilertxt.spec.js
├── compilerxlsx.spec.js
├── compileryaml.spec.js
├── convos
│ ├── convos_precompiler_json_to_json_jsonpath.json
│ ├── convos_precompiler_markdown_rasa.md
│ ├── convos_precompiler_script.json
│ ├── convos_precompiler_script.json.txt
│ ├── convos_precompiler_script_text_to_text.convo.txt
│ ├── csv
│ │ ├── convos_column_basic.csv
│ │ ├── convos_column_me_bot.csv
│ │ ├── convos_column_more_convos.csv
│ │ ├── convos_column_no_header.csv
│ │ ├── convos_column_sequence.csv
│ │ ├── convos_column_sequence_no_def_colname.csv
│ │ ├── convos_sender_basic.csv
│ │ ├── convos_sender_more_convos.csv
│ │ ├── convos_sender_no_header.csv
│ │ ├── convos_sender_no_text.csv
│ │ ├── convos_sender_sequence_and_extra_row.csv
│ │ ├── convos_sender_sequence_and_extra_row_no_def_colname.csv
│ │ ├── utterances_liveperson.csv
│ │ ├── utterances_liveperson2.csv
│ │ ├── utterances_multicolumn3col.csv
│ │ ├── utterances_multicolumn5col.csv
│ │ ├── utterances_singlecolumn.csv
│ │ └── utterances_variable_row_len.csv
│ ├── json
│ │ ├── convos_and_utterances.json
│ │ └── scripting_memory.json
│ ├── md
│ │ ├── convos_precompiler_markdown.md
│ │ ├── convos_precompiler_markdown_invalid_noh1.md
│ │ ├── convos_precompiler_markdown_invalid_noh2.md
│ │ ├── convos_precompiler_markdown_utterances.md
│ │ ├── convos_with_exclamation.md
│ │ ├── convos_with_exclamation_secline.md
│ │ ├── convos_with_four_exclamation.md
│ │ ├── convos_with_four_question.md
│ │ ├── convos_with_question.md
│ │ ├── convos_with_question_exclamation.md
│ │ ├── convos_with_question_invalid.md
│ │ ├── convos_with_question_secline.md
│ │ ├── convos_with_two_exclamation.md
│ │ ├── convos_with_two_question.md
│ │ └── convos_with_two_question_exclamation.md
│ ├── txt
│ │ ├── convos_args_escape.convo.txt
│ │ ├── convos_asserter_modificator.convo.txt
│ │ ├── convos_emptyrow_empty.convo.txt
│ │ ├── convos_emptyrow_just_asserter.convo.txt
│ │ ├── convos_emptyrow_just_asserter_no_separator_row.convo.txt
│ │ ├── convos_emptyrow_just_emptyrow.convo.txt
│ │ ├── convos_emptyrow_just_text.convo.txt
│ │ ├── convos_emptyrow_just_text_no_separator_row.convo.txt
│ │ ├── convos_emptyrow_no_separator_row.convo.txt
│ │ ├── convos_emptyrow_text_after_logichook.convo.txt
│ │ ├── convos_invalidsender.convo.txt
│ │ ├── convos_jsonmessage.convo.txt
│ │ ├── convos_mixed_new_line_characters.convo.txt
│ │ ├── convos_with_exclamation.convo.txt
│ │ ├── convos_with_exclamation_secline.convo.txt
│ │ ├── convos_with_four_exclamation.convo.txt
│ │ ├── convos_with_four_question.convo.txt
│ │ ├── convos_with_hashmark.convo.txt
│ │ ├── convos_with_newlines.convo.txt
│ │ ├── convos_with_question.convo.txt
│ │ ├── convos_with_question_exclamation.convo.txt
│ │ ├── convos_with_question_secline.convo.txt
│ │ ├── convos_with_two_exclamation.convo.txt
│ │ ├── convos_with_two_question.convo.txt
│ │ └── convos_with_two_question_exclamation.convo.txt
│ ├── xlsx
│ │ ├── convos_2convos.xlsx
│ │ ├── convos_2convos_2utterances.xlsx
│ │ ├── convos_2convos_middle.xlsx
│ │ ├── convos_2convos_simplified_to_force.xlsx
│ │ ├── convos_2convos_with_names.xlsx
│ │ ├── convos_2convos_with_names_noheader.xlsx
│ │ ├── convos_2convos_without_names.xlsx
│ │ ├── convos_2convos_without_names_noheader.xlsx
│ │ ├── convos_2utterances.xlsx
│ │ ├── convos_2utterances_emptylines.xlsx
│ │ ├── convos_2x2convos_simplified.xlsx
│ │ ├── convos_logichook_after.xlsx
│ │ ├── convos_logichook_before.xlsx
│ │ ├── convos_mix_qa_and_convos.xlsx
│ │ ├── convos_sheetnames.xlsx
│ │ ├── convos_sortorder.xlsx
│ │ ├── convos_with_exclamation.xlsx
│ │ ├── convos_with_exclamation_secline.xlsx
│ │ ├── convos_with_four_exclamation.xlsx
│ │ ├── convos_with_four_question.xlsx
│ │ ├── convos_with_question.xlsx
│ │ ├── convos_with_question_exclamation.xlsx
│ │ ├── convos_with_question_secline.xlsx
│ │ ├── convos_with_two_exclamation.xlsx
│ │ ├── convos_with_two_question.xlsx
│ │ └── convos_with_two_question_exclamation.xlsx
│ └── yaml
│ │ ├── convos_and_utterances.yml
│ │ └── scripting_memory.yml
├── precompilerjson.spec.js
├── precompilermarkdownrasa.spec.js
└── precompilerscript.spec.js
├── connectors
├── convos
│ ├── hello.convo.txt
│ ├── responsefromping.convo.txt
│ └── responsefromstart.convo.txt
├── logicHook.js
├── pluginconnectorcontainer.spec.js
└── simplerest.spec.js
├── convo
├── convos
│ ├── 1step.convo.txt
│ ├── 2steps.convo.txt
│ ├── 2stepsWithPause.convo.txt
│ ├── 2stepsfailing.convo.txt
│ ├── 2stepsneg.convo.txt
│ ├── 2stepsopt.convo.txt
│ ├── 2stepsoptfollowme.convo.txt
│ ├── 2stepsoptneg.convo.txt
│ ├── 2stepsoptskip.convo.txt
│ ├── applyscriptingmemoryinbegin.convo.txt
│ ├── applyscriptingmemorytoasserterargs.convo.txt
│ ├── assert_date.convo.txt
│ ├── asserters.convo.txt
│ ├── assertersopt.convo.txt
│ ├── assertersoptskip.convo.txt
│ ├── botreply_not_consumed_end.convo.txt
│ ├── botreply_not_consumed_end_not.convo.txt
│ ├── botreply_not_consumed_me.convo.txt
│ ├── botreply_skip_unconsumed.convo.txt
│ ├── botreply_unconsumed_count.convo.txt
│ ├── continuefailing.convo.txt
│ ├── continuefailing_timeout.convo.txt
│ ├── invalidsender.convo.txt
│ ├── json-matching-key-and-value.convo.txt
│ ├── json-mismatching-key.convo.txt
│ ├── json-mismatching-value.convo.txt
│ ├── memory.convo.txt
│ ├── memory_dont_override_functions.convo.txt
│ ├── memory_fail.convo.txt
│ ├── memory_normalize.convo.txt
│ ├── multiline.convo.txt
│ ├── multiple_asserting_errors.convo.txt
│ ├── partialconvo
│ │ ├── circular
│ │ │ ├── first.pconvo.txt
│ │ │ ├── main.convo.txt
│ │ │ └── second.pconvo.txt
│ │ ├── csv
│ │ │ ├── main.convo.csv
│ │ │ └── pconvos.pconvo.csv
│ │ ├── depth1
│ │ │ ├── login.pconvo.txt
│ │ │ ├── logout.pconvo.txt
│ │ │ └── main.convo.txt
│ │ ├── depth2
│ │ │ ├── depth1.pconvo.txt
│ │ │ ├── depth2.pconvo.txt
│ │ │ └── main.convo.txt
│ │ ├── duplicateinclude
│ │ │ ├── main.convo.txt
│ │ │ └── sub.pconvo.txt
│ │ ├── duplicatepconvo
│ │ │ ├── pconvofirst.pconvo.txt
│ │ │ └── pconvosecond.pconvo.txt
│ │ ├── excel
│ │ │ ├── bottext
│ │ │ │ └── bottext.xlsx
│ │ │ ├── convo
│ │ │ │ └── convo.xlsx
│ │ │ └── emptystep
│ │ │ │ └── emptystep.xlsx
│ │ ├── illegalname
│ │ │ └── illegalname.pconvo.txt
│ │ ├── includeafterbot
│ │ │ ├── afterbot.pconvo.txt
│ │ │ └── main.convo.txt
│ │ ├── includedmoretimes
│ │ │ ├── main.convo.txt
│ │ │ └── sub.pconvo.txt
│ │ ├── includefirst
│ │ │ ├── depth1.pconvo.txt
│ │ │ ├── depth2.pconvo.txt
│ │ │ └── main.convo.txt
│ │ ├── noname
│ │ │ └── noname.pconvo.txt
│ │ ├── notfound
│ │ │ └── main.convo.txt
│ │ ├── usesender
│ │ │ ├── depth1.pconvo.txt
│ │ │ ├── depth2.pconvo.txt
│ │ │ └── main.convo.txt
│ │ ├── usesendermultiinclude
│ │ │ ├── main.convo.txt
│ │ │ └── sub.pconvo.txt
│ │ ├── usesendermultiincludejson
│ │ │ ├── main.json
│ │ │ └── sub.json
│ │ ├── usesendermultiincludemd
│ │ │ └── convos.md
│ │ ├── usesendermultiincludeyaml
│ │ │ └── convos.yml
│ │ ├── withscriptingmemory
│ │ │ ├── login.pconvo.txt
│ │ │ ├── logout.pconvo.txt
│ │ │ └── main.convo.txt
│ │ ├── withutterances
│ │ │ ├── affirmative.utterances.txt
│ │ │ ├── login.pconvo.txt
│ │ │ ├── logout.pconvo.txt
│ │ │ └── main.convo.txt
│ │ ├── wrongarg
│ │ │ ├── main.convo.txt
│ │ │ └── sub.pconvo.txt
│ │ └── wrongref
│ │ │ ├── exists.pconvo.txt
│ │ │ └── main.convo.txt
│ ├── retryasserter1step.convo.txt
│ ├── tree
│ │ ├── excel
│ │ │ └── testbotium.xlsx
│ │ ├── simpletree
│ │ │ ├── convo1.convo.txt
│ │ │ └── convo2.convo.txt
│ │ ├── withloop
│ │ │ ├── convo1.convo.txt
│ │ │ └── convo2.convo.txt
│ │ ├── withuserinput
│ │ │ ├── convo1.convo.txt
│ │ │ └── convo2.convo.txt
│ │ └── withutterance
│ │ │ ├── convo1.convo.txt
│ │ │ ├── convo2.convo.txt
│ │ │ └── utt.utterances.txt
│ ├── utt_memory.convo.txt
│ ├── utt_memory.utterances.txt
│ └── welcome_multiple_botsteps_opt.convo.txt
├── failure.spec.js
├── fillAndApplyScriptingMemory.spec.js
├── partialconvo.spec.js
├── ratelimit.spec.js
├── retry.spec.js
├── retryasserter.spec.js
├── transcript.spec.js
└── tree.spec.js
├── driver
├── capabilities.spec.js
└── configFiles
│ ├── config1.json
│ └── config2.json
├── grid
└── agent
│ └── client.js
├── helpers
├── capabilitiesutils.spec.js
├── convos
│ └── hello.convo.txt
└── transcriptutils.spec.js
├── hooks
└── customhooks.spec.js
├── logichooks
├── botium-asserter-fromfile.js
├── botium-connector-fromfile.js
├── convos
│ ├── HOOKFROMSRC.convo.txt
│ ├── TEXTFROMBOTHOOK.convo.txt
│ ├── TEXTFROMHOOK.convo.txt
│ ├── WAITFORBOT_1000.convo.txt
│ ├── WAITFORBOT_1000_BEGIN.convo.txt
│ ├── WAITFORBOT_1000_BOT_AND_END.convo.txt
│ ├── WAITFORBOT_1000_END.convo.txt
│ └── WAITFORBOT_INFINITE.convo.txt
├── hookfromsrc.spec.js
├── orderedListToButton.spec.js
├── textfromhook.spec.js
└── waitforbot.spec.js
├── plugins
├── plugindir
│ ├── fromfile
│ │ ├── botium-connector-fromfile1.js
│ │ └── botium-connector-fromfile2.js
│ └── fromfolder
│ │ └── botium-connector-fromdir1
│ │ └── index.js
└── plugins.spec.js
├── scripting
├── asserters
│ ├── buttonsAsserter.spec.js
│ ├── cardsAsserter.spec.js
│ ├── convoStepParameters.spec.js
│ ├── convos
│ │ ├── TEXT_GOOD.convo.txt
│ │ ├── convo_step_parameter_matchmode_failed.convo.txt
│ │ ├── convo_step_parameter_matchmode_failed_wer.convo.txt
│ │ ├── convo_step_parameter_optional_with_timeout.convo.txt
│ │ ├── convo_step_parameter_retry_asserters_all_good.convo.txt
│ │ ├── convo_step_parameter_retry_asserters_botium_timeout.convo.txt
│ │ ├── convo_step_parameter_retry_asserters_good.convo.txt
│ │ ├── convo_step_parameter_retry_asserters_good_global.convo.txt
│ │ ├── convo_step_parameter_retry_main_and_asserter.convo.txt
│ │ ├── convo_step_parameter_retry_main_botium_timeout.convo.txt
│ │ ├── convo_step_parameter_retry_main_but_no_button.convo.txt
│ │ ├── convo_step_parameter_retry_main_good.convo.txt
│ │ ├── convo_step_parameter_retry_main_good_begin.convo.txt
│ │ ├── text_contains_all_nok_base.yml
│ │ ├── text_contains_all_nok_ignore_case.yml
│ │ ├── text_contains_all_nok_more_words.yml
│ │ ├── text_contains_all_nok_more_words_partial_match.yml
│ │ ├── text_contains_all_nok_negate.yml
│ │ ├── text_contains_all_nok_utterances.yml
│ │ ├── text_contains_all_ok_base.yml
│ │ ├── text_contains_all_ok_ignore_case.yml
│ │ ├── text_contains_all_ok_more_words.yml
│ │ ├── text_contains_all_ok_negate.yml
│ │ ├── text_contains_all_ok_utterances.yml
│ │ ├── text_contains_any_nok_base.yml
│ │ ├── text_contains_any_nok_ignore_case.yml
│ │ ├── text_contains_any_nok_more_words.yml
│ │ ├── text_contains_any_nok_negate.yml
│ │ ├── text_contains_any_nok_utterances.yml
│ │ ├── text_contains_any_ok_base.yml
│ │ ├── text_contains_any_ok_ignore_case.yml
│ │ ├── text_contains_any_ok_more_words.yml
│ │ ├── text_contains_any_ok_negate.yml
│ │ ├── text_contains_any_ok_utterances.yml
│ │ ├── text_equals_nok_base.yml
│ │ ├── text_equals_nok_utterances.yml
│ │ ├── text_equals_ok_base.yml
│ │ ├── text_equals_ok_ignore_case.yml
│ │ ├── text_equals_ok_utterances.yml
│ │ ├── text_nok.yml
│ │ ├── text_nok_no_arg.yml
│ │ ├── text_nok_no_arg_negate.yml
│ │ ├── text_ok.yml
│ │ ├── text_ok_no_arg.yml
│ │ ├── text_ok_no_arg_negate.yml
│ │ ├── text_regexp_all_nok.yml
│ │ ├── text_regexp_all_ok.yml
│ │ ├── text_regexp_any_nok.yml
│ │ ├── text_regexp_any_ok.yml
│ │ ├── text_wildcard_all_nok.yml
│ │ ├── text_wildcard_all_ok.yml
│ │ ├── text_wildcard_any_nok.yml
│ │ ├── text_wildcard_any_ok.yml
│ │ ├── text_wildcardexact_all_nok.yml
│ │ ├── text_wildcardexact_all_ok.yml
│ │ ├── text_wildcardexact_any_nok.yml
│ │ ├── text_wildcardexact_any_ok.yml
│ │ ├── wer_threshold_nok_float.yml
│ │ ├── wer_threshold_nok_percentage.yml
│ │ ├── wer_threshold_ok_float.yml
│ │ ├── wer_threshold_ok_percentage.yml
│ │ ├── wer_threshold_wildcard_nok_float.yml
│ │ ├── wer_threshold_wildcard_nok_percentage.yml
│ │ ├── wer_threshold_wildcard_ok_float.yml
│ │ └── wer_threshold_wildcard_ok_percentage.yml
│ ├── entitiesAsserter.spec.js
│ ├── entityContentAsserter.spec.js
│ ├── entityValuesAsserter.spec.js
│ ├── formsAsserter.spec.js
│ ├── intentAsserter.spec.js
│ ├── intentConfidenceAsserter.spec.js
│ ├── intentUniqueAsserter.spec.js
│ ├── jsonpathAsserter.spec.js
│ ├── mediaAsserter.spec.js
│ ├── responseLengthAsserter.spec.js
│ ├── textAsserter.spec.js
│ ├── textContainsAllAsserter.spec.js
│ ├── textContainsAnyAsserter.spec.js
│ ├── textEqualsAsserter.spec.js
│ ├── textRegexpAllAsserter.spec.js
│ ├── textRegexpAnyAsserter.spec.js
│ ├── textWildcardAllAsserter.spec.js
│ ├── textWildcardAnyAsserter.spec.js
│ ├── textWildcardExactAllAsserter.spec.js
│ ├── textWildcardExactAnyAsserter.spec.js
│ └── werAsserter.spec.js
├── convos
│ ├── .gitignore
│ ├── convo1.convo.txt
│ ├── convo2.convo.txt
│ └── shouldignore
│ │ └── convo3.convo.txt
├── helper.spec.js
├── logichooks
│ ├── CustomConditionalLogicHook.js
│ ├── conditionalStepBusinessHoursLogicHook.spec.js
│ ├── conditionalStepCapabilityValueBasedLogicHook.spec.js
│ ├── conditionalStepJsonPathBasedLogicHook.spec.js
│ ├── conditionalStepTimeBasedLogicHook.spec.js
│ ├── convos
│ │ ├── conditional_steps.convo.txt
│ │ ├── conditional_steps_business_hours.convo.txt
│ │ ├── conditional_steps_cap_value_based.convo.txt
│ │ ├── conditional_steps_followed_by_bot_msg.convo.txt
│ │ ├── conditional_steps_followed_by_me.convo.txt
│ │ ├── conditional_steps_json_path_based.convo.txt.convo.txt
│ │ ├── conditional_steps_multiple_condition_groups.convo.txt
│ │ ├── conditional_steps_multiple_condition_groups_no_assertion.convo.txt
│ │ ├── conditional_steps_multiple_mandatory_condition_groups.convo.txt
│ │ ├── conditional_steps_multiple_optional_condition_groups.convo.txt
│ │ ├── conditional_steps_time_based.convo.txt
│ │ ├── no_scripting_memory.convo.txt
│ │ ├── scripting_memory_cleared_by_logic_hook.convo.txt
│ │ ├── scripting_memory_created_by_begin.convo.txt
│ │ ├── scripting_memory_created_by_logic_hook.convo.txt
│ │ ├── scripting_memory_created_two_by_begin.convo.txt
│ │ ├── scripting_memory_from_invalidjsonpath.convo.txt
│ │ ├── scripting_memory_from_jsonpath.convo.txt
│ │ ├── scripting_memory_numbers.convo.txt
│ │ ├── scripting_memory_overwrite_and_check.convo.txt
│ │ ├── scripting_memory_overwritten_by_begin.convo.txt
│ │ ├── scripting_memory_overwritten_by_convo.convo.txt
│ │ ├── scripting_memory_overwritten_by_logic_hook.convo.txt
│ │ ├── scripting_memory_progress.convo.txt
│ │ ├── scripting_memory_reserved_word.convo.txt
│ │ ├── update_custom_me_msg_begin.convo.txt
│ │ ├── update_custom_me_msg_depth2.convo.txt
│ │ ├── update_custom_me_msg_global_simple.convo.txt
│ │ ├── update_custom_me_msg_json.convo.txt
│ │ ├── update_custom_me_msg_mixed_struct.convo.txt
│ │ ├── update_custom_me_msg_simple.convo.txt
│ │ └── update_custom_with_partial
│ │ │ ├── update_custom.pconvo.txt
│ │ │ └── update_custom_me_msg_begin.convo.txt
│ ├── customConditionalStepLogicHook.spec.js
│ ├── localvsglobal.spec.js
│ ├── pauseLogic.spec.js
│ ├── setClearScriptingMemory.spec.js
│ └── updateCustom.spec.js
├── matching
│ ├── convos
│ │ └── regex.convo.txt
│ └── matchingmode.spec.js
├── scriptingModificator.spec.js
├── scriptingProvider.spec.js
├── scriptingmemory
│ ├── convosAssertion
│ │ ├── buy.convo.txt
│ │ └── product.scriptingmemory.txt
│ ├── convosCoverageAsserters
│ │ ├── buy.convo.txt
│ │ └── product.xlsx
│ ├── convosLogicHookCollision
│ │ ├── buy.convo.txt
│ │ └── product.scriptingmemory.xlsx
│ ├── convosMultiMemory
│ │ ├── convos
│ │ │ └── buy.convo.txt
│ │ └── memory1
│ │ │ ├── available.scriptingmemory.txt
│ │ │ └── products.scriptingmemory.txt
│ ├── convosMultiMemoryCaseNameCollision
│ │ ├── buy.convo.txt
│ │ ├── products1.scriptingmemory.txt
│ │ └── products2.scriptingmemory.txt
│ ├── convosMultiMemoryDifferent
│ │ ├── available.scriptingmemory.txt
│ │ ├── buy.convo.txt
│ │ └── products.scriptingmemory.txt
│ ├── convosMultiMemoryIntersection
│ │ ├── available.scriptingmemory.txt
│ │ ├── buy.convo.txt
│ │ ├── products_and_available.scriptingmemory.txt
│ │ └── somethingelse.scriptingmemory.txt
│ ├── convosMultiMemoryNoName
│ │ ├── buy.convo.txt
│ │ └── products.scriptingmemory.txt
│ ├── convosMultiMemoryNoVariable
│ │ ├── available.scriptingmemory.txt
│ │ ├── buy.convo.txt
│ │ └── products.scriptingmemory.txt
│ ├── convosMultiMemoryNoVariableName
│ │ ├── available.scriptingmemory.txt
│ │ ├── buy.convo.txt
│ │ └── products.scriptingmemory.txt
│ ├── convosMultiMemorySame
│ │ ├── buy.convo.txt
│ │ ├── products1.scriptingmemory.txt
│ │ └── products2.scriptingmemory.txt
│ ├── convosMultiMemorySameCols
│ │ ├── buy.convo.txt
│ │ ├── products1.scriptingmemory.txt
│ │ └── products2.scriptingmemory.txt
│ ├── convosNoIntersection
│ │ ├── buy.convo.txt
│ │ └── product.xlsx
│ ├── convosOneTable
│ │ ├── buy.convo.txt
│ │ └── cases.xlsx
│ ├── convosPartial
│ │ ├── buy.convo.txt
│ │ ├── product.scriptingmemory.txt
│ │ ├── sub1.pconvo.txt
│ │ └── sub2.pconvo.txt
│ ├── convosReservedWord
│ │ ├── buy.convo.txt
│ │ └── cases.xlsx
│ ├── convosSimple
│ │ ├── buy.convo.txt
│ │ └── product.xlsx
│ ├── convosSimpleCols
│ │ ├── buy.convo.txt
│ │ └── product.scriptingmemory.txt
│ ├── convosSimpleText
│ │ ├── buy.convo.txt
│ │ └── product.scriptingmemory.txt
│ ├── convosTwoTables
│ │ ├── buy.convo.txt
│ │ ├── customer.xlsx
│ │ └── product.xlsx
│ ├── convosTwoTablesCols
│ │ ├── buy.convo.txt
│ │ ├── customer.xlsx
│ │ └── product.xlsx
│ ├── convosValueOptional
│ │ ├── buy.convo.txt
│ │ └── cases.xlsx
│ ├── extractregexp
│ │ └── regexp.convo.txt
│ ├── fillScriptingMemoryFromFile.spec.js
│ ├── quoteregexp
│ │ └── regexp.convo.txt
│ ├── regexp.spec.js
│ ├── scriptingVariablesSeveralEntries
│ │ └── buy.convo.txt
│ └── useScriptingMemoryForAssertion.spec.js
├── skipconvos
│ ├── SKIP.convo.convo.txt
│ ├── Skip-convo.convo.txt
│ ├── convo-to-skip.convo.txt
│ ├── skipnotskipt.convo.txt
│ └── sub
│ │ └── skip_it_no_header.convo.txt
├── txt
│ └── decompile.spec.js
├── userinputs
│ ├── buttonInputConvos.spec.js
│ ├── convos
│ │ ├── botium.png
│ │ ├── button.convo.txt
│ │ ├── buttonNoArg.convo.txt
│ │ ├── buttonScript.convo.txt
│ │ ├── buttonTwoArgs.convo.txt
│ │ ├── files
│ │ │ ├── botium0.png
│ │ │ ├── botium1.png
│ │ │ └── botium2.png
│ │ ├── media.convo.txt
│ │ ├── mediaNoArg.convo.txt
│ │ ├── mediaOutOfBasedir.convo.txt
│ │ ├── mediaOutOfConvoDir.convo.txt
│ │ ├── medialist.convo.txt
│ │ ├── medias.convo.txt
│ │ ├── mediawc.convo.txt
│ │ └── mediawcbasedir.convo.txt
│ ├── defaultUserInputs.spec.js
│ └── mediaInputConvos.spec.js
└── utteranceexpansion
│ ├── associateByIndex.spec.js
│ ├── convos
│ ├── associate_utterances_by_index.json
│ └── media.convo.txt
│ └── files
│ ├── step0voice0.wav
│ ├── step0voice1.wav
│ ├── step0voice2.wav
│ ├── step1voice0.wav
│ ├── step2voice0.wav
│ ├── step2voice1.wav
│ ├── step2voice2.wav
│ ├── step2voice4.wav
│ └── step2voice5.wav
├── security
├── allowUnsafe.spec.js
├── convos
│ ├── dummy.convo.txt
│ ├── media.convo.txt
│ ├── mediaasfile.convo.txt
│ └── mediawildcard.convo.txt
└── resources
│ ├── botium-asserter-as-file.js
│ ├── botium-connector-as-file.js
│ └── hook-as-file.js
└── utils.spec.js
/.eslintignore:
--------------------------------------------------------------------------------
1 | **/node_modules/*
2 | src/helpers/structjson.js
3 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "extends": ["standard", "plugin:mocha/recommended"],
3 | "env": {
4 | "mocha": true
5 | },
6 | rules: {
7 | 'mocha/no-setup-in-describe': 'warn',
8 | },
9 | }
10 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior.
15 |
16 | **Expected behavior**
17 | A clear and concise description of what you expected to happen.
18 |
19 | **Screenshots and Log files**
20 | If applicable, add screenshots and/or logfiles to help explain your problem.
21 | - [How to get logs from Botium Box](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/29360129/Enable+Diagnostics+and+Inspect+Logs)
22 | - [How to get logs from Botium Bindings](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/426128/Troubleshooting)
23 | - For Botium CLI, add the *--verbose* command line switch
24 |
25 | **Botium Flavour:**
26 | - Botium Box ?
27 | - Botium CLI ?
28 | - Botium Bindings ?
29 |
30 | **Botium Version**
31 | - Is there an exact version where this bug is happening ?
32 |
33 | **Additional context**
34 | Add any other context about the problem here.
35 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/SUPPORT.md:
--------------------------------------------------------------------------------
1 | ## How do I get help ?
2 | * Read the [Botium in a Nutshell](https://medium.com/@floriantreml/botium-in-a-nutshell-part-1-overview-f8d0ceaf8fb4) series
3 | * If you think you found a bug in Botium, please use the Github issue tracker.
4 | * The documentation on a very technical level can be found in the [Botium Wiki](https://github.com/codeforequity-at/botium-core/wiki).
5 | * For asking questions please use Stackoverflow - we are monitoring and answering questions there.
6 | * For our VIP users, there is also a Slack workspace available (coming soon).
7 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | __Pull Request addresses Issue/Bug:__
2 |
3 | What issue/bug is addressed by this pull request ?
4 |
5 | __Implemented behaviour:__
6 |
7 | What did you actually change ?
8 |
9 | __Build successful?__
10 |
11 | Is build still possible ? ("npm run build")
12 |
13 | __Unit Tests changed/added:__
14 |
15 | Have unit tests been changed or added to reflect new functionality ?
16 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 60
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 7
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - pinned
8 | - security
9 | # Label to use when marking an issue as stale
10 | staleLabel: wontfix
11 | # Comment to post when marking an issue as stale. Set to `false` to disable
12 | markComment: >
13 | This issue has been automatically marked as stale because it has not had
14 | recent activity. It will be closed if no further activity occurs. Thank you
15 | for your contributions.
16 | # Comment to post when closing a stale issue. Set to `false` to disable
17 | closeComment: false
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (http://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # Typescript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | temp
61 | botiumwork
62 | dist
63 | setEnv.sh
64 | yarn.lock
65 | botium-core.iml
66 | /.idea
67 | .vscode
68 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (http://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # Typescript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | temp
61 | botiumwork
62 |
--------------------------------------------------------------------------------
/.tern-project:
--------------------------------------------------------------------------------
1 | {
2 | "ecmaVersion": 6,
3 | "libs": [],
4 | "loadEagerly": [],
5 | "dontLoad": [
6 | "node_modules/**"
7 | ],
8 | "plugins": {
9 | "doc_comment": true
10 | }
11 | }
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | See the [Contribution Guide](https://botium-docs.readthedocs.io/) in the [Botium Docs](https://botium-docs.readthedocs.io/)
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Botium GmbH
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | BotDriver: require('./src/BotDriver'),
3 | Capabilities: require('./src/Capabilities'),
4 | Defaults: require('./src/Defaults'),
5 | Enums: require('./src/Enums'),
6 | Events: require('./src/Events'),
7 | Plugins: require('./src/Plugins'),
8 | Source: require('./src/Source'),
9 |
10 | InboundProxy: require('./src/grid/inbound/proxy'),
11 |
12 | HookUtils: require('./src/helpers/HookUtils'),
13 | TranscriptUtils: require('./src/helpers/TranscriptUtils'),
14 |
15 | RetryHelper: require('./src/helpers/RetryHelper'),
16 |
17 | BotiumMockRichMessageTypes: require('./src/mocks/BotiumMockRichMessageTypes'),
18 |
19 | BotiumError: require('./src/scripting/BotiumError').BotiumError,
20 | ScriptingConstants: require('./src/scripting/Constants'),
21 | ScriptingMemory: require('./src/scripting/ScriptingMemory'),
22 | ScriptingProvider: require('./src/scripting/ScriptingProvider'),
23 | LogicHookConstants: require('./src/scripting/logichook/LogicHookConsts'),
24 |
25 | Lib: {
26 | SimpleRestContainer: require('./src/containers/plugins/SimpleRestContainer'),
27 | tryLoadPlugin: require('./src/containers/plugins/index').tryLoadPlugin
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | import babel from 'rollup-plugin-babel'
2 | import commonjs from 'rollup-plugin-commonjs'
3 | import json from 'rollup-plugin-json'
4 |
5 | export default {
6 | input: 'index.js',
7 | output: [
8 | {
9 | file: 'dist/botium-es.js',
10 | format: 'es',
11 | sourcemap: true
12 | },
13 | {
14 | file: 'dist/botium-cjs.js',
15 | format: 'cjs',
16 | sourcemap: true
17 | }
18 | ],
19 | plugins: [
20 | commonjs({
21 | exclude: 'node_modules/**'
22 | }),
23 | json(),
24 | babel({
25 | exclude: 'node_modules/**',
26 | runtimeHelpers: true
27 | })
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/samples/connectors/custom/Readme.md:
--------------------------------------------------------------------------------
1 | To run this custom connector sample:
2 |
3 | $ npm install
4 | $ npm test
5 |
--------------------------------------------------------------------------------
/samples/connectors/custom/botium.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Custom Connector Sample",
5 | "CONTAINERMODE": "./botium-connector-myapi.js",
6 | "MYAPI_URL": "https://demo.botiumbox.com/iambotium/reply"
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/samples/connectors/custom/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "custom-connector-sample",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "test": "mocha spec",
6 | "test:debug": "DEBUG=botium* mocha spec"
7 | },
8 | "dependencies": {
9 | "botium-bindings": "latest",
10 | "mocha": "latest"
11 | },
12 | "botium": {
13 | "convodirs": [
14 | "spec/convo"
15 | ],
16 | "expandConvos": true,
17 | "expandUtterancesToConvos": false,
18 | "expandScriptingMemoryToConvos": false
19 | }
20 | }
--------------------------------------------------------------------------------
/samples/connectors/custom/spec/botium.spec.js:
--------------------------------------------------------------------------------
1 | const bb = require('botium-bindings')
2 | bb.helper.mocha().setupMochaTestSuite()
3 |
--------------------------------------------------------------------------------
/samples/connectors/custom/spec/convo/hello.convo.txt:
--------------------------------------------------------------------------------
1 | hello
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/samples/connectors/simplerest-async/Readme.md:
--------------------------------------------------------------------------------
1 | # Botium Asynchronous HTTP/JSON example
2 |
3 | For demo purposes, there is a chatbot included - it will respond with some random joke, and an additional asynchronous message will be posted afterwards to the Botium inbound endpoint.
4 |
5 | ## Using integrated Inbound Endpoint
6 |
7 | Botium Core launches an inbound endpoint with an integrated HTTP server.
8 |
9 | First, start the chatbot endpoint:
10 |
11 | node jokebot.js
12 |
13 | Then, start the Botium script, sending some input to the bot, and waiting for synchronous and asynchrous response:
14 |
15 | BOTIUM_CONFIG=botium-inbound.json node botiumFluent.js
16 |
17 | ## Using Redis Inbound Endpoint
18 |
19 | Botium CLI launches an inbound endpoint, Botium Core connects to a shared Redis topic.
20 |
21 | First start a local Redis server.
22 |
23 | Then start the inbound endpoint with Botium CLI:
24 |
25 | botium-cli inbound-proxy
26 |
27 | Then start the chatbot and connect it to the Botium CLI inbound endpoint:
28 |
29 | node jokebot.js
30 |
31 | Finally, start the Botium script
32 |
33 | BOTIUM_CONFIG=botium-redis.json node botiumFluent.js
34 |
35 | ## Using Botium Box
36 |
37 | Botium Box has an integrated inbound endpoint, which is secured with an API key. Launch the chatbot:
38 |
39 | node jokebot.js
40 |
41 | In Botium Box, register this endpoint by importing the _botium-box.json_ file. Change the "callbackUri" to contain a valid API Key from Botium Box.
42 |
--------------------------------------------------------------------------------
/samples/connectors/simplerest-async/botium-box.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Simple Rest Sample",
5 | "CONTAINERMODE": "simplerest",
6 | "SIMPLEREST_URL": "http://127.0.0.1:1234/joke",
7 | "SIMPLEREST_METHOD": "POST",
8 | "SIMPLEREST_BODY_TEMPLATE": { "conversationId": "{{botium.conversationId}}", "text": "{{msg.messageText}}", "callbackUri": "http://127.0.0.1:4000/api/inbound?APIKEY=MYAPIKEYFROMBOTIUMBOX" },
9 | "SIMPLEREST_BODY_JSONPATH": "$.responses[*]",
10 | "SIMPLEREST_RESPONSE_JSONPATH": "$.text",
11 | "SIMPLEREST_INBOUND_SELECTOR_JSONPATH": "$.body.conversationId",
12 | "SIMPLEREST_INBOUND_SELECTOR_VALUE": "{{botium.conversationId}}"
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/samples/connectors/simplerest-async/botium-inbound.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Simple Rest Sample",
5 | "CONTAINERMODE": "simplerest",
6 | "SIMPLEREST_URL": "http://127.0.0.1:1234/joke",
7 | "SIMPLEREST_METHOD": "POST",
8 | "SIMPLEREST_BODY_TEMPLATE": { "conversationId": "{{botium.conversationId}}", "text": "{{msg.messageText}}", "callbackUri": "http://127.0.0.1:1235/onemorejoke/{{botium.conversationId}}" },
9 | "SIMPLEREST_BODY_JSONPATH": "$.responses[*]",
10 | "SIMPLEREST_RESPONSE_JSONPATH": "$.text",
11 | "SIMPLEREST_INBOUND_ENDPOINT": "/onemorejoke",
12 | "SIMPLEREST_INBOUND_PORT": 1235,
13 | "SIMPLEREST_INBOUND_SELECTOR_JSONPATH": "$.body.conversationId",
14 | "SIMPLEREST_INBOUND_SELECTOR_VALUE": "{{botium.conversationId}}"
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/samples/connectors/simplerest-async/botium-redis.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Simple Rest Sample",
5 | "CONTAINERMODE": "simplerest",
6 | "SIMPLEREST_URL": "http://127.0.0.1:1234/joke",
7 | "SIMPLEREST_METHOD": "POST",
8 | "SIMPLEREST_BODY_TEMPLATE": { "conversationId": "{{botium.conversationId}}", "text": "{{msg.messageText}}", "callbackUri": "http://127.0.0.1:45100/{{botium.conversationId}}" },
9 | "SIMPLEREST_BODY_JSONPATH": "$.responses[*]",
10 | "SIMPLEREST_RESPONSE_JSONPATH": "$.text",
11 | "SIMPLEREST_INBOUND_REDISURL": "redis://127.0.0.1:6379",
12 | "SIMPLEREST_INBOUND_SELECTOR_JSONPATH": "$.body.conversationId",
13 | "SIMPLEREST_INBOUND_SELECTOR_VALUE": "{{botium.conversationId}}"
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/samples/connectors/simplerest-async/botiumFluent.js:
--------------------------------------------------------------------------------
1 | const BotDriver = require('../../../index').BotDriver
2 |
3 | const driver = new BotDriver()
4 |
5 | driver.BuildFluent()
6 | .Start()
7 | .UserSaysText('Hello')
8 | .WaitBotSaysText(console.log)
9 | .WaitBotSaysText(console.log)
10 | .WaitBotSaysText(console.log)
11 | .Stop()
12 | .Clean()
13 | .Exec()
14 | .then(() => {
15 | console.log('READY')
16 | })
17 | .catch((err) => {
18 | console.log('ERROR: ', err)
19 | })
20 |
--------------------------------------------------------------------------------
/samples/connectors/simplerest-polling/Readme.md:
--------------------------------------------------------------------------------
1 | # Botium Polling HTTP/JSON example
2 |
3 | For demo purposes, there is a chatbot included - it will respond with some random joke.
4 |
5 | ## Start Bot
6 |
7 | First, start the chatbot endpoint:
8 |
9 | node jokebot.js
10 |
11 | # Start Botium
12 |
13 | Then, start the Botium script, sending some input to the bot, and waiting for synchronous and polling response:
14 |
15 | node botiumFluent.js
16 |
--------------------------------------------------------------------------------
/samples/connectors/simplerest-polling/botium.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Simple Rest Sample",
5 | "CONTAINERMODE": "simplerest",
6 | "SIMPLEREST_URL": "http://127.0.0.1:1234/joke",
7 | "SIMPLEREST_METHOD": "POST",
8 | "SIMPLEREST_BODY_TEMPLATE": { "conversationId": "{{botium.conversationId}}", "text": "{{msg.messageText}}" },
9 | "SIMPLEREST_BODY_JSONPATH": "$.responses[*]",
10 | "SIMPLEREST_RESPONSE_JSONPATH": "$.text",
11 | "SIMPLEREST_POLL_URL": "http://127.0.0.1:1234/onemore",
12 | "SIMPLEREST_POLL_VERB": "POST",
13 | "SIMPLEREST_POLL_BODY": { "conversationId": "{{botium.conversationId}}" }
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/samples/connectors/simplerest-polling/botiumFluent.js:
--------------------------------------------------------------------------------
1 | const BotDriver = require('../../../index').BotDriver
2 |
3 | const driver = new BotDriver()
4 |
5 | driver.BuildFluent()
6 | .Start()
7 | .UserSaysText('Hello')
8 | .WaitBotSaysText(console.log)
9 | .WaitBotSaysText(console.log)
10 | .WaitBotSaysText(console.log)
11 | .Stop()
12 | .Clean()
13 | .Exec()
14 | .then(() => {
15 | console.log('READY')
16 | })
17 | .catch((err) => {
18 | console.log('ERROR: ', err)
19 | })
20 |
--------------------------------------------------------------------------------
/samples/connectors/simplerest/botium.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Simple Rest Sample",
5 | "CONTAINERMODE": "simplerest",
6 | "SIMPLEREST_URL": "https://demo.botiumbox.com/iambotium/reply",
7 | "SIMPLEREST_METHOD": "POST",
8 | "SIMPLEREST_RESPONSE_JSONPATH": "$.reply",
9 | "SIMPLEREST_BODY_TEMPLATE": { "username": "botium", "message": "{{msg.messageText}}" }
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/connectors/simplerest/botiumFluent.js:
--------------------------------------------------------------------------------
1 | const BotDriver = require('../../../index').BotDriver
2 |
3 | const driver = new BotDriver()
4 |
5 | driver.BuildFluent()
6 | .Start()
7 | .UserSaysText('Hello')
8 | .WaitBotSaysText(console.log)
9 | .UserSaysText('How are you ?')
10 | .WaitBotSaysText(console.log)
11 | .Stop()
12 | .Clean()
13 | .Exec()
14 | .then(() => {
15 | console.log('READY')
16 | })
17 | .catch((err) => {
18 | console.log('ERROR: ', err)
19 | })
20 |
--------------------------------------------------------------------------------
/samples/extensions/asserterHooks/DummyAsserter.js:
--------------------------------------------------------------------------------
1 | const utils = require('util')
2 |
3 | module.exports = class DummyAsserter {
4 | constructor (context, caps = {}) {
5 | this.context = context
6 | this.caps = caps
7 | }
8 |
9 | assertConvoBegin ({ convo, container, args }) {
10 | console.log(`Dummy asserter Begin started with those args: ${utils.inspect(args)}`)
11 | return Promise.resolve()
12 | }
13 |
14 | assertConvoStep ({ convo, convoStep, args, botMsg }) {
15 | console.log(`ConvoStep dummy assertion with those args: ${utils.inspect(args)}, botMessage: ${utils.inspect(botMsg)} ...`)
16 | return Promise.resolve()
17 | }
18 |
19 | assertConvoEnd ({ convo, container, transcript, args }) {
20 | console.log(`ConvoEnd dummy assertion with those args: ${utils.inspect(args)}, transcript: ${utils.inspect(transcript)} ...`)
21 | return Promise.resolve()
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/samples/extensions/asserterHooks/botium.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Botium Scripting Sample",
5 | "CONTAINERMODE": "watson",
6 | "WATSON_USER": "0274cb6f-3680-4cf7-bd6b-71c7f447542d",
7 | "WATSON_PASSWORD": "ZWDE5xo02sby",
8 | "WATSON_WORKSPACE_ID": "97513bc0-c581-4bec-ac9f-ea6a8ec308a9",
9 | "SCRIPTING_ENABLE_MEMORY": true,
10 | "SAFEDIR": ".",
11 | "ASSERTERS": [
12 | {
13 | "ref": "DUMMY",
14 | "src": "./DummyAsserter.js"
15 | }
16 | ]
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/samples/extensions/asserterHooks/botiumFluent.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const path = require('path')
3 | const BotDriver = require('botium-core').BotDriver
4 |
5 | console.log('Please make sure that botium-connector-watson module is installed before running this sample')
6 |
7 | const driver = new BotDriver()
8 |
9 | const scriptBuffer = fs.readFileSync(path.join(__dirname, 'convos/txt/restaurant.convo.txt'))
10 |
11 | driver.BuildFluent()
12 | .Compile(scriptBuffer, 'SCRIPTING_FORMAT_TXT')
13 | .RunScripts()
14 | .Exec()
15 | .then(() => {
16 | console.log('SUCCESS :)')
17 | })
18 | .catch((err) => {
19 | console.log('ERROR: ', err)
20 | })
21 |
--------------------------------------------------------------------------------
/samples/extensions/asserterHooks/convos/txt/restaurant.convo.txt:
--------------------------------------------------------------------------------
1 | restaurant
2 | #begin
3 | DUMMY dbUrl | dbPassword | INSERT INTO dummy(name, birthday) VALUES ('Max Mustermann', 1991-03-26);
4 |
5 | #me
6 | hi
7 |
8 | #bot
9 | Hi. It looks like a nice drive today. What would you like me to do?
10 |
11 | #me
12 | where is the next restauran
13 |
14 | #bot
15 | I understand you want me to find a location. I can find restaurants, gas stations and restrooms nearby.
16 |
17 |
18 | #me
19 | find my a restaurant
20 |
21 | #bot
22 | Of course. Do you have a specific cuisine in mind?
23 |
24 | #me
25 | pizza
26 |
27 | #bot
28 | Super! I've found $count locations for you. Which one would you like to drive to?
29 | DUMMY $count | arg2
30 | JSON_PATH $.entities[*].entity | cuisine
31 |
32 | #me
33 | 1
34 |
35 | #bot
36 | Sure! Restaurant 1 on the list gets great reviews.
37 |
38 | #bot
39 | What day/time did you want to go to the restaurant?
40 |
41 | #me
42 | 10th of january
43 |
44 | #bot
45 | OK
46 |
47 | #end
48 | DUMMY dbUrl | dbPassword | DELETE FROM dummy WHERE name='Max Mustermann';
49 |
--------------------------------------------------------------------------------
/samples/extensions/asserterHooks/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "asserterHookExample",
3 | "version": "1.0.0",
4 | "description": "Example of implementation and usage of botium asserters",
5 | "main": "botiumFluent.js",
6 | "scripts": {
7 | "start": "node botiumFluent.js",
8 | "start:dev": "DEBUG=* node botiumFluent.js"
9 | },
10 | "repository": "https://github.com/codeforequity-at/botium-core",
11 | "author": "Stefan Sevelda",
12 | "license": "MIT",
13 | "dependencies": {
14 | "botium-connector-watson": "latest",
15 | "botium-core": "latest"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/samples/extensions/logichooks/botium.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Botium Logichooks Sample",
5 | "CONTAINERMODE": "echo",
6 | "SAFEDIR": ".",
7 | "ASSERTERS": [
8 | {
9 | "ref": "MYASSERTER",
10 | "src": "./custom/MyAsserter.js",
11 | "global": true
12 | },
13 | {
14 | "ref": "INLINEASSERTER",
15 | "global": true
16 | }
17 | ]
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/samples/extensions/logichooks/convos/echo.convo.txt:
--------------------------------------------------------------------------------
1 | Logic Hooks Sample
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 |
8 | #me
9 | Hello again!
10 | PAUSE 1000
11 |
12 | #bot
13 |
14 |
--------------------------------------------------------------------------------
/samples/extensions/logichooks/custom/MyAsserter.js:
--------------------------------------------------------------------------------
1 | const utils = require('util')
2 |
3 | module.exports = class MyAsserter {
4 | constructor (context, caps = {}) {
5 | this.context = context
6 | this.caps = caps
7 | }
8 |
9 | assertConvoBegin ({ convo, container, args }) {
10 | console.log(`MyAsserter assertConvoBegin: ${convo.header.name}`)
11 | return Promise.resolve()
12 | }
13 |
14 | assertConvoStep ({ convo, convoStep, args, botMsg }) {
15 | console.log(`MyAsserter assertConvoStep, botMessage: ${utils.inspect(botMsg)} ...`)
16 | return Promise.resolve()
17 | }
18 |
19 | assertConvoEnd ({ convo, container, transcript, args }) {
20 | console.log(`MyAsserter assertConvoEnd ${convo.header.name}, transcript: ${utils.inspect(transcript)} ...`)
21 | return Promise.resolve()
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/samples/postman/README.md:
--------------------------------------------------------------------------------
1 | # Botium Grid Sample
2 |
3 | Before running one of these samples, please start the Botium Agent
4 | * either with botium-cli
5 | * or with botium-core - "npm run agent" in source directory
6 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/Book1.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/samples/scripting/convofiles/Book1.xlsx
--------------------------------------------------------------------------------
/samples/scripting/convofiles/botium.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Botium Scripting Sample",
5 | "CONTAINERMODE": "watson",
6 | "WATSON_USER": "0274cb6f-3680-4cf7-bd6b-71c7f447542d",
7 | "WATSON_PASSWORD": "ZWDE5xo02sby",
8 | "WATSON_WORKSPACE_ID": "97513bc0-c581-4bec-ac9f-ea6a8ec308a9"
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/botiumFluent.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const path = require('path')
3 | const BotDriver = require('../../../index').BotDriver
4 |
5 | console.log('Please make sure that botium-connector-watson module is installed before running this sample')
6 |
7 | function assert (botresponse, tomatch, stepTag) {
8 | console.log(`${stepTag}: BOTRESPONSE "${botresponse}", EXPECTED "${tomatch}"`)
9 | }
10 | function fail (err) {
11 | console.log(`ERROR: <${err}>`)
12 | throw err
13 | }
14 |
15 | const driver = new BotDriver()
16 |
17 | const scriptBuffer = fs.readFileSync(path.join(__dirname, 'convos/txt/restaurant.convo.txt'))
18 |
19 | const compiler = driver.BuildCompiler()
20 | const convos = compiler.Compile(scriptBuffer, 'SCRIPTING_FORMAT_TXT')
21 | const decompiledscript = compiler.Decompile(convos, 'SCRIPTING_FORMAT_TXT')
22 | console.log(decompiledscript)
23 |
24 | driver.BuildFluent()
25 | .Compile(scriptBuffer, 'SCRIPTING_FORMAT_TXT')
26 | .RunScripts(assert, fail)
27 | .Exec()
28 | .then(() => {
29 | console.log('READY')
30 | })
31 | .catch((err) => {
32 | console.log('ERROR: ', err)
33 | })
34 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/botiumFluentMemory.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const path = require('path')
3 | const BotDriver = require('../../../index').BotDriver
4 | const Capabilities = require('../../../index').Capabilities
5 |
6 | console.log('Please make sure that botium-connector-watson module is installed before running this sample')
7 |
8 | function assert (botresponse, tomatch, stepTag) {
9 | console.log(`${stepTag}: BOTRESPONSE "${botresponse}", EXPECTED "${tomatch}"`)
10 | }
11 | function fail (err) {
12 | console.log(`ERROR: <${err}>`)
13 | throw err
14 | }
15 |
16 | const driver = new BotDriver()
17 | .setCapability(Capabilities.SCRIPTING_ENABLE_MEMORY, true)
18 |
19 | const scriptBuffer = fs.readFileSync(path.join(__dirname, '/convos/memory/restaurant.convo.txt'))
20 |
21 | driver.BuildFluent()
22 | .Compile(scriptBuffer, 'SCRIPTING_FORMAT_TXT')
23 | .RunScripts(assert, fail)
24 | .Exec()
25 | .then(() => {
26 | console.log('READY')
27 | })
28 | .catch((err) => {
29 | console.log('ERROR: ', err)
30 | })
31 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/botiumFluentXlsx.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const path = require('path')
3 | const BotDriver = require('../../../index').BotDriver
4 | const Capabilities = require('../../../index').Capabilities
5 |
6 | console.log('Please make sure that botium-connector-watson module is installed before running this sample')
7 |
8 | const driver = new BotDriver()
9 |
10 | const script = fs.readFileSync(path.join(__dirname, 'Book1.xlsx'))
11 |
12 | const convos = driver.BuildCompiler().Compile(script, 'SCRIPTING_FORMAT_XSLX')
13 | console.log(`${convos}`)
14 |
15 | const xlsx = driver.BuildCompiler().Decompile(convos, 'SCRIPTING_FORMAT_XSLX')
16 | fs.writeFileSync('tmp.xlsx', xlsx)
17 |
18 | const script1 = fs.readFileSync(path.join(__dirname, 'tmp.xlsx'))
19 |
20 | const convos1 = driver.BuildCompiler().Compile(script1, 'SCRIPTING_FORMAT_XSLX')
21 | console.log(`${convos1}`)
22 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/botiumFluentXlsxUtt.js:
--------------------------------------------------------------------------------
1 | const BotDriver = require('../../../index').BotDriver
2 | const Capabilities = require('../../../index').Capabilities
3 |
4 | console.log('Please make sure that botium-connector-watson module is installed before running this sample')
5 |
6 | const driver = new BotDriver()
7 | .setCapability(Capabilities.SCRIPTING_ENABLE_MEMORY, true)
8 |
9 | driver.BuildFluent()
10 | .ReadScripts('convos')
11 | .RunScripts()
12 | .Exec()
13 | .then(() => {
14 | console.log('READY')
15 | })
16 | .catch((err) => {
17 | console.log('ERROR: ', err)
18 | })
19 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/convos/memory/restaurant.convo.txt:
--------------------------------------------------------------------------------
1 | restaurant
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 | HELLO
8 |
9 | #me
10 | where is the next restauran
11 |
12 | #bot
13 | I understand you want me to find a location. I can find restaurants, gas stations and restrooms nearby.
14 |
15 | #me
16 | find my a restaurant
17 |
18 | #bot
19 | Of course. Do you have a specific cuisine in mind?
20 |
21 | #me
22 | pizza
23 |
24 | #bot
25 | Super! I've found $count locations for you. Which one would you like to drive to?
26 |
27 | #me
28 | $count
29 |
30 | #bot
31 | Sure! Restaurant $count on the list gets great reviews.
32 |
33 | #bot
34 | What day/time did you want to go to the restaurant?
35 |
36 | #me
37 | 10th of january
38 |
39 | #bot
40 | OK
41 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/convos/txt/hello.utterances.txt:
--------------------------------------------------------------------------------
1 | HELLO
2 | hi
3 | hello
4 | nice day
5 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/convos/txt/restaurant.convo.txt:
--------------------------------------------------------------------------------
1 | restaurant
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 | HELLO
8 |
9 | #me
10 | where is the next restauran
11 |
12 | #bot
13 | I understand you want me to find a location. I can find restaurants, gas stations and restrooms nearby.
14 |
15 | #me
16 | find my a restaurant
17 |
18 | #bot
19 | Of course. Do you have a specific cuisine in mind?
20 |
21 | #me
22 | pizza
23 |
24 | #bot
25 | Super! I've found 5 locations for you. Which one would you like to drive to?
26 |
27 | #me
28 | 1
29 |
30 | #bot
31 | Sure! Restaurant 1 on the list gets great reviews.
32 |
33 | #bot
34 | What day/time did you want to go to the restaurant?
35 | PAUSE 1000
36 |
37 | #me
38 | 10th of january
39 |
40 | #bot
41 | OK
42 |
--------------------------------------------------------------------------------
/samples/scripting/convofiles/convos/xlsx/Book2.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/samples/scripting/convofiles/convos/xlsx/Book2.xlsx
--------------------------------------------------------------------------------
/samples/scripting/convofiles/helloworld.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/samples/scripting/convofiles/helloworld.xlsx
--------------------------------------------------------------------------------
/samples/scripting/convofiles/helloworldQestionAnswer.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/samples/scripting/convofiles/helloworldQestionAnswer.xlsx
--------------------------------------------------------------------------------
/samples/scripting/utterances/.gitignore:
--------------------------------------------------------------------------------
1 | botium-utterances-master
2 |
--------------------------------------------------------------------------------
/samples/scripting/utterances/botiumFluent.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | const BotDriver = require('../../../index').BotDriver
4 | const Capabilities = require('../../../index').Capabilities
5 | const Source = require('../../../index').Source
6 |
7 | console.log('Please make sure that botium-connector-dialogflow module is installed before running this sample')
8 |
9 | const driver = new BotDriver()
10 |
11 | if (!fs.existsSync('botium-utterances-master')) {
12 | console.log('Please download botium-utterances package from https://github.com/codeforequity-at/botium-utterances and unpack it here.')
13 | process.exit(1)
14 | }
15 |
16 | driver.BuildFluent()
17 | .ReadScripts('botium-utterances-master/shared', '**/+(INCOMPREHENSION.en.utterances.txt)')
18 | .ReadScripts('botium-utterances-master/convos/joke')
19 | .Call((f) => console.log('Convos read: ' + f.compiler.convos.length))
20 | .Call((f) => f.compiler.ExpandConvos())
21 | .Call((f) => console.log('Convos expanded: ' + f.compiler.convos.length))
22 | .Start()
23 | .RunScripts()
24 | .Stop()
25 | .Exec()
26 | .then(() => {
27 | console.log('READY')
28 | })
29 | .catch((err) => {
30 | console.log('ERROR: ', err)
31 | })
32 |
--------------------------------------------------------------------------------
/samples/scripting/utterances/botiumProcessUtterances.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | const BotDriver = require('../../index').BotDriver
4 | const Capabilities = require('../../index').Capabilities
5 | const Source = require('../../index').Source
6 |
7 | console.log('Please make sure that botium-connector-dialogflow module is installed before running this sample')
8 |
9 | const driver = new BotDriver()
10 |
11 | if (!fs.existsSync('botium-utterances-master')) {
12 | console.log('Please download botium-utterances package from https://github.com/codeforequity-at/botium-utterances and unpack it here.')
13 | process.exit(1)
14 | }
15 |
16 | driver.BuildFluent()
17 | .ReadScripts('botium-utterances-master/shared', '**/+(INCOMPREHENSION.en.utterances.txt)')
18 | .ReadScripts('botium-utterances-master/convos/joke', '**/*.en.utterances.txt')
19 | .Call((f) => f.compiler.ExpandUtterancesToConvos())
20 | .Call((f) => console.log('Utterances expanded: ' + f.compiler.convos.length))
21 | .Start()
22 | .RunScripts()
23 | .Stop()
24 | .Exec()
25 | .then(() => {
26 | console.log('READY')
27 | })
28 | .catch((err) => {
29 | console.log('ERROR: ', err)
30 | })
31 |
--------------------------------------------------------------------------------
/src/Commands.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | BUILD_CONTAINER: 'BUILD_CONTAINER',
3 | START_CONTAINER: 'START_CONTAINER',
4 | SENDTOBOT: 'SENDTOBOT',
5 | STOP_CONTAINER: 'STOP_CONTAINER',
6 | CLEAN_CONTAINER: 'CLEAN_CONTAINER'
7 | }
8 |
--------------------------------------------------------------------------------
/src/Enums.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | E_SCRIPTING_MEMORY_COLUMN_MODE: {
3 | VARNAMES: 'varnames',
4 | TESTCASENAMES: 'testcasenames'
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Events.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // Botium Events
3 | CONTAINER_BUILDING: 'CONTAINER_BUILDING',
4 | CONTAINER_BUILT: 'CONTAINER_BUILT',
5 | CONTAINER_BUILD_ERROR: 'CONTAINER_BUILD_ERROR',
6 | CONTAINER_STARTING: 'CONTAINER_STARTING',
7 | CONTAINER_STARTED: 'CONTAINER_STARTED',
8 | CONTAINER_START_ERROR: 'CONTAINER_START_ERROR',
9 | CONTAINER_STOPPING: 'CONTAINER_STOPPING',
10 | CONTAINER_STOPPED: 'CONTAINER_STOPPED',
11 | CONTAINER_STOP_ERROR: 'CONTAINER_STOP_ERROR',
12 | CONTAINER_CLEANING: 'CONTAINER_CLEANING',
13 | CONTAINER_CLEANED: 'CONTAINER_CLEANED',
14 | CONTAINER_CLEAN_ERROR: 'CONTAINER_CLEAN_ERROR',
15 | BOT_CONNECTED: 'BOT_CONNECTED',
16 | CONVO_STEP_NEXT: 'CONVO_STEP_NEXT',
17 | // Chatbot Events
18 | MESSAGE_SENTTOBOT: 'MESSAGE_SENTTOBOT',
19 | MESSAGE_SENDTOBOT_ERROR: 'MESSAGE_SENDTOBOT_ERROR',
20 | MESSAGE_RECEIVEDFROMBOT: 'MESSAGE_RECEIVEDFROMBOT',
21 | MESSAGE_RECEIVEFROMBOT_ERROR: 'MESSAGE_RECEIVEFROMBOT_ERROR',
22 | MESSAGE_ATTACHMENT: 'MESSAGE_ATTACHMENT',
23 | MESSAGE_TRANSCRIPT: 'MESSAGE_TRANSCRIPT',
24 | // Botium Agent Events
25 | TOOMUCHWORKERS_ERROR: 'TOOMUCHWORKERS_ERROR'
26 | }
27 |
--------------------------------------------------------------------------------
/src/Source.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | LOCALPATH: 'LOCALPATH',
3 | GITPATH: 'GITPATH',
4 | GITURL: 'GITURL',
5 | GITBRANCH: 'GITBRANCH',
6 | GITDIR: 'GITDIR',
7 | GITPREPARECMD: 'GITPREPARECMD'
8 | }
9 |
--------------------------------------------------------------------------------
/src/containers/InProcessContainer.js:
--------------------------------------------------------------------------------
1 | const Events = require('../Events')
2 | const BaseContainer = require('./BaseContainer')
3 | const BotiumMockMessage = require('../mocks/BotiumMockMessage')
4 |
5 | module.exports = class InProcessContainer extends BaseContainer {
6 | UserSaysImpl (mockMsg) {
7 | this.eventEmitter.emit(Events.MESSAGE_SENTTOBOT, this, mockMsg)
8 | return Promise.resolve(this)
9 | }
10 |
11 | InjectBotSays (botMsg) {
12 | this._QueueBotSays(new BotiumMockMessage(botMsg))
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/grid/agent/swaggerDef.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "title": "Botium Agent API",
4 | "version": "1.0.0",
5 | "description": "Botium Agent API to be used with Postman, Tosca or any other 3rd party test runner"
6 | },
7 | "basePath": "/"
8 | }
9 |
--------------------------------------------------------------------------------
/src/helpers/QueueTimeoutError.js:
--------------------------------------------------------------------------------
1 | const { formatTimeout } = require('./Utils')
2 |
3 | module.exports = class QueueTimeoutError extends Error {
4 | constructor (timeoutMillis) {
5 | super(`Bot did not respond within ${formatTimeout(timeoutMillis)}`)
6 | this.timeoutMillis = timeoutMillis
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/helpers/SafeFileCopy.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | module.exports = (src, dest) => {
4 | return new Promise((resolve, reject) => {
5 | fs.readFile(src, (err, data) => {
6 | if (err) return reject(new Error(`read file ${src} failed: ${err}`))
7 | fs.writeFile(dest, data, (err) => {
8 | if (err) return reject(new Error(`write file ${dest} failed: ${err}`))
9 | resolve()
10 | })
11 | })
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/src/helpers/TranscriptUtils.js:
--------------------------------------------------------------------------------
1 | const _ = require('lodash')
2 |
3 | module.exports.hasWaitForBotTimeout = (transciptError) => {
4 | if (!transciptError) {
5 | return false
6 | }
7 | const str = transciptError.message || (_.isString(transciptError) ? transciptError : null)
8 | if (!str) {
9 | return false
10 | }
11 | return str.indexOf(': error waiting for bot - Bot did not respond within') > 0
12 | }
13 |
--------------------------------------------------------------------------------
/src/mocks/BotiumMockAttachment.js:
--------------------------------------------------------------------------------
1 | module.exports = class BotiumMockAttachment {
2 | constructor (fromJson = {}) {
3 | this.name = fromJson.name
4 | this.mimeType = fromJson.mimeType
5 | this.base64 = fromJson.base64
6 | this.href = fromJson.href
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/mocks/BotiumMockCommand.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | MOCKCMD_SENDTOBOT: 'MOCKCMD_SENDTOBOT',
3 | MOCKCMD_RECEIVEDFROMBOT: 'MOCKCMD_RECEIVEDFROMBOT'
4 | }
5 |
--------------------------------------------------------------------------------
/src/mocks/BotiumMockScripting.js:
--------------------------------------------------------------------------------
1 | const _ = require('lodash')
2 |
3 | class BotiumMockAsserter {
4 | constructor (fromJson = {}) {
5 | this.name = fromJson.name
6 | this.args = _.cloneDeep(fromJson.args)
7 | this.not = fromJson.not
8 | }
9 | }
10 | class BotiumMockUserInput {
11 | constructor (fromJson = {}) {
12 | this.name = fromJson.name
13 | this.args = _.cloneDeep(fromJson.args)
14 | }
15 | }
16 | class BotiumMockLogicHook {
17 | constructor (fromJson = {}) {
18 | this.name = fromJson.name
19 | this.args = _.cloneDeep(fromJson.args)
20 | }
21 | }
22 |
23 | module.exports = {
24 | BotiumMockAsserter,
25 | BotiumMockUserInput,
26 | BotiumMockLogicHook
27 | }
28 |
--------------------------------------------------------------------------------
/src/repos/BaseRepo.js:
--------------------------------------------------------------------------------
1 | module.exports = class BaseRepo {
2 | constructor (tempDirectory, sources) {
3 | this.tempDirectory = tempDirectory
4 | this.sources = Object.assign({}, sources)
5 | this.workingDirectory = null
6 | }
7 |
8 | Validate () {
9 | return Promise.resolve()
10 | }
11 |
12 | Prepare () {
13 | return Promise.resolve()
14 | }
15 |
16 | _AssertSourceExists (source) {
17 | if (!this.sources[source]) {
18 | throw new Error(`Source property ${source} not set`)
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/repos/LocalRepo.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const path = require('path')
3 | const Source = require('../Source')
4 | const BaseRepo = require('./BaseRepo')
5 |
6 | module.exports = class LocalRepo extends BaseRepo {
7 | Validate () {
8 | return super.Validate().then(() => {
9 | this._AssertSourceExists(Source.LOCALPATH)
10 |
11 | const checkPath = this.sources[Source.LOCALPATH]
12 | fs.stat(checkPath, (err, stats) => {
13 | if (err) {
14 | throw new Error(`${checkPath} not available: ${err}`)
15 | }
16 | if (stats.isDirectory() && !stats.isSymbolicLink()) {
17 | fs.access(checkPath, fs.constants.W_OK, (err1) => {
18 | if (err) {
19 | throw new Error(`${checkPath} not writeable: ${err}`)
20 | }
21 | })
22 | } else {
23 | throw new Error(`${checkPath} not a regular directory`)
24 | }
25 | })
26 | })
27 | }
28 |
29 | Prepare () {
30 | // No need to prepare anything
31 | this.workingDirectory = path.resolve(this.sources[Source.LOCALPATH])
32 | return Promise.resolve()
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/repos/NoRepo.js:
--------------------------------------------------------------------------------
1 | const BaseRepo = require('./BaseRepo')
2 |
3 | module.exports = class NoRepo extends BaseRepo {
4 | Validate () {
5 | return super.Validate()
6 | }
7 |
8 | Prepare () {
9 | return super.Prepare()
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/scripting/CompilerJson.js:
--------------------------------------------------------------------------------
1 | const CompilerObjectBase = require('./CompilerObjectBase')
2 | const { convoStepToObject } = require('./helper')
3 |
4 | module.exports = class CompilerJson extends CompilerObjectBase {
5 | constructor (context, caps = {}) {
6 | super(context, caps)
7 | }
8 |
9 | Deserialize (scriptData) {
10 | return JSON.parse(scriptData)
11 | }
12 |
13 | Decompile (convos) {
14 | const result = convos.map(convo => ({
15 | name: convo.header.name,
16 | description: convo.header.description,
17 | steps: convo.conversation.map(set => ({
18 | [set.sender]: convoStepToObject(set)
19 | }))
20 | }))
21 | return JSON.stringify({ convos: result }, null, 2)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/scripting/CompilerYaml.js:
--------------------------------------------------------------------------------
1 | const YAML = require('yaml')
2 |
3 | const CompilerObjectBase = require('./CompilerObjectBase')
4 | module.exports = class CompilerYaml extends CompilerObjectBase {
5 | constructor (context, caps = {}) {
6 | super(context, caps)
7 | }
8 |
9 | Deserialize (scriptData) {
10 | return YAML.parse(scriptData)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scripting/Constants.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | SCRIPTING_FORMAT_XSLX: 'SCRIPTING_FORMAT_XSLX',
3 | SCRIPTING_FORMAT_TXT: 'SCRIPTING_FORMAT_TXT',
4 | SCRIPTING_FORMAT_YAML: 'SCRIPTING_FORMAT_YAML',
5 | SCRIPTING_FORMAT_JSON: 'SCRIPTING_FORMAT_JSON',
6 | SCRIPTING_FORMAT_CSV: 'SCRIPTING_FORMAT_CSV',
7 | SCRIPTING_FORMAT_MARKDOWN: 'SCRIPTING_FORMAT_MARKDOWN',
8 | SCRIPTING_TYPE_CONVO: 'SCRIPTING_TYPE_CONVO',
9 | SCRIPTING_TYPE_PCONVO: 'SCRIPTING_TYPE_PCONVO',
10 | SCRIPTING_TYPE_UTTERANCES: 'SCRIPTING_TYPE_UTTERANCES',
11 | SCRIPTING_TYPE_SCRIPTING_MEMORY: 'SCRIPTING_TYPE_SCRIPTING_MEMORY'
12 | }
13 |
--------------------------------------------------------------------------------
/src/scripting/Utterance.js:
--------------------------------------------------------------------------------
1 | const util = require('util')
2 | const _ = require('lodash')
3 |
4 | module.exports = class Utterance {
5 | constructor (fromJson = {}) {
6 | this.name = fromJson.name
7 | this.sourceTag = fromJson.sourceTag
8 | this.utterances = []
9 | if (fromJson.utterances && _.isArray(fromJson.utterances)) {
10 | this.utterances = fromJson.utterances
11 | } else if (fromJson.utterances) {
12 | this.utterances.push(fromJson.utterances)
13 | }
14 | }
15 |
16 | toString () { return this.name + (this.sourceTag ? ` (${util.inspect(this.sourceTag)})` : '') + ': ' + this.utterances.join('|') }
17 | }
18 |
--------------------------------------------------------------------------------
/src/scripting/logichook/PauseLogic.js:
--------------------------------------------------------------------------------
1 | const { BotiumError } = require('../BotiumError')
2 |
3 | module.exports.pause = (source, ref, args) => {
4 | if (!args || args.length < 1) {
5 | return Promise.reject(new BotiumError(`${ref}: ${source} Missing argument"`,
6 | {
7 | type: 'asserter',
8 | subtype: 'wrong parameters',
9 | source,
10 | cause: { args }
11 | }
12 | ))
13 | }
14 | if (args.length > 1) {
15 | return Promise.reject(new BotiumError(`${ref}: ${source} Too much argument"`,
16 | {
17 | type: 'asserter',
18 | subtype: 'wrong parameters',
19 | source,
20 | cause: { args }
21 | }
22 | ))
23 | }
24 |
25 | const parsed = Number(args[0])
26 | if (parseInt(parsed, 10) !== parsed) {
27 | return Promise.reject(new BotiumError(`${ref}: ${source} Wrong argument. It must be integer "${args[0]}""`,
28 | {
29 | type: 'asserter',
30 | subtype: 'wrong parameters',
31 | source,
32 | cause: { args }
33 | }
34 | ))
35 | }
36 |
37 | return new Promise(resolve => setTimeout(resolve, parsed))
38 | }
39 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/BotRepliesConsumedAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseCountAsserter = require('./BaseCountAsserter')
2 |
3 | module.exports = class BotRepliesConsumedAsserter extends BaseCountAsserter {
4 | constructor (context, caps = {}) {
5 | super(context, caps, 'BotReplies')
6 | this.name = 'Bot Replies Consumed Asserter'
7 | }
8 |
9 | async _getCount (argv) { return argv.container._QueueLength() }
10 | _evalArgs (argv) {
11 | argv.args = ['=0']
12 | }
13 |
14 | _getBotiumErrMsg (argv, not, count, check) {
15 | const { convoStep } = argv
16 | if (not) {
17 | return `${convoStep.stepTag}: There is no unread bot reply in queue`
18 | } else {
19 | return count === 1 ? `${convoStep.stepTag}: There is an unread bot reply in queue` : `${convoStep.stepTag}: There are still ${count} unread bot replies in queue`
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/BotRepliesUnconsumedCountAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseCountAsserter = require('./BaseCountAsserter')
2 |
3 | module.exports = class BotRepliesUnconsumedCountAsserter extends BaseCountAsserter {
4 | constructor (context, caps = {}) {
5 | super(context, caps, 'unconsumed bot replies')
6 | this.name = 'Bot Replies Unconsumed Count Asserter'
7 | }
8 |
9 | async _getCount (argv) { return argv.container._QueueLength() }
10 | }
11 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/ButtonsCountAsserter.js:
--------------------------------------------------------------------------------
1 | const { buttonsFromMsg } = require('../helpers')
2 | const BaseCountAsserter = require('./BaseCountAsserter')
3 |
4 | const _buttonsCount = ({ botMsg }) => {
5 | return buttonsFromMsg(botMsg, false).length
6 | }
7 |
8 | module.exports = class ButtonsCountAsserter extends BaseCountAsserter {
9 | constructor (context, caps = {}) {
10 | super(context, caps, 'Buttons')
11 | this.name = 'Buttons Count Asserter'
12 | }
13 |
14 | async _getCount (argv) { return _buttonsCount(argv) }
15 | }
16 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/ButtonsCountRecAsserter.js:
--------------------------------------------------------------------------------
1 | const { buttonsFromMsg } = require('../helpers')
2 | const BaseCountAsserter = require('./BaseCountAsserter')
3 |
4 | const _buttonsCount = ({ botMsg }) => {
5 | return buttonsFromMsg(botMsg, true).length || 0
6 | }
7 |
8 | module.exports = class ButtonsCountRecAsserter extends BaseCountAsserter {
9 | constructor (context, caps = {}) {
10 | super(context, caps, 'Buttons')
11 | this.name = 'Buttons Count (recursive) Asserter'
12 | }
13 |
14 | async _getCount (argv) { return _buttonsCount(argv) }
15 | }
16 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/CardsCountAsserter.js:
--------------------------------------------------------------------------------
1 | const { cardsFromMsg } = require('../helpers')
2 | const BaseCountAsserter = require('./BaseCountAsserter')
3 |
4 | const _cardsCount = ({ botMsg }) => {
5 | return cardsFromMsg(botMsg, false).length
6 | }
7 |
8 | module.exports = class CardsCountAsserter extends BaseCountAsserter {
9 | constructor (context, caps = {}) {
10 | super(context, caps, 'Cards')
11 | this.name = 'Cards Count Asserter'
12 | }
13 |
14 | async _getCount (argv) { return _cardsCount(argv) }
15 | }
16 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/CardsCountRecAsserter.js:
--------------------------------------------------------------------------------
1 | const { cardsFromMsg } = require('../helpers')
2 | const BaseCountAsserter = require('./BaseCountAsserter')
3 |
4 | const _cardsCount = ({ botMsg }) => {
5 | return cardsFromMsg(botMsg, true).length
6 | }
7 |
8 | module.exports = class CardsCountRecAsserter extends BaseCountAsserter {
9 | constructor (context, caps = {}) {
10 | super(context, caps, 'Cards')
11 | this.name = 'Cards Count (recursive) Asserter'
12 | }
13 |
14 | async _getCount (argv) { return _cardsCount(argv) }
15 | }
16 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/JsonPathCountAsserter.js:
--------------------------------------------------------------------------------
1 | const jsonPath = require('jsonpath')
2 | const { BotiumError } = require('../../BotiumError')
3 | const BaseCountAsserter = require('./BaseCountAsserter')
4 |
5 | const _jsonPathCount = ({ botMsg, args }) => {
6 | const jsonPathValues = jsonPath.query(botMsg.sourceData, args[0])
7 | if (jsonPathValues.length === 0) return 0
8 | else return jsonPathValues[0].length
9 | }
10 |
11 | module.exports = class JsonPathCountAsserter extends BaseCountAsserter {
12 | constructor (context, caps = {}) {
13 | super(context, caps, 'JsonPath', 1)
14 | this.name = 'JsonPath Count Asserter'
15 | }
16 |
17 | async _getCount (argv) { return _jsonPathCount(argv) }
18 |
19 | _evalArgs (argv) {
20 | const { args, convoStep } = argv
21 |
22 | if (!args || args.length < 1 || args.length > 2) {
23 | throw new BotiumError(`${convoStep.stepTag}: ${this.name} 1 or 2 arguments expected "${args}"`,
24 | {
25 | type: 'asserter',
26 | subtype: 'wrong parameters',
27 | source: this.name,
28 | cause: {
29 | args
30 | }
31 | }
32 | )
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/MediaCountAsserter.js:
--------------------------------------------------------------------------------
1 | const { mediaFromMsg } = require('../helpers')
2 | const BaseCountAsserter = require('./BaseCountAsserter')
3 |
4 | const _mediaCount = ({ botMsg }) => {
5 | return mediaFromMsg(botMsg, false).length
6 | }
7 |
8 | module.exports = class MediaCountAsserter extends BaseCountAsserter {
9 | constructor (context, caps = {}) {
10 | super(context, caps, 'Media')
11 | this.name = 'Media Attachment Count Asserter'
12 | }
13 |
14 | async _getCount (argv) { return _mediaCount(argv) }
15 | }
16 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/MediaCountRecAsserter.js:
--------------------------------------------------------------------------------
1 | const { mediaFromMsg } = require('../helpers')
2 | const BaseCountAsserter = require('./BaseCountAsserter')
3 |
4 | const _mediaCount = ({ botMsg }) => {
5 | return mediaFromMsg(botMsg, true).length || 0
6 | }
7 |
8 | module.exports = class MediaCountRecAsserter extends BaseCountAsserter {
9 | constructor (context, caps = {}) {
10 | super(context, caps, 'Media')
11 | this.name = 'Media Count (recursive) Asserter'
12 | }
13 |
14 | async _getCount (argv) { return _mediaCount(argv) }
15 | }
16 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/PauseAsserter.js:
--------------------------------------------------------------------------------
1 | const pause = require('../PauseLogic').pause
2 |
3 | module.exports = class PauseAsserter {
4 | constructor (context, caps = {}) {
5 | this.context = context
6 | this.caps = caps
7 | this.name = 'Pause Asserter'
8 | }
9 |
10 | assertConvoBegin ({ convo, args }) {
11 | return pause('PauseAsserter', convo.sourceTag, args)
12 | }
13 |
14 | assertConvoEnd ({ convo, args }) {
15 | return pause('PauseAsserter', convo.sourceTag, args)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextContainsAllAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextContainsAllAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.include(false), 'all')
7 | this.name = 'Text Contains All Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextContainsAllICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextContainsAllICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.include(true), 'all')
7 | this.name = 'Text Contains All (ignore case) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextContainsAnyAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextContainsAnyAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.include(false), 'any')
7 | this.name = 'Text Contains Any Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextContainsAnyICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextContainsAnyICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.include(true), 'any')
7 | this.name = 'Text Contains Any (ignore case) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextEqualsAnyAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextEqualsAnyAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.equals(false), 'any', true)
7 | this.name = 'Text Equals Any Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextEqualsAnyICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextEqualsAnyICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.equals(true), 'any', true)
7 | this.name = 'Text Equals Any (ignore case) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextRegexpAllAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextRegexpAllAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.regexp(false), 'all')
7 | this.name = 'Text Regexp All Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextRegexpAllICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextRegexpAllICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.regexp(true), 'all')
7 | this.name = 'Text Regexp All (ignore all) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextRegexpAnyAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextRegexpAnyAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.regexp(false), 'any')
7 | this.name = 'Text Regexp Any Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextRegexpAnyICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextRegexpAnyICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.regexp(true), 'any')
7 | this.name = 'Text Regexp Any (ignore case) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextWildcardAllAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextWildcardAllAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.wildcard(false), 'all')
7 | this.name = 'Text Wildcard All Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextWildcardAllICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextWildcardAllICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.wildcard(true), 'all')
7 | this.name = 'Text Wildcard All (ignore case) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextWildcardAnyAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextWildcardAnyAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.wildcard(false), 'any')
7 | this.name = 'Text Wildcard Any Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextWildcardAnyICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextWildcardAnyICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.wildcard(true), 'any')
7 | this.name = 'Text Wildcard Any (ignore case) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextWildcardExactAllAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextWildcardExactAllAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.wildcardExact(false), 'all')
7 | this.name = 'Text Wildcard Exact All Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextWildcardExactAllICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextWildcardExactAllICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.wildcardExact(true), 'all')
7 | this.name = 'Text Wildcard Exact All (ignore) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextWildcardExactAnyAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextWildcardExactAnyAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.wildcardExact(false), 'any')
7 | this.name = 'Text Wildcard Exact Any Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/asserter/TextWildcardExactAnyICAsserter.js:
--------------------------------------------------------------------------------
1 | const BaseTextAsserter = require('./BaseTextAsserter')
2 | const MatchFunctions = require('../../MatchFunctions')
3 |
4 | module.exports = class TextWildcardExactAnyICAsserter extends BaseTextAsserter {
5 | constructor (context, caps = {}) {
6 | super(context, caps, MatchFunctions.wildcardExact(true), 'any')
7 | this.name = 'Text Wildcard Exact Any (ignore case) Asserter'
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scripting/logichook/logichooks/ClearQueueLogicHook.js:
--------------------------------------------------------------------------------
1 | module.exports = class ClearQueueLogicHook {
2 | constructor (context, caps = {}) {
3 | this.context = context
4 | this.caps = caps
5 | }
6 |
7 | onConvoBegin ({ container }) {
8 | container._EmptyQueue()
9 | }
10 |
11 | onMeStart ({ container }) {
12 | container._EmptyQueue()
13 | }
14 |
15 | onBotEnd ({ container }) {
16 | container._EmptyQueue()
17 | }
18 |
19 | onConvoEnd ({ container }) {
20 | container._EmptyQueue()
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/scripting/logichook/logichooks/ConditionalJsonPathBasedLogicHook.js:
--------------------------------------------------------------------------------
1 | const util = require('util')
2 | const jp = require('jsonpath')
3 | const debug = require('debug')('botium-core-ConditionalJsonPathBasedLogicHook')
4 |
5 | module.exports = class ConditionalJsonPathBasedLogicHook {
6 | constructor (context, caps, globalArgs) {
7 | this.context = context
8 | this.caps = caps
9 | this.globalArgs = globalArgs
10 | }
11 |
12 | onBotPrepare ({ convo, convoStep, args, botMsg }) {
13 | const conditionGroupId = args[1]
14 | let params
15 | try {
16 | params = JSON.parse(args[0])
17 | } catch (e) {
18 | throw new Error(`ConditionalJsonPathBasedLogicHook: No parsable JSON object found in params: ${e}`)
19 | }
20 | convoStep.conditional = {
21 | conditionGroupId
22 | }
23 | let skip = true
24 | if (params.jsonPath) {
25 | const values = jp.query(botMsg, params.jsonPath)
26 | skip = !(values && values.length > 0 && values.includes(params.value))
27 | }
28 | convoStep.conditional.skip = skip
29 | debug(`ConditionalJsonPathBasedLogicHook onBotPrepare ${convo.header.name}/${convoStep.stepTag}, args: ${util.inspect(args)}, convoStep.conditional: ${util.inspect(convoStep.conditional)}`)
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/scripting/logichook/logichooks/ConvoStepParametersLogicHook.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This LogicHook is just a marker. It is used Convo Step parameters
3 | * @type {module.ConvoStepParametersLogicHook}
4 | */
5 | module.exports = class ConvoStepParametersLogicHook {
6 | }
7 |
--------------------------------------------------------------------------------
/src/scripting/logichook/logichooks/IncludeLogicHook.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This LogicHook is just a marker. It is used before the conversation is started
3 | * @type {module.IncludeLogicHook}
4 | */
5 | module.exports = class IncludeLogicHook {
6 | }
7 |
--------------------------------------------------------------------------------
/src/scripting/logichook/logichooks/OrderedListToButtonLogicHook.js:
--------------------------------------------------------------------------------
1 | const _ = require('lodash')
2 | const PATTERN = '^\\s*(\\d+)\\.'
3 | const debug = require('debug')('botium-core-OrderedListToButtonLogicHook')
4 |
5 | module.exports = class OrderedListToButtonLogicHook {
6 | constructor (context, caps = {}, globalArgs = {}) {
7 | this.context = context
8 | this.caps = caps
9 | this.globalArgs = globalArgs
10 | }
11 |
12 | onBotPrepare ({ botMsg, args }) {
13 | const pattern = args?.[0] || this.globalArgs?.pattern || PATTERN
14 | let regexp
15 | try {
16 | regexp = new RegExp(pattern, 'gm')
17 | } catch (err) {
18 | throw new Error(`OrderedListToButtonLogicHook: regex is not valid: ${pattern} ${err.messageText}`)
19 | }
20 | const buttons = []
21 | if (botMsg.messageText && _.isString(botMsg.messageText)) {
22 | const matches = botMsg.messageText.matchAll(regexp)
23 |
24 | for (const match of matches) {
25 | if (match && match[1]) {
26 | buttons.push({ text: match[1], payload: match[1] })
27 | }
28 | }
29 | } else {
30 | debug(`ConditionalBusinessHoursLogicHook onBotPrepare, msg has no messageText to check ${JSON.stringify(botMsg)}`)
31 | }
32 |
33 | if (buttons.length) {
34 | botMsg.buttons = [...(botMsg.buttons || []), ...buttons]
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/scripting/logichook/logichooks/PauseLogicHook.js:
--------------------------------------------------------------------------------
1 | const pause = require('../PauseLogic').pause
2 | module.exports = class PauseLogicHook {
3 | constructor (context, caps = {}) {
4 | this.context = context
5 | this.caps = caps
6 | }
7 |
8 | onConvoBegin ({ args }) {
9 | return pause('PauseLogicHook', 'onConvoBegin', args)
10 | }
11 |
12 | onMeEnd ({ convoStep, args }) {
13 | return pause('PauseLogicHook', convoStep.stepTag, args)
14 | }
15 |
16 | onBotEnd ({ convoStep, args }) {
17 | return pause('PauseLogicHook', convoStep.stepTag, args)
18 | }
19 |
20 | onConvoEnd ({ args }) {
21 | return pause('PauseLogicHook', 'onConvoEnd', args)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/scripting/logichook/userinput/ButtonInput.js:
--------------------------------------------------------------------------------
1 | const { BotiumMockButton } = require('../../../mocks/BotiumMockRichMessageTypes')
2 |
3 | module.exports = class ButtonInput {
4 | setUserInput ({ convoStep, args, meMsg }) {
5 | if (!args || args.length === 0 || args.length > 2) {
6 | return Promise.reject(new Error(`${convoStep.stepTag}: ButtonInput requires 1 or 2 arguments`))
7 | }
8 | meMsg.buttons = [new BotiumMockButton({ payload: args[0], text: args.length === 2 ? args[1] : null })]
9 | meMsg.messageText = args[0]
10 | return Promise.resolve()
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scripting/logichook/userinput/FormInput.js:
--------------------------------------------------------------------------------
1 | const { BotiumMockForm } = require('../../../mocks/BotiumMockRichMessageTypes')
2 |
3 | module.exports = class FormInput {
4 | setUserInput ({ convoStep, args, meMsg }) {
5 | if (!args || args.length === 0) {
6 | return Promise.reject(new Error(`${convoStep.stepTag}: FormInput requires at least 1 argument`))
7 | }
8 |
9 | if (!meMsg.forms) meMsg.forms = []
10 | meMsg.forms.push(new BotiumMockForm({
11 | name: args[0],
12 | value: args.length > 1 ? (args.length > 2 ? args.slice(1) : args[1]) : true
13 | }))
14 | return Promise.resolve()
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/scripting/precompilers/Script.js:
--------------------------------------------------------------------------------
1 | const _ = require('lodash')
2 | const { executeHookSync, getHook } = require('../../helpers/HookUtils')
3 |
4 | module.exports.precompile = (caps, scriptBuffer, options, filename) => {
5 | if (!(options.script || options.SCRIPT)) {
6 | throw new Error('Script is not defined')
7 | }
8 |
9 | if (_.isString(scriptBuffer)) {
10 | try {
11 | scriptBuffer = JSON.parse(scriptBuffer)
12 | } catch (err) {
13 | }
14 | }
15 |
16 | const hook = getHook(caps, options.SCRIPT)
17 | const response = executeHookSync(caps, hook, { scriptData: scriptBuffer, filename })
18 |
19 | if (!response) {
20 | return
21 | }
22 |
23 | return response.scriptBuffer ? response : { scriptBuffer: response }
24 | }
25 |
--------------------------------------------------------------------------------
/test/compiler/convos/convos_precompiler_markdown_rasa.md:
--------------------------------------------------------------------------------
1 | ## intent:affirm
2 | - yes
3 | - yes sure
4 |
5 | ## intent:deny
6 | - no
7 |
8 | ## intent:inform
9 | - [Sitka](location)
10 |
11 | ## intent:search_provider
12 | - i need a [hospital](facility_type)
13 | - hi i am in [San Diego](location) i need a [hospital](facility_type:rbry-mqwu)
14 |
15 | ## synonym:rbry-mqwu
16 | - hospital
17 | - hospitals
18 |
19 | ## regex:location
20 | - [0-9]{5}
21 |
--------------------------------------------------------------------------------
/test/compiler/convos/convos_precompiler_script.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "intent": "greeting",
4 | "sentences": [
5 | "hello",
6 | "hi"
7 | ]
8 | },
9 | {
10 | "intent": "goodbye",
11 | "sentences": [
12 | "goodbye"
13 | ]
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/test/compiler/convos/convos_precompiler_script.json.txt:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "intent": "greeting",
4 | "sentences": [
5 | "hello",
6 | "hi"
7 | ]
8 | },
9 | {
10 | "intent": "goodbye",
11 | "sentences": [
12 | "goodbye"
13 | ]
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/test/compiler/convos/convos_precompiler_script_text_to_text.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | Hi!
3 |
4 | #bot
5 | Hi
6 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_column_basic.csv:
--------------------------------------------------------------------------------
1 | question,answer
2 | test 1,test 2
3 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_column_me_bot.csv:
--------------------------------------------------------------------------------
1 | user,bot
2 | test 1,test 2
3 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_column_more_convos.csv:
--------------------------------------------------------------------------------
1 | question,answer
2 | test 1,test 2
3 | test 3,test 4
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_column_no_header.csv:
--------------------------------------------------------------------------------
1 | test 1,test 2
2 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_column_sequence.csv:
--------------------------------------------------------------------------------
1 | answer,question
2 | test 2,test 1
3 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_column_sequence_no_def_colname.csv:
--------------------------------------------------------------------------------
1 | alter answer,alter question
2 | test 2,test 1
3 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_sender_basic.csv:
--------------------------------------------------------------------------------
1 | conversationId,sender,text
2 | first,me,test 1
3 | first,bot,test 2
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_sender_more_convos.csv:
--------------------------------------------------------------------------------
1 | conversationId,sender,text
2 | first,me,test 1
3 | first,bot,test 2
4 | second,me,test 3
5 | second,bot,test 4
6 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_sender_no_header.csv:
--------------------------------------------------------------------------------
1 | first,me,test 1
2 | first,bot,test 2
3 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_sender_no_text.csv:
--------------------------------------------------------------------------------
1 | conversationId,sender,text
2 | first,me,
3 | first,bot,test 2
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_sender_sequence_and_extra_row.csv:
--------------------------------------------------------------------------------
1 | sender,conversationId,text,comment
2 | me,first,test 1,will be ignored
3 | bot,first,test 2,will be ignored
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/convos_sender_sequence_and_extra_row_no_def_colname.csv:
--------------------------------------------------------------------------------
1 | alter sender,alter conversationId,alter text,comment
2 | me,first,test 1,will be ignored
3 | bot,first,test 2,will be ignored
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/utterances_liveperson2.csv:
--------------------------------------------------------------------------------
1 | Cancel Pre-Authorized Payment,Payee - Correct/Modify,Pre-Authorized Payment - Correct/Modify,E-Transfer Recipient – Delete
2 | DisplayName,DisplayName,DisplayName,DisplayName
3 | Cancel Pre-Authorized Payment,Payee - Correct/Modify,Pre-Authorized Payment - Correct/Modify,E-Transfer Recipient – Delete
4 | KeyPhrases,KeyPhrases,KeyPhrases,KeyPhrases
5 | ,,,
6 | MetaIntent,MetaIntent,MetaIntent,MetaIntent
7 | ,,,
8 | SampleSentences,SampleSentences,SampleSentences,SampleSentences
9 | Can I call back to re-start the payment,Can I modify my existing payee?,Can I delay my payment to (company)?,Can you delete my friend as an e-transfer recipient?
10 | Can I stop a direct debit,Can you change the name of the payee?,,Can you delete this e-transfer recipient
11 | Can you cancel a preauthorized payment for me,,,Can you delete this recipient
12 | Can you help me cancel my pre authorized payment,,,
13 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/utterances_multicolumn3col.csv:
--------------------------------------------------------------------------------
1 | 4col,goodbye,some
2 | hello,goodbye
3 | hi,
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/utterances_multicolumn5col.csv:
--------------------------------------------------------------------------------
1 | 5col,goodbye,some,other,more
2 | hello,goodbye,2,3,4
3 | hi,
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/utterances_singlecolumn.csv:
--------------------------------------------------------------------------------
1 | singlecolumn
2 | hello
3 | hi
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/csv/utterances_variable_row_len.csv:
--------------------------------------------------------------------------------
1 | variable_row_len,goodbye, col1, col2, col3,
2 | hello,goodbye
3 | hi,,sd,fs d,f ,sdf ,ds, fsd,f ,sdf, sd,f sd, f,sd f,
4 |
--------------------------------------------------------------------------------
/test/compiler/convos/json/scripting_memory.json:
--------------------------------------------------------------------------------
1 | {
2 | "scriptingMemory": [
3 | {
4 | "header": {
5 | "name": "scenario1"
6 | },
7 | "values": {
8 | "$var1": "var1_1",
9 | "$var2": "var2_1"
10 | }
11 | },
12 | {
13 | "header": {
14 | "name": "scenario2"
15 | },
16 | "values": {
17 | "$var1": "var1_2",
18 | "$var2": "var2_2"
19 | }
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_precompiler_markdown.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - hello meat bag
7 | - BUTTONS checkbutton|checkbutton2
8 | ## Test Case 2
9 | - me
10 | - hello bot
11 | - bot
12 | - TEXT
13 | - hello meat bag
14 | - BUTTONS
15 | - checkbutton
16 | - checkbutton2
17 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_precompiler_markdown_invalid_noh1.md:
--------------------------------------------------------------------------------
1 | ## Test Case 1
2 | - me
3 | - hello bot
4 | - bot
5 | - hello meat bag
6 | - BUTTONS checkbutton|checkbutton2
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_precompiler_markdown_invalid_noh2.md:
--------------------------------------------------------------------------------
1 | # Test Case 1
2 | - me
3 | - hello bot
4 | - bot
5 | - hello meat bag
6 | - BUTTONS checkbutton|checkbutton2
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_precompiler_markdown_utterances.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case utterances
3 | - me
4 | - UTT_HELLO
5 | # Utterances
6 | ## UTT_HELLO
7 | - hi
8 | - hello
9 | - greeting
10 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_exclamation.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - !hello meat bag
7 | - !BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_exclamation_secline.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - !hello meat bag
7 | - !hello2
8 | - !BUTTONS checkbutton|checkbutton2
9 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_four_exclamation.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - !!!!hello meat bag
7 | - BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_four_question.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - ????hello meat bag
7 | - BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_question.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - ?hello meat bag
7 | - ?BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_question_exclamation.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - ?!hello meat bag
7 | - ?BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_question_invalid.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - ?hello meat bag
7 | - BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_question_secline.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - ?hello meat bag
7 | - ?hello2
8 | - ?BUTTONS checkbutton|checkbutton2
9 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_two_exclamation.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - !!hello meat bag
7 | - BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_two_question.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - ??hello meat bag
7 | - BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/md/convos_with_two_question_exclamation.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Test Case 1
3 | - me
4 | - hello bot
5 | - bot
6 | - ??!hello meat bag
7 | - BUTTONS checkbutton|checkbutton2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_args_escape.convo.txt:
--------------------------------------------------------------------------------
1 | #bot
2 | BUTTONS Test\|1|Test\|2
3 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_asserter_modificator.convo.txt:
--------------------------------------------------------------------------------
1 | #bot
2 | !BUTTONS Test1|Test2
3 |
4 | #me
5 | hugo
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_emptyrow_empty.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 |
3 | #bot
4 | Hi
5 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_emptyrow_just_asserter.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | PAUSE 100
3 |
4 | #bot
5 | Hi
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_emptyrow_just_asserter_no_separator_row.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | PAUSE 100
3 | #bot
4 | Hi
5 |
6 |
7 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_emptyrow_just_emptyrow.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 |
3 |
4 | #bot
5 | Hi
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_emptyrow_just_text.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | Hello
3 |
4 | #bot
5 | Hi
6 |
7 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_emptyrow_just_text_no_separator_row.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | Hello
3 | #bot
4 | Hi
5 |
6 |
7 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_emptyrow_no_separator_row.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | #bot
3 | Hi
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_emptyrow_text_after_logichook.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | PAUSE 100
3 | Hi!
4 |
5 | #bot
6 | Hi
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_invalidsender.convo.txt:
--------------------------------------------------------------------------------
1 | # me something else
2 |
3 | # bot
4 | Hi
5 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_jsonmessage.convo.txt:
--------------------------------------------------------------------------------
1 | JSON
2 |
3 | #me
4 | {
5 | "sessionId": "1234567890876543",
6 | "text": "Text message",
7 | "data": {
8 | "key": "value"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_mixed_new_line_characters.convo.txt:
--------------------------------------------------------------------------------
1 | mixed new line characters (do not change in text editor!)
2 |
3 | #me
4 | n
5 |
6 | #bot
7 | rn
8 |
9 | #bot
10 | r
11 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_exclamation.convo.txt:
--------------------------------------------------------------------------------
1 | !test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | !test 2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_exclamation_secline.convo.txt:
--------------------------------------------------------------------------------
1 | !test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | !test 2
8 | !test 2
9 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_four_exclamation.convo.txt:
--------------------------------------------------------------------------------
1 | !!!!test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | !!!!test 2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_four_question.convo.txt:
--------------------------------------------------------------------------------
1 | ????test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | ????test 2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_hashmark.convo.txt:
--------------------------------------------------------------------------------
1 | convos + #
2 |
3 | #me
4 | # one hash
5 |
6 | #bot
7 | ## two hashes
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_newlines.convo.txt:
--------------------------------------------------------------------------------
1 | convos_with_newlines
2 |
3 | #me
4 | Hallo
5 |
6 | Hallo2
7 |
8 | #bot
9 | Hallo
10 |
11 | Hallo2
12 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_question.convo.txt:
--------------------------------------------------------------------------------
1 | ?test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | ?test 2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_question_exclamation.convo.txt:
--------------------------------------------------------------------------------
1 | ?!test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | ?!test 2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_question_secline.convo.txt:
--------------------------------------------------------------------------------
1 | ?test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | ?test 2
8 | ?test 2
9 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_two_exclamation.convo.txt:
--------------------------------------------------------------------------------
1 | !!test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | !!test 2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_two_question.convo.txt:
--------------------------------------------------------------------------------
1 | ??test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | ??test 2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/txt/convos_with_two_question_exclamation.convo.txt:
--------------------------------------------------------------------------------
1 | ??!test 2
2 |
3 | #me
4 | test 1
5 |
6 | #bot
7 | ??!test 2
8 |
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2convos.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2convos.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2convos_2utterances.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2convos_2utterances.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2convos_middle.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2convos_middle.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2convos_simplified_to_force.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2convos_simplified_to_force.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2convos_with_names.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2convos_with_names.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2convos_with_names_noheader.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2convos_with_names_noheader.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2convos_without_names.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2convos_without_names.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2convos_without_names_noheader.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2convos_without_names_noheader.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2utterances.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2utterances.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2utterances_emptylines.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2utterances_emptylines.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_2x2convos_simplified.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_2x2convos_simplified.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_logichook_after.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_logichook_after.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_logichook_before.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_logichook_before.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_mix_qa_and_convos.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_mix_qa_and_convos.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_sheetnames.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_sheetnames.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_sortorder.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_sortorder.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_exclamation.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_exclamation.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_exclamation_secline.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_exclamation_secline.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_four_exclamation.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_four_exclamation.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_four_question.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_four_question.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_question.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_question.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_question_exclamation.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_question_exclamation.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_question_secline.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_question_secline.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_two_exclamation.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_two_exclamation.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_two_question.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_two_question.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/xlsx/convos_with_two_question_exclamation.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/compiler/convos/xlsx/convos_with_two_question_exclamation.xlsx
--------------------------------------------------------------------------------
/test/compiler/convos/yaml/convos_and_utterances.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: goodbye
3 | description: desc of convo goodbye
4 | steps:
5 | - begin:
6 | - PAUSE 500
7 | - me:
8 | - bye
9 | - bot:
10 | - goodbye!
11 | - name: convo 1 name
12 | description: desc of convo
13 | steps:
14 | - me:
15 | - hi
16 | - PAUSE:
17 | - 500
18 | - bot:
19 | - OPTIONAL_NOT_TEXT:
20 | - hello
21 | - OPTIONAL_INTENT:
22 | - intent_greeting
23 | - bot:
24 | - what can i do for you?
25 | - me:
26 | - nothing
27 | - bot:
28 | - ?!thanks
29 | utterances:
30 | GREETING:
31 | - hi
32 | - hello!
33 |
--------------------------------------------------------------------------------
/test/compiler/convos/yaml/scripting_memory.yml:
--------------------------------------------------------------------------------
1 | scriptingMemory:
2 | - header:
3 | name: scenario1
4 | values:
5 | $var1: var1_1
6 | $var2: var2_1
7 | - header:
8 | name: scenario2
9 | values:
10 | $var1: var1_2
11 | $var2: var2_2
12 |
--------------------------------------------------------------------------------
/test/connectors/convos/hello.convo.txt:
--------------------------------------------------------------------------------
1 | hello
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/connectors/convos/responsefromping.convo.txt:
--------------------------------------------------------------------------------
1 | responsefromping
2 |
3 | #bot
4 | response from ping
--------------------------------------------------------------------------------
/test/connectors/convos/responsefromstart.convo.txt:
--------------------------------------------------------------------------------
1 | responsefromstart
2 |
3 | #bot
4 | response from start
--------------------------------------------------------------------------------
/test/connectors/logicHook.js:
--------------------------------------------------------------------------------
1 | module.exports = ({ requestOptions, context }) => {
2 | let counter = 1
3 | requestOptions.body = { bodyFieldRequestHook: counter++ }
4 | context.contextFieldRequestHook = counter
5 | }
6 |
--------------------------------------------------------------------------------
/test/convo/convos/1step.convo.txt:
--------------------------------------------------------------------------------
1 | 1 step
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Hello
8 |
--------------------------------------------------------------------------------
/test/convo/convos/2steps.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps
2 |
3 | #begin
4 |
5 | #me
6 | Hello
7 |
8 | #bot
9 | Hello
10 |
11 | #me
12 | Hello again!
13 |
14 | #bot
15 | Hello again!
16 |
17 | #end
--------------------------------------------------------------------------------
/test/convo/convos/2stepsWithPause.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Hello
8 |
9 | #me
10 | Hello again!
11 | PAUSE 1000
12 |
13 | #bot
14 | Hello again!
15 |
16 |
--------------------------------------------------------------------------------
/test/convo/convos/2stepsfailing.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Hello
8 |
9 | #me
10 | Hello again!
11 |
12 | #bot
13 | Hello again FAILING!
14 |
15 | #me
16 | not reached
17 |
--------------------------------------------------------------------------------
/test/convo/convos/2stepsneg.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps neg
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | !Hugo
8 |
--------------------------------------------------------------------------------
/test/convo/convos/2stepsopt.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps neg
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | ?Hello
8 |
--------------------------------------------------------------------------------
/test/convo/convos/2stepsoptfollowme.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps neg
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | ?Hugo
8 |
9 | #me
10 | Hello
11 |
--------------------------------------------------------------------------------
/test/convo/convos/2stepsoptneg.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps neg
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | ?!Hugo
8 |
--------------------------------------------------------------------------------
/test/convo/convos/2stepsoptskip.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps neg
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | ?Hugo
8 |
9 | #bot
10 | Hello
11 |
--------------------------------------------------------------------------------
/test/convo/convos/applyscriptingmemoryinbegin.convo.txt:
--------------------------------------------------------------------------------
1 | applyscriptingmemoryinbegin
2 |
3 | #begin
4 | SET_SCRIPTING_MEMORY access_token|$cap(MYTOKEN)
5 |
6 | #me
7 | access token: $cap(MYTOKEN)
8 |
9 | #bot
10 |
11 | #me
12 | access token: $access_token
13 |
14 | #bot
15 |
--------------------------------------------------------------------------------
/test/convo/convos/applyscriptingmemorytoasserterargs.convo.txt:
--------------------------------------------------------------------------------
1 | applyscriptingmemorytoasserterargs
2 |
3 | #me
4 | question1
5 |
6 | #bot
7 | $arg0
8 |
9 | #me
10 | question2
11 |
12 | #bot
13 | $arg1
14 | CUSTOMASSERTER $arg0|$arg1
15 |
--------------------------------------------------------------------------------
/test/convo/convos/assert_date.convo.txt:
--------------------------------------------------------------------------------
1 | asserting date
2 |
3 | #me
4 | hello!
5 |
6 | #bot
7 | $date
8 |
--------------------------------------------------------------------------------
/test/convo/convos/asserters.convo.txt:
--------------------------------------------------------------------------------
1 | asserters
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | BUTTONS btn1|btn2
8 |
--------------------------------------------------------------------------------
/test/convo/convos/assertersopt.convo.txt:
--------------------------------------------------------------------------------
1 | asserters
2 |
3 | #me
4 | buttons
5 |
6 | #bot
7 | ?buttons
8 | ?BUTTONS First Button|Second Button
9 |
--------------------------------------------------------------------------------
/test/convo/convos/assertersoptskip.convo.txt:
--------------------------------------------------------------------------------
1 | asserters
2 |
3 | #me
4 | buttons
5 |
6 | #bot
7 | ?buttons
8 | ?BUTTONS apple
9 |
10 | #bot
11 | buttons
12 | BUTTONS First Button|Second Button
13 |
--------------------------------------------------------------------------------
/test/convo/convos/botreply_not_consumed_end.convo.txt:
--------------------------------------------------------------------------------
1 | botreply_not_consumed_end
2 |
3 | #me
4 | Hello
5 |
6 | #end
7 | BOT_CONSUMED
8 |
--------------------------------------------------------------------------------
/test/convo/convos/botreply_not_consumed_end_not.convo.txt:
--------------------------------------------------------------------------------
1 | botreply_not_consumed_end_not
2 |
3 | #me
4 | Hello
5 |
6 | #end
7 | !BOT_CONSUMED
8 |
--------------------------------------------------------------------------------
/test/convo/convos/botreply_not_consumed_me.convo.txt:
--------------------------------------------------------------------------------
1 | botreply_not_consumed_me
2 |
3 | #me
4 | Hello
5 |
6 | #me
7 | Hello
8 |
--------------------------------------------------------------------------------
/test/convo/convos/botreply_skip_unconsumed.convo.txt:
--------------------------------------------------------------------------------
1 | botreply_skip_unconsumed
2 |
3 | #me
4 | Hello
5 |
6 | #me
7 | Hello
8 |
9 | #me
10 | Hello
11 |
12 | #bot
13 | BOT_UNCONSUMED_COUNT =2
14 | SKIP_BOT_UNCONSUMED
15 |
16 | #end
17 | BOT_CONSUMED
18 | BOT_UNCONSUMED_COUNT =0
19 |
--------------------------------------------------------------------------------
/test/convo/convos/botreply_unconsumed_count.convo.txt:
--------------------------------------------------------------------------------
1 | botreply_unconsumed_count
2 |
3 | #me
4 | Hello
5 |
6 | #me
7 | Hello
8 |
9 | #end
10 | BOT_UNCONSUMED_COUNT >=2
11 |
--------------------------------------------------------------------------------
/test/convo/convos/continuefailing.convo.txt:
--------------------------------------------------------------------------------
1 | continuefailing
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Hello
8 |
9 | #me
10 | Hello again!
11 |
12 | #bot
13 | Hello again FAILING!
14 |
15 | #me
16 | working again
17 |
18 | #bot
19 | working again
20 |
--------------------------------------------------------------------------------
/test/convo/convos/continuefailing_timeout.convo.txt:
--------------------------------------------------------------------------------
1 | continuefailing
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Hello
8 |
9 | #me
10 | Hello again!
11 |
12 | #bot
13 | Hello again FAILING!
14 |
15 | #bot
16 | working again
17 |
--------------------------------------------------------------------------------
/test/convo/convos/invalidsender.convo.txt:
--------------------------------------------------------------------------------
1 | invalid sender
2 |
3 | #billy
4 | Hello
5 |
6 | #bot
7 | Hello
8 |
--------------------------------------------------------------------------------
/test/convo/convos/json-matching-key-and-value.convo.txt:
--------------------------------------------------------------------------------
1 | JSON
2 |
3 | #begin
4 |
5 | #me
6 | {
7 | "text": "Success!",
8 | "falsytext": "",
9 | "number": 1,
10 | "falsynumber": 0,
11 | "floating": 1.0,
12 | "falsyfloat": 0.0,
13 | "isBoolean": true,
14 | "isNotBoolean": false,
15 | "fullArray": ["entryOne"],
16 | "halfArray": [""],
17 | "emptyArray": [],
18 | "containsNothing": null
19 | }
20 |
21 | #bot
22 | {
23 | "text": "Success!",
24 | "falsytext": "",
25 | "number": 1,
26 | "falsynumber": 0,
27 | "floating": 1.0,
28 | "falsyfloat": 0.0,
29 | "isBoolean": true,
30 | "isNotBoolean": false,
31 | "fullArray": ["entryOne"],
32 | "halfArray": [""],
33 | "emptyArray": [],
34 | "containsNothing": null
35 | }
36 |
37 | #end
--------------------------------------------------------------------------------
/test/convo/convos/json-mismatching-key.convo.txt:
--------------------------------------------------------------------------------
1 | JSON
2 |
3 | #begin
4 |
5 | #me
6 | {
7 | "message": "Success!"
8 | }
9 |
10 | #bot
11 | {
12 | "Xmessage": "Success!"
13 | }
14 |
15 | #end
--------------------------------------------------------------------------------
/test/convo/convos/json-mismatching-value.convo.txt:
--------------------------------------------------------------------------------
1 | JSON
2 |
3 | #begin
4 |
5 | #me
6 | {
7 | "message": "Hello"
8 | }
9 |
10 | #bot
11 | {
12 | "message": "ZHello"
13 | }
14 |
15 | #end
--------------------------------------------------------------------------------
/test/convo/convos/memory.convo.txt:
--------------------------------------------------------------------------------
1 | scripting memory
2 |
3 | #me
4 | this is a variable: VARVALUE
5 |
6 | #bot
7 | this is a variable: $myvar
8 |
9 | #me
10 | show var $myvar
11 |
12 | #bot
13 | show var VARVALUE
14 |
15 |
--------------------------------------------------------------------------------
/test/convo/convos/memory_dont_override_functions.convo.txt:
--------------------------------------------------------------------------------
1 | scripting memory
2 |
3 | #me
4 | 2009
5 |
6 | #bot
7 | !$year
8 |
--------------------------------------------------------------------------------
/test/convo/convos/memory_fail.convo.txt:
--------------------------------------------------------------------------------
1 | scripting memory
2 |
3 | #me
4 | this is a variable: VARVALUE
5 |
6 | #bot
7 | this is a variable: $myvar
8 |
9 | #me
10 | show var $myvar
11 |
12 | #bot
13 | show var VARVALUEINVALID
14 |
15 |
--------------------------------------------------------------------------------
/test/convo/convos/memory_normalize.convo.txt:
--------------------------------------------------------------------------------
1 | memory_normalize
2 |
3 | #me
4 | Kentucky is the 15th state, admitted to the Union in 1792. The capital of Kentucky is Frankfort, and the abbreviation for Kentucky is KY. I've added Kentucky to your Alexa app. Which other state or capital would you like to know about?
5 |
6 | #bot
7 | $state is the 15th state, admitted to the Union in 1792. The capital of Kentucky is Frankfort, and the abbreviation for Kentucky is KY. I've added Kentucky to your Alexa app. Which other state or capital would you like to know about?
8 |
9 | #me
10 | $state is the 15th state
11 |
12 | #bot
13 | Kentucky is the 15th state
14 |
--------------------------------------------------------------------------------
/test/convo/convos/multiline.convo.txt:
--------------------------------------------------------------------------------
1 | 2 steps
2 |
3 | #begin
4 |
5 | #me
6 | year is
7 | $year
8 |
9 | #bot
10 | year is
11 | $year
12 |
13 | #me
14 | year is
15 | $year
16 |
17 | #bot
18 | year is
19 | $year_captured
20 |
21 | #end
22 |
--------------------------------------------------------------------------------
/test/convo/convos/multiple_asserting_errors.convo.txt:
--------------------------------------------------------------------------------
1 | asserters
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Goodbye!
8 | BUTTONS btn1
9 | BUTTONS btn2
10 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/circular/first.pconvo.txt:
--------------------------------------------------------------------------------
1 | first
2 |
3 | #bot
4 | first
5 |
6 | INCLUDE second
7 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/circular/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #bot
4 | hi
5 |
6 | INCLUDE first
7 |
8 | #me
9 | ok
10 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/circular/second.pconvo.txt:
--------------------------------------------------------------------------------
1 | second
2 |
3 | #bot
4 | second
5 |
6 | INCLUDE first
7 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/csv/main.convo.csv:
--------------------------------------------------------------------------------
1 | conversationId,sender,text
2 | main,me,Login please
3 | main,me,INCLUDE Login
4 | main,bot,You are logged in!
5 | main,me,Logout please!
6 | main,me,INCLUDE Logout
7 | main,bot,You are logged out!
8 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/csv/pconvos.pconvo.csv:
--------------------------------------------------------------------------------
1 | conversationId,sender,text
2 | Logout,bot,Are you sure?
3 | Logout,me,Yes
4 | Login,bot,Password please!
5 | Login,me,123456
6 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/depth1/login.pconvo.txt:
--------------------------------------------------------------------------------
1 | Login
2 |
3 | #begin
4 |
5 | #bot
6 | Password please!
7 |
8 | #me
9 | 123456
10 |
11 | #end
12 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/depth1/logout.pconvo.txt:
--------------------------------------------------------------------------------
1 | Logout
2 |
3 | #begin
4 |
5 | #bot
6 | Are you sure?
7 |
8 | #me
9 | Yes
10 |
11 | #end
12 |
13 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/depth1/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 | Login please
7 |
8 | INCLUDE Login
9 |
10 | #bot
11 | You are logged in!
12 |
13 | #me
14 | Logout please!
15 |
16 | INCLUDE Logout
17 |
18 | #bot
19 | You are logged out!
20 |
21 | #end
22 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/depth2/depth1.pconvo.txt:
--------------------------------------------------------------------------------
1 | depth1
2 |
3 | #begin
4 |
5 | #bot
6 | in depth1
7 |
8 | #me
9 | ok
10 |
11 | INCLUDE depth2
12 |
13 | #end
14 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/depth2/depth2.pconvo.txt:
--------------------------------------------------------------------------------
1 | depth2
2 |
3 | #bot
4 | in depth2
5 |
6 | #me
7 | in depth2
8 |
9 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/depth2/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 |
7 | Start depth1
8 |
9 | INCLUDE depth1
10 |
11 | #bot
12 | main end
13 |
14 | #end
15 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/duplicateinclude/main.convo.txt:
--------------------------------------------------------------------------------
1 | pconvo
2 |
3 | #me
4 | doesnotmatter!
5 | INCLUDE sub
6 |
7 | INCLUDE sub
8 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/duplicateinclude/sub.pconvo.txt:
--------------------------------------------------------------------------------
1 | sub
2 |
3 | #bot
4 | in sub!
5 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/duplicatepconvo/pconvofirst.pconvo.txt:
--------------------------------------------------------------------------------
1 | pconvo
2 |
3 | #me
4 | doesnotmatter
5 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/duplicatepconvo/pconvosecond.pconvo.txt:
--------------------------------------------------------------------------------
1 | pconvo
2 |
3 | #me
4 | doesnotmatter!
5 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/excel/bottext/bottext.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/convo/convos/partialconvo/excel/bottext/bottext.xlsx
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/excel/convo/convo.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/convo/convos/partialconvo/excel/convo/convo.xlsx
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/excel/emptystep/emptystep.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/convo/convos/partialconvo/excel/emptystep/emptystep.xlsx
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/illegalname/illegalname.pconvo.txt:
--------------------------------------------------------------------------------
1 | illegal|name
2 |
3 | #bot
4 | in sub!
5 |
6 | #me
7 | ok
8 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/includeafterbot/afterbot.pconvo.txt:
--------------------------------------------------------------------------------
1 | afterbot
2 |
3 | #me
4 | included afterbot?
5 |
6 | #bot
7 | included afterbot!
8 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/includeafterbot/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 | include after bot!
7 |
8 | #bot
9 | ok
10 |
11 | INCLUDE afterbot
12 |
13 | #end
14 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/includedmoretimes/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 | Start sub
7 | INCLUDE sub
8 | INCLUDE sub
9 |
10 | #end
11 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/includedmoretimes/sub.pconvo.txt:
--------------------------------------------------------------------------------
1 | sub
2 |
3 | #bot
4 | in sub!
5 |
6 | #me
7 | ok
8 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/includefirst/depth1.pconvo.txt:
--------------------------------------------------------------------------------
1 | depth1
2 |
3 | #begin
4 | INCLUDE depth2
5 |
6 | #bot
7 | in depth1
8 |
9 | #me
10 | ok
11 |
12 |
13 | #end
14 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/includefirst/depth2.pconvo.txt:
--------------------------------------------------------------------------------
1 | depth2
2 |
3 | #bot
4 | in depth2
5 |
6 | #me
7 | in depth2
8 |
9 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/includefirst/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 |
7 | Start depth1
8 |
9 | INCLUDE depth1
10 |
11 | #bot
12 | main end
13 |
14 | #end
15 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/noname/noname.pconvo.txt:
--------------------------------------------------------------------------------
1 |
2 | #me
3 | Have no name!
4 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/notfound/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #me
4 | Hello
5 | INCLUDE notexists
6 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesender/depth1.pconvo.txt:
--------------------------------------------------------------------------------
1 | depth1
2 |
3 | #include depth2
4 |
5 | #bot
6 | in depth1
7 |
8 | #me
9 | ok
10 |
11 | #end
12 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesender/depth2.pconvo.txt:
--------------------------------------------------------------------------------
1 | depth2
2 |
3 | #bot
4 | in depth2
5 |
6 | #me
7 | in depth2
8 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesender/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 | Start depth1
7 |
8 | #include depth1
9 |
10 | #bot
11 | main end
12 |
13 | #end
14 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesendermultiinclude/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 | Start sub
7 |
8 | #include sub
9 | #include sub
10 | sub
11 | sub
12 |
13 | #end
14 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesendermultiinclude/sub.pconvo.txt:
--------------------------------------------------------------------------------
1 | sub
2 |
3 | #bot
4 | in sub!
5 |
6 | #me
7 | ok
8 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesendermultiincludejson/main.json:
--------------------------------------------------------------------------------
1 | {
2 | "convos": [
3 | {
4 | "name": "Main",
5 | "steps": [
6 | {
7 | "me": [
8 | "Start sub"
9 | ]
10 | },
11 | {
12 | "include": [
13 | "sub",
14 | "sub"
15 | ]
16 | }
17 | ]
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesendermultiincludejson/sub.json:
--------------------------------------------------------------------------------
1 | {
2 | "partialConvos": [
3 | {
4 | "name": "sub",
5 | "steps": [
6 | {
7 | "bot": [
8 | "in sub!"
9 | ]
10 | },
11 | {
12 | "me": [
13 | "ok"
14 | ]
15 | }
16 | ]
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesendermultiincludemd/convos.md:
--------------------------------------------------------------------------------
1 | # Convos
2 | ## Main
3 | - me
4 | - Start sub
5 | - include
6 | - sub
7 | - sub
8 | # PartialConvos
9 | ## sub
10 | - bot
11 | - in sub!
12 | - me
13 | - ok
14 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/usesendermultiincludeyaml/convos.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: Main
3 | steps:
4 | - me:
5 | - Start sub
6 | - include:
7 | - sub
8 | - sub
9 | partialConvos:
10 | - name: sub
11 | steps:
12 | - bot:
13 | - in sub!
14 | - me:
15 | - ok
16 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/withscriptingmemory/login.pconvo.txt:
--------------------------------------------------------------------------------
1 | Login
2 |
3 | #begin
4 |
5 | #bot
6 | Password please!
7 |
8 | #me
9 | $password
10 |
11 | #end
12 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/withscriptingmemory/logout.pconvo.txt:
--------------------------------------------------------------------------------
1 | Logout
2 |
3 | #begin
4 |
5 | #bot
6 | Are you sure?
7 |
8 | #me
9 | yes
10 |
11 | #end
12 |
13 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/withscriptingmemory/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 | SET_SCRIPTING_MEMORY password|123456
5 |
6 | #me
7 | Login please
8 |
9 | INCLUDE Login
10 |
11 | #bot
12 | You are logged in!
13 |
14 | #me
15 | Logout please!
16 |
17 | INCLUDE Logout
18 |
19 | #bot
20 | You are logged out!
21 |
22 | #end
23 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/withutterances/affirmative.utterances.txt:
--------------------------------------------------------------------------------
1 | UTT_AFFIRMATIVE
2 | yes
3 | sure
4 | do it
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/withutterances/login.pconvo.txt:
--------------------------------------------------------------------------------
1 | Login
2 |
3 | #begin
4 |
5 | #bot
6 | Password please!
7 |
8 | #me
9 | 123456
10 |
11 | #end
12 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/withutterances/logout.pconvo.txt:
--------------------------------------------------------------------------------
1 | Logout
2 |
3 | #begin
4 |
5 | #bot
6 | Are you sure?
7 |
8 | #me
9 | UTT_AFFIRMATIVE
10 |
11 | #end
12 |
13 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/withutterances/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 | Login please
7 |
8 | INCLUDE Login
9 |
10 | #bot
11 | You are logged in!
12 |
13 | #me
14 | Logout please!
15 |
16 | INCLUDE Logout
17 |
18 | #bot
19 | You are logged out!
20 |
21 | #end
22 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/wrongarg/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #begin
4 |
5 | #me
6 | Start depth1
7 |
8 | INCLUDE SUB|sdfsdfsd
9 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/wrongarg/sub.pconvo.txt:
--------------------------------------------------------------------------------
1 | sub
2 |
3 | #bot
4 | in sub!
5 |
6 | #me
7 | ok
8 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/wrongref/exists.pconvo.txt:
--------------------------------------------------------------------------------
1 | exists
2 |
3 | #bot
4 | hello human
5 |
--------------------------------------------------------------------------------
/test/convo/convos/partialconvo/wrongref/main.convo.txt:
--------------------------------------------------------------------------------
1 | Main
2 |
3 | #me
4 | Hello
5 | INCLUDE wrongref
6 |
--------------------------------------------------------------------------------
/test/convo/convos/retryasserter1step.convo.txt:
--------------------------------------------------------------------------------
1 | 1 step
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | CUSTOMASSERTER
8 |
--------------------------------------------------------------------------------
/test/convo/convos/tree/excel/testbotium.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/convo/convos/tree/excel/testbotium.xlsx
--------------------------------------------------------------------------------
/test/convo/convos/tree/simpletree/convo1.convo.txt:
--------------------------------------------------------------------------------
1 | convo1
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello
8 |
9 | #me
10 | nice weather today
11 |
12 | #bot
13 | sure
--------------------------------------------------------------------------------
/test/convo/convos/tree/simpletree/convo2.convo.txt:
--------------------------------------------------------------------------------
1 | convo2
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello
8 |
9 | #me
10 | bad weather today
11 |
12 | #bot
13 | no
14 |
15 | #bot
16 | it's okay
--------------------------------------------------------------------------------
/test/convo/convos/tree/withloop/convo1.convo.txt:
--------------------------------------------------------------------------------
1 | convo1
2 |
3 | #bot
4 | Welcome
5 | BUTTONS path1|path2
6 |
7 | #me
8 | BUTTON path1
9 |
10 | #bot
11 | This is path 1
12 |
13 | #bot
14 | Welcome
15 | BUTTONS path1|path2
16 |
--------------------------------------------------------------------------------
/test/convo/convos/tree/withloop/convo2.convo.txt:
--------------------------------------------------------------------------------
1 | convo2
2 |
3 | #bot
4 | Welcome
5 | BUTTONS path1|path2
6 |
7 | #me
8 | BUTTON path2
9 |
10 | #bot
11 | This is path 2
12 |
13 | #bot
14 | Welcome
15 | BUTTONS path1|path2
16 |
--------------------------------------------------------------------------------
/test/convo/convos/tree/withuserinput/convo1.convo.txt:
--------------------------------------------------------------------------------
1 | convo1
2 |
3 | #me
4 | BUTTON hello
5 |
6 | #bot
7 | hello
8 |
9 | #me
10 | BUTTON nice weather today
11 |
12 | #bot
13 | sure
--------------------------------------------------------------------------------
/test/convo/convos/tree/withuserinput/convo2.convo.txt:
--------------------------------------------------------------------------------
1 | convo2
2 |
3 | #me
4 | BUTTON hello
5 |
6 | #bot
7 | hello
8 |
9 | #me
10 | BUTTON bad weather today
11 |
12 | #bot
13 | no
14 |
15 | #bot
16 | it's okay
--------------------------------------------------------------------------------
/test/convo/convos/tree/withutterance/convo1.convo.txt:
--------------------------------------------------------------------------------
1 | convo1
2 |
3 | #me
4 | UTT_HELLO
5 |
6 | #bot
7 | hello
8 |
--------------------------------------------------------------------------------
/test/convo/convos/tree/withutterance/convo2.convo.txt:
--------------------------------------------------------------------------------
1 | convo2
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | UTT_HELLO
8 |
--------------------------------------------------------------------------------
/test/convo/convos/tree/withutterance/utt.utterances.txt:
--------------------------------------------------------------------------------
1 | UTT_HELLO
2 | hello
3 | hello1
4 | hello2
5 | hello3
6 | hello4
--------------------------------------------------------------------------------
/test/convo/convos/utt_memory.convo.txt:
--------------------------------------------------------------------------------
1 | utterances memory
2 |
3 | #me
4 | I am 40 years old
5 |
6 | #bot
7 | AGE_UTT
8 |
9 | #me
10 | show var $years
11 |
12 | #bot
13 | show var 40
14 |
15 | #me
16 | I am 2 months old
17 |
18 | #bot
19 | AGE_UTT
20 |
21 | #me
22 | show var $months
23 |
24 | #bot
25 | show var 2
26 |
--------------------------------------------------------------------------------
/test/convo/convos/utt_memory.utterances.txt:
--------------------------------------------------------------------------------
1 | AGE_UTT
2 | I am $months months old
3 | I am $years years old
4 |
--------------------------------------------------------------------------------
/test/convo/convos/welcome_multiple_botsteps_opt.convo.txt:
--------------------------------------------------------------------------------
1 | welcome multiple botsteps opt
2 |
3 | #me
4 | Welcome
5 |
6 | #bot
7 | Welcome
8 |
9 | #bot
10 | ?Select an option:
11 | CONVO_STEP_PARAMETERS {"stepTimeout": 300}
12 |
13 | #bot
14 | ?
15 | ?BUTTONS First Button|Second Button
16 | CONVO_STEP_PARAMETERS {"stepTimeout": 300}
17 |
18 | #me
19 | Thanks
20 |
21 | #bot
22 | Thanks
23 |
--------------------------------------------------------------------------------
/test/convo/failure.spec.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const assert = require('chai').assert
3 | const BotDriver = require('../..').BotDriver
4 | const Capabilities = require('../..').Capabilities
5 |
6 | const failingConnector = ({ queueBotSays }) => {
7 | return {
8 | UserSays (msg) {
9 | setTimeout(() => queueBotSays(new Error('something failed')), 0)
10 | }
11 | }
12 | }
13 |
14 | describe('convo.failure', function () {
15 | beforeEach(async function () {
16 | const myCaps = {
17 | [Capabilities.PROJECTNAME]: 'convo.failure',
18 | [Capabilities.CONTAINERMODE]: failingConnector
19 | }
20 | this.driver = new BotDriver(myCaps)
21 | this.compiler = this.driver.BuildCompiler()
22 | this.container = await this.driver.Build()
23 | await this.container.Start()
24 | })
25 | afterEach(async function () {
26 | await this.container.Stop()
27 | await this.container.Clean()
28 | })
29 |
30 | it('should fail', async function () {
31 | this.compiler.ReadScript(path.resolve(__dirname, 'convos'), '1step.convo.txt')
32 | try {
33 | await this.compiler.convos[0].Run(this.container)
34 | assert.fail('should have failed')
35 | } catch (err) {
36 | assert.isTrue(err.message.indexOf('something failed') >= 0)
37 | }
38 | })
39 | })
40 |
--------------------------------------------------------------------------------
/test/driver/configFiles/config1.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Botium Example 1",
5 | "ARR_CAP": ["val1", "val2"]
6 | },
7 | "Sources": {
8 | "GITURL": "https://github.com/codeforequity-at/botium-core"
9 | },
10 | "Envs": {
11 | "IS_BOTIUM_CONTAINER": false
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/test/driver/configFiles/config2.json:
--------------------------------------------------------------------------------
1 | {
2 | "botium": {
3 | "Capabilities": {
4 | "PROJECTNAME": "Botium Example 2",
5 | "ARR_CAP": ["val1", "val3"]
6 | },
7 | "Sources": {
8 | "GITURL": "https://github.com/codeforequity-at/botium-bindings"
9 | },
10 | "Envs": {
11 | "IS_BOTIUM_CONTAINER": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/test/helpers/convos/hello.convo.txt:
--------------------------------------------------------------------------------
1 | hello
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/logichooks/botium-asserter-fromfile.js:
--------------------------------------------------------------------------------
1 | module.exports = class DummyAsserter {
2 | assertConvoStep ({ botMsg }) {
3 | return (botMsg.messageText === 'Hello' ? Promise.resolve() : Promise.reject(new Error('expected Hello')))
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/logichooks/botium-connector-fromfile.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | PluginVersion: 1,
3 | PluginClass: (msg) => msg.messageText,
4 | PluginDesc: {
5 | name: 'Test Connector FromFile 1',
6 | provider: 'Botium'
7 | },
8 | PluginAsserters: {
9 | MyCustomAsserter: () => ({
10 | assertConvoStep: ({ botMsg }) => (botMsg.messageText === 'Hello' ? Promise.resolve() : Promise.reject(new Error('expected Hello')))
11 | })
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/test/logichooks/convos/HOOKFROMSRC.convo.txt:
--------------------------------------------------------------------------------
1 | HOOKFROMSRC
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | CUSTOMASSERTER
8 |
--------------------------------------------------------------------------------
/test/logichooks/convos/TEXTFROMBOTHOOK.convo.txt:
--------------------------------------------------------------------------------
1 | TEXTFROMBOTHOOK
2 |
3 | #me
4 | this is text from convo
5 |
6 | #bot
7 | SET_TEXT_FROM_HOOK this is text from hook
8 | this is text from hook
9 |
--------------------------------------------------------------------------------
/test/logichooks/convos/TEXTFROMHOOK.convo.txt:
--------------------------------------------------------------------------------
1 | TEXTFROMHOOK
2 |
3 | #me
4 | this is text from convo
5 | SET_TEXT_FROM_HOOK this is text from hook
6 |
7 | #bot
8 | this is text from hook
9 |
--------------------------------------------------------------------------------
/test/logichooks/convos/WAITFORBOT_1000.convo.txt:
--------------------------------------------------------------------------------
1 | WAITFORBOT 1000
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | WAITFORBOT 1000
8 | Hello
9 |
--------------------------------------------------------------------------------
/test/logichooks/convos/WAITFORBOT_1000_BEGIN.convo.txt:
--------------------------------------------------------------------------------
1 | WAITFORBOT 1000
2 |
3 | #begin
4 | WAITFORBOT 1000
5 |
6 | #bot
7 | Bot wont send anything
8 |
--------------------------------------------------------------------------------
/test/logichooks/convos/WAITFORBOT_1000_BOT_AND_END.convo.txt:
--------------------------------------------------------------------------------
1 | WAITFORBOT 1000
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Hello
8 |
9 | #end
10 | WAITFORBOT 1000
11 |
--------------------------------------------------------------------------------
/test/logichooks/convos/WAITFORBOT_1000_END.convo.txt:
--------------------------------------------------------------------------------
1 | WAITFORBOT 1000
2 |
3 | #me
4 | Hello
5 |
6 | #end
7 | WAITFORBOT 1000
8 |
--------------------------------------------------------------------------------
/test/logichooks/convos/WAITFORBOT_INFINITE.convo.txt:
--------------------------------------------------------------------------------
1 | WAITFORBOT INFINITE
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Hello
8 | WAITFORBOT
9 |
--------------------------------------------------------------------------------
/test/plugins/plugindir/fromfile/botium-connector-fromfile1.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | PluginVersion: 1,
3 | PluginClass: (msg) => msg.messageText,
4 | PluginDesc: {
5 | name: 'Test Connector FromFile 1',
6 | provider: 'Botium',
7 | capabilities: [
8 | {
9 | name: 'cap1',
10 | label: 'cap1',
11 | type: 'string',
12 | required: true
13 | }
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/test/plugins/plugindir/fromfile/botium-connector-fromfile2.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | PluginVersion: 1,
3 | PluginClass: ({ queueBotSays, caps }) => ({
4 | UserSays: (msg) => {
5 | setTimeout(() => queueBotSays({ messageText: (caps.cap1 || 'PRE') + ':' + msg.messageText }), 0)
6 | }
7 | }),
8 | PluginDesc: {
9 | name: 'Test Connector FromFile 2',
10 | provider: 'Botium',
11 | capabilities: [
12 | {
13 | name: 'cap1',
14 | label: 'cap1',
15 | type: 'string',
16 | required: true
17 | }
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/test/plugins/plugindir/fromfolder/botium-connector-fromdir1/index.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | PluginVersion: 1,
3 | PluginClass: (msg) => msg.messageText,
4 | PluginDesc: {
5 | name: 'Test Connector FromDir',
6 | provider: 'Botium',
7 | capabilities: [
8 | {
9 | name: 'cap1',
10 | label: 'cap1',
11 | type: 'string',
12 | required: true
13 | }
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/TEXT_GOOD.convo.txt:
--------------------------------------------------------------------------------
1 | TEXT_GOOD
2 | #me
3 | Hello1
4 |
5 | #bot
6 | TEXT You said Hello1
7 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_matchmode_failed.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_matchmode_failed
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | Hello
8 | CONVO_STEP_PARAMETERS {"matchingMode":"equals"}
9 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_matchmode_failed_wer.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_matchmode_failed_wer
2 |
3 | #me
4 | Hello1
5 |
6 | #bot
7 | You said Hello1 Hello2 Hello3 Hello4
8 | CONVO_STEP_PARAMETERS {"matchingMode":"wer","matchingModeWer":25}
9 |
10 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_optional_with_timeout.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_main_good
2 |
3 | #me
4 | Hello
5 |
6 | #bot
7 | You said Hello
8 |
9 | #bot
10 | ?Wrong answer
11 |
12 | #me
13 | Hello2
14 |
15 | #bot
16 | You said Hello2
17 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_asserters_all_good.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_asserters_good
2 |
3 | #me
4 | Hello
5 | Button
6 |
7 | #bot
8 | BUTTONS button1|button2
9 | CONVO_STEP_PARAMETERS {"ignoreNotMatchedBotResponses": {"timeout": 200, "allAsserters": true}}
10 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_asserters_botium_timeout.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_asserters_good
2 |
3 | #me
4 | Hello
5 | Button
6 |
7 | #bot
8 | BUTTONS button1|buttonXXXXXX
9 | CONVO_STEP_PARAMETERS {"ignoreNotMatchedBotResponses": {"timeout": 200, "asserters": ["BUTTONS"]}}
10 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_asserters_good.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_asserters_good
2 |
3 | #me
4 | Hello
5 | Button
6 |
7 | #bot
8 | BUTTONS button1|button2
9 | CONVO_STEP_PARAMETERS {"ignoreNotMatchedBotResponses": {"timeout": 200, "asserters": ["BUTTONS"]}}
10 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_asserters_good_global.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_asserters_good_global
2 |
3 |
4 | #me
5 | Hello1
6 | Intent
7 |
8 | #bot
9 | INTENT someIntent
10 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_main_and_asserter.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_main_and_asserter
2 |
3 | #me
4 | Butt
5 | Button
6 |
7 | #bot
8 | You said Butt
9 | BUTTONS button1|button2
10 | CONVO_STEP_PARAMETERS {"ignoreNotMatchedBotResponses": {"timeout": 200, "mainAsserter": true, "allAsserters": true}}
11 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_main_botium_timeout.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_main_botium_timeout
2 |
3 | #me
4 | Hello1
5 | Hello2
6 |
7 | #bot
8 | You said Hello3
9 | CONVO_STEP_PARAMETERS {"ignoreNotMatchedBotResponses": {"timeout": 200, "mainAsserter": true}}
10 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_main_but_no_button.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_main_but_no_button
2 |
3 | #me
4 | Hello1
5 | Hello2
6 |
7 | #bot
8 | You said Hello2
9 | BUTTONS some not existing button
10 | CONVO_STEP_PARAMETERS {"ignoreNotMatchedBotResponses": {"timeout": 200, "mainAsserter": true}}
11 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_main_good.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_main_good
2 |
3 | #me
4 | Hello1
5 | Hello2
6 |
7 | #bot
8 | You said Hello2
9 | CONVO_STEP_PARAMETERS {"ignoreNotMatchedBotResponses": {"timeout": 201, "mainAsserter": true}}
10 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/convo_step_parameter_retry_main_good_begin.convo.txt:
--------------------------------------------------------------------------------
1 | convo_step_parameter_retry_main_good_begin
2 |
3 | #begin
4 | CONVO_STEP_PARAMETERS {"ignoreNotMatchedBotResponses": {"timeout": 200, "mainAsserter": true}}
5 |
6 | #me
7 | Hello1
8 | Hello2
9 |
10 | #bot
11 | You said Hello2
12 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_nok_base.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_nok_base
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ALL word3
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_nok_ignore_case.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_nok_ignore_case
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ALL_IC Word3
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_nok_more_words.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_nok_more_words
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ALL word3|word4|word5
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_nok_more_words_partial_match.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_nok_more_words
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ALL word2|word3|word4
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_nok_negate.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_nok_negate
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - "!TEXT_CONTAINS_ALL word2"
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_nok_utterances.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_nok_utterances
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ALL word3|word4|GREETING
8 | utterances:
9 | GREETING:
10 | - hi
11 | - hello!
12 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_ok_base.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_ok_base
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ALL word2
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_ok_ignore_case.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_ok_ignore_case
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ALL_IC Word2
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_ok_more_words.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_ok_more_words
3 | steps:
4 | - me:
5 | - word1 word2 some other text
6 | - bot:
7 | - TEXT_CONTAINS_ALL word1|word2
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_ok_negate.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_ok_negate
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - "!TEXT_CONTAINS_ALL word2|word3"
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_all_ok_utterances.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_all_ok_utterances
3 | steps:
4 | - me:
5 | - Joe word1 word2 hi hello!
6 | - bot:
7 | - TEXT_CONTAINS_ALL word1|word2|GREETING
8 | utterances:
9 | GREETING:
10 | - hi
11 | - hello!
12 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_nok_base.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_nok_base
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ANY word3
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_nok_ignore_case.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_nok_ignore_case
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ANY_IC Word3
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_nok_more_words.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_nok_more_words
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ANY word3|word4|word5
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_nok_negate.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_nok_negate
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - "!TEXT_CONTAINS_ANY word2"
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_nok_utterances.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_nok_utterances
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ANY word3|word4|GREETING
8 | utterances:
9 | GREETING:
10 | - hi
11 | - hello!
12 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_ok_base.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_ok_base
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ANY word2
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_ok_ignore_case.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_ok_ignore_case
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ANY_IC Word2
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_ok_more_words.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_ok_more_words
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - TEXT_CONTAINS_ANY word2|word3|word4
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_ok_negate.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_ok_negate
3 | steps:
4 | - me:
5 | - word1 word2
6 | - bot:
7 | - "!TEXT_CONTAINS_ANY word3"
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_contains_any_ok_utterances.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_contains_any_ok_utterances
3 | steps:
4 | - me:
5 | - word1 word2 hi
6 | - bot:
7 | - TEXT_CONTAINS_ANY word3|word4|GREETING
8 | utterances:
9 | GREETING:
10 | - hi
11 | - hello!
12 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_equals_nok_base.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_equals_nok_base
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - TEXT_EQUALS Im Jane|Im George
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_equals_nok_utterances.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_equals_nok_utterances
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - TEXT_EQUALS GREETING_SENTENCES
8 | utterances:
9 | GREETING_SENTENCES:
10 | - Im Jane
11 | - Im George
12 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_equals_ok_base.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_equals_ok_base
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - TEXT_EQUALS Im Joe|Im George
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_equals_ok_ignore_case.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_equals_ok_base
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - TEXT_EQUALS_IC Im joe|Im George
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_equals_ok_utterances.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_equals_ok_utterances
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - TEXT_EQUALS GREETING_SENTENCES
8 | utterances:
9 | GREETING_SENTENCES:
10 | - Im Joe
11 | - Im George
12 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_nok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_nok
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - TEXT Im Jane|Im George
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_nok_no_arg.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_nok_no_arg
3 | steps:
4 | - me:
5 | - button
6 | - bot:
7 | - TEXT
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_nok_no_arg_negate.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_nok_no_arg_negate
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - "!TEXT"
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_ok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_ok
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - TEXT Im Joe|Im George
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_ok_no_arg.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_ok_no_arg
3 | steps:
4 | - me:
5 | - Im Joe
6 | - bot:
7 | - TEXT
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_ok_no_arg_negate.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_ok_no_arg_negate
3 | steps:
4 | - me:
5 | - button
6 | - bot:
7 | - "!TEXT"
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_regexp_all_nok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_regexp_all_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_REGEXP_ALL id2_\d\d\d|[0-9]+
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_regexp_all_ok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_regexp_all_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_REGEXP_ALL id1_\d\d\d|[0-9]+
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_regexp_any_nok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_regexp_any_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_REGEXP_ANY id2_\d\d\d|id3_\d\d\d
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_regexp_any_ok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_regexp_any_ok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_REGEXP_ANY id1_\d\d\d|id2_\d\d\d
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_wildcard_all_nok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_wildcard_all_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_WILDCARD_ALL id2_*3|1*5
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_wildcard_all_ok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_wildcard_all_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_WILDCARD_ALL id1_*3|1*5
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_wildcard_any_nok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_wildcard_any_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_WILDCARD_ANY id2_*3|id3_*3
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_wildcard_any_ok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_wildcard_any_ok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_WILDCARD_ANY id1_*3|id2_*3
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_wildcardexact_all_nok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_wildcardexact_all_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_WILDCARDEXACT_ALL Im Joe, my number is 12345, and my ID is id2_*3|Im Joe, my number is 1*5, and my ID is id1_123
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_wildcardexact_all_ok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_wildcardexact_all_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_WILDCARDEXACT_ALL Im Joe, my number is 12345, and my ID is id1_*3|Im Joe, my number is 1*5, and my ID is id1_123
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_wildcardexact_any_nok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_wildcardexact_any_nok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_WILDCARDEXACT_ANY Im Joe, my number is 12345, and my ID is id2_*3|Im Joe, my number is 12345, and my ID is id3_*3
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/text_wildcardexact_any_ok.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: text_wildcardexact_any_ok
3 | steps:
4 | - me:
5 | - Im Joe, my number is 12345, and my ID is id1_123
6 | - bot:
7 | - TEXT_WILDCARDEXACT_ANY Im Joe, my number is 12345, and my ID is id1_*3|Im Joe, my number is 12345, and my ID is id2_*3
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/wer_threshold_nok_float.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: wer_threshold_nok
3 | steps:
4 | - me:
5 | - test 123
6 | - bot:
7 | - TEXT_WER tast 123|0.1
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/wer_threshold_nok_percentage.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: wer_threshold_nok
3 | steps:
4 | - me:
5 | - test 123
6 | - bot:
7 | - TEXT_WER tast 123|10
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/wer_threshold_ok_float.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: wer_threshold_ok
3 | steps:
4 | - me:
5 | - test 123
6 | - bot:
7 | - TEXT_WER tast 123|0.6
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/wer_threshold_ok_percentage.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: wer_threshold_ok
3 | steps:
4 | - me:
5 | - test 123
6 | - bot:
7 | - TEXT_WER tast 123|60
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/wer_threshold_wildcard_nok_float.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: wer_threshold_wildcard_nok
3 | steps:
4 | - me:
5 | - This is an example
6 | - bot:
7 | - TEXT_WER * that are * hot|0.4
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/wer_threshold_wildcard_nok_percentage.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: wer_threshold_wildcard_nok
3 | steps:
4 | - me:
5 | - This is an example
6 | - bot:
7 | - TEXT_WER * is * hot|1
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/wer_threshold_wildcard_ok_float.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: wer_threshold_wildcard_ok
3 | steps:
4 | - me:
5 | - This is an example
6 | - bot:
7 | - TEXT_WER this is * sample|0.4
8 |
--------------------------------------------------------------------------------
/test/scripting/asserters/convos/wer_threshold_wildcard_ok_percentage.yml:
--------------------------------------------------------------------------------
1 | convos:
2 | - name: wer_threshold_wildcard_ok
3 | steps:
4 | - me:
5 | - This is an example
6 | - bot:
7 | - TEXT_WER this is another *|30
8 |
--------------------------------------------------------------------------------
/test/scripting/convos/.gitignore:
--------------------------------------------------------------------------------
1 | shouldignore
--------------------------------------------------------------------------------
/test/scripting/convos/convo1.convo.txt:
--------------------------------------------------------------------------------
1 | convo1
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/convos/convo2.convo.txt:
--------------------------------------------------------------------------------
1 | convo1
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/convos/shouldignore/convo3.convo.txt:
--------------------------------------------------------------------------------
1 | convo1
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/helper.spec.js:
--------------------------------------------------------------------------------
1 | const Capabilities = require('../../index').Capabilities
2 | const { normalizeText } = require('../../src/scripting/helper')
3 | const assert = require('chai').assert
4 |
5 | describe('scripting.helper', function () {
6 | describe('NormalizeText', function () {
7 | it('Basic', async function () {
8 | assert.equal(normalizeText('Hello!
And this is the body!!!', { [Capabilities.SCRIPTING_NORMALIZE_TEXT]: true }), 'Hello! And this is the body!!!')
9 | })
10 |
11 | it('Remove specific characters', async function () {
12 | // (,/,, +,-,//) -> ([",", "+", "-", "/"])
13 | assert.equal(normalizeText('Hello,!+-/
And this is the body!!!', { [Capabilities.SCRIPTING_NORMALIZE_TEXT_REMOVE_CHARACTERES]: ',/,, +,-,//' }), 'Hello!
And this is the body!!!')
14 | })
15 |
16 | it('Remove characters via multilang regex', async function () {
17 | // remove all emojis, currency symbols, and "`" character
18 | assert.equal(normalizeText('A ticket` to 大阪 costs ¥2000👌.', { [Capabilities.SCRIPTING_NORMALIZE_TEXT_REMOVE_REGEXP]: '[\\p{Emoji_Presentation}\\p{Currency_Symbol}`]' }), 'A ticket to 大阪 costs 2000.')
19 | })
20 | })
21 | })
22 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/CustomConditionalLogicHook.js:
--------------------------------------------------------------------------------
1 | module.exports = class ConditionalLogicHook {
2 | constructor (context, caps, globalArgs) {
3 | this.context = context
4 | this.caps = caps
5 | this.globalArgs = globalArgs
6 | }
7 |
8 | onBotPrepare ({ convo, convoStep, args }) {
9 | const conditionGroupId = args[1]
10 | let params
11 | try {
12 | params = JSON.parse(args[0])
13 | } catch (e) {
14 | throw new Error(`ConditionalCapabilityValueLogicHook: No parsable JSON object found in params: ${e}`)
15 | }
16 | convoStep.conditional = {
17 | conditionGroupId
18 | }
19 | convoStep.conditional.skip = params.skip
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/conditionalStepCapabilityValueBasedLogicHook.spec.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const BotDriver = require('../../../index').BotDriver
3 | const Capabilities = require('../../../index').Capabilities
4 |
5 | const echoConnector = ({ queueBotSays }) => {
6 | return {
7 | UserSays (msg) {
8 | const botMsg = { sender: 'bot', sourceData: msg.sourceData, messageText: msg.messageText }
9 | queueBotSays(botMsg)
10 | }
11 | }
12 | }
13 |
14 | describe('convo with capablility value based conditional logichook', function () {
15 | beforeEach(async function () {
16 | const myCaps = {
17 | [Capabilities.PROJECTNAME]: 'scripting.logichooks',
18 | [Capabilities.CONTAINERMODE]: echoConnector,
19 | [Capabilities.SCRIPTING_ENABLE_MEMORY]: true,
20 | SIMPLE_TEXT: 'echo1'
21 | }
22 | const driver = new BotDriver(myCaps)
23 | this.compiler = driver.BuildCompiler()
24 | this.container = await driver.Build()
25 | })
26 |
27 | afterEach(async function () {
28 | this.container && await this.container.Clean()
29 | })
30 |
31 | it('should success', async function () {
32 | this.compiler.ReadScript(path.resolve(__dirname, 'convos'), 'conditional_steps_cap_value_based.convo.txt')
33 | await this.compiler.convos[0].Run(this.container)
34 | })
35 | })
36 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/conditionalStepJsonPathBasedLogicHook.spec.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const BotDriver = require('../../../index').BotDriver
3 | const Capabilities = require('../../../index').Capabilities
4 |
5 | const echoConnector = ({ queueBotSays }) => {
6 | return {
7 | UserSays (msg) {
8 | const botMsg = { sender: 'bot', sourceData: msg.sourceData, messageText: msg.messageText }
9 | queueBotSays(botMsg)
10 | }
11 | }
12 | }
13 |
14 | describe('convo with capablility value based conditional logichook', function () {
15 | beforeEach(async function () {
16 | const myCaps = {
17 | [Capabilities.PROJECTNAME]: 'scripting.logichooks',
18 | [Capabilities.CONTAINERMODE]: echoConnector,
19 | [Capabilities.SCRIPTING_ENABLE_MEMORY]: true,
20 | SIMPLE_TEXT: 'echo1'
21 | }
22 | const driver = new BotDriver(myCaps)
23 | this.compiler = driver.BuildCompiler()
24 | this.container = await driver.Build()
25 | })
26 |
27 | afterEach(async function () {
28 | this.container && await this.container.Clean()
29 | })
30 |
31 | it('should success', async function () {
32 | this.compiler.ReadScript(path.resolve(__dirname, 'convos'), 'conditional_steps_json_path_based.convo.txt.convo.txt')
33 | await this.compiler.convos[0].Run(this.container)
34 | })
35 | })
36 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps.convo.txt:
--------------------------------------------------------------------------------
1 | custom embedded
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello should not assert
8 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G1
9 |
10 | #bot
11 | hello
12 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
13 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_business_hours.convo.txt:
--------------------------------------------------------------------------------
1 | conditional_steps_time_based
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello, it's business hours
8 | CONDITIONAL_STEP_BUSINESS_HOURS { "days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], "start":"8:00", "end": "16:30" }
9 |
10 | #bot
11 | hello, it's non-business hours
12 | CONDITIONAL_STEP_BUSINESS_HOURS { "days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], "start":"16:31", "end": "7:59" }
13 |
14 | #bot
15 | hello, it's non-business hours
16 | CONDITIONAL_STEP_BUSINESS_HOURS { "days": ["Saturday", "Sunday"] }
17 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_cap_value_based.convo.txt:
--------------------------------------------------------------------------------
1 | conditional_steps_time_based
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello
8 | CONDITIONAL_STEP_CAPABILITY_VALUE_BASED { "capabilityName":"SIMPLE_TEXT", "value": "echo1" }
9 |
10 | #bot
11 | fail
12 | CONDITIONAL_STEP_CAPABILITY_VALUE_BASED { "capabilityName":"SIMPLE_TEXT", "value": "echo2" }
13 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_followed_by_bot_msg.convo.txt:
--------------------------------------------------------------------------------
1 | custom embedded
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello should not assert
8 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G1
9 |
10 | #bot
11 | hello
12 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
13 |
14 | #bot
15 | hello Duplicate
16 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_followed_by_me.convo.txt:
--------------------------------------------------------------------------------
1 | custom embedded
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello should not assert
8 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G1
9 |
10 | #bot
11 | hello
12 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
13 |
14 | #me
15 | hello
16 |
17 | #bot
18 | hello
19 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_json_path_based.convo.txt.convo.txt:
--------------------------------------------------------------------------------
1 | conditional_steps_time_based
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello
8 | CONDITIONAL_STEP_JSON_PATH_BASED { "jsonPath":"$.messageText", "value": "hello" }
9 |
10 | #bot
11 | fail
12 | CONDITIONAL_STEP_JSON_PATH_BASED { "jsonPath":"$.messageText", "value": "fail" }
13 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_multiple_condition_groups.convo.txt:
--------------------------------------------------------------------------------
1 | custom embedded
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello should not assert
8 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G1
9 |
10 | #bot
11 | hello
12 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
13 |
14 | #bot
15 | hello Duplicate
16 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G2
17 |
18 | #bot
19 | hello should not assert
20 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G2
21 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_multiple_condition_groups_no_assertion.convo.txt:
--------------------------------------------------------------------------------
1 | custom embedded
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello
8 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
9 |
10 | #bot
11 | hello should not assert
12 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
13 |
14 | #bot
15 | hello
16 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G2
17 |
18 | #bot
19 | hello should not assert
20 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G2
21 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_multiple_mandatory_condition_groups.convo.txt:
--------------------------------------------------------------------------------
1 | custom embedded
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello should not assert
8 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G1
9 |
10 | #bot
11 | hello
12 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
13 |
14 | #bot
15 | hello should not assert
16 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G2
17 |
18 | #bot
19 | hello should not assert
20 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G2
21 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_multiple_optional_condition_groups.convo.txt:
--------------------------------------------------------------------------------
1 | custom embedded
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | ?hello
8 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
9 |
10 | #bot
11 | ?hello should not assert
12 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G1
13 |
14 | #bot
15 | ?hello 2
16 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":false }|G2
17 |
18 | #bot
19 | ?hello should not assert
20 | CONDITIONAL_STEP_LOGIC_HOOK { "skip":true }|G2
21 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/conditional_steps_time_based.convo.txt:
--------------------------------------------------------------------------------
1 | conditional_steps_time_based
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | hello, we are open
8 | CONDITIONAL_STEP_TIME_BASED { "start":"8:00", "end": "16:30" }
9 |
10 | #bot
11 | hello, we are closed
12 | CONDITIONAL_STEP_TIME_BASED { "start":"16:31", "end": "7:59" }
13 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/no_scripting_memory.convo.txt:
--------------------------------------------------------------------------------
1 | no scripting memory
2 |
3 | #begin
4 | hello
5 |
6 | #me
7 | hello
8 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_cleared_by_logic_hook.convo.txt:
--------------------------------------------------------------------------------
1 | cleared_by_logic_hook
2 | #begin
3 | SET_SCRIPTING_MEMORY cleared_by_logic_hook|cleared_by_logic_hook_from_begin
4 |
5 | #me
6 | CLEAR_SCRIPTING_MEMORY cleared_by_logic_hook
7 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_created_by_begin.convo.txt:
--------------------------------------------------------------------------------
1 | created_by_begin
2 | #begin
3 | SET_SCRIPTING_MEMORY created_by_begin|created_by_begin_from_begin
4 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_created_by_logic_hook.convo.txt:
--------------------------------------------------------------------------------
1 | created_by_logic_hook
2 |
3 | #me
4 | SET_SCRIPTING_MEMORY created_by_logic_hook|created_by_logic_hook_from_logic_hook
5 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_created_two_by_begin.convo.txt:
--------------------------------------------------------------------------------
1 | created_by_begin
2 | #begin
3 | SET_SCRIPTING_MEMORY created_by_begin_one|created_by_begin_one_from_begin
4 | SET_SCRIPTING_MEMORY created_by_begin_two|created_by_begin_two_from_begin
5 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_from_invalidjsonpath.convo.txt:
--------------------------------------------------------------------------------
1 | scripting_memory_from_invalidjsonpath
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | ASSIGN_SCRIPTING_MEMORY cardcontent|$.cards[0].nonexistingfield
8 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_from_jsonpath.convo.txt:
--------------------------------------------------------------------------------
1 | scripting_memory_from_jsonpath
2 |
3 | #me
4 | hello
5 |
6 | #bot
7 | ASSIGN_SCRIPTING_MEMORY cardcontent|$.cards[0].content
8 |
9 | #me
10 | $cardcontent
11 |
12 | #bot
13 | card content
14 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_numbers.convo.txt:
--------------------------------------------------------------------------------
1 | numbers
2 |
3 | #me
4 | Basics - $5,750.00
5 | House Rent Allowance - $650.00
6 |
7 | #bot
8 | Basics - $5,750.00
9 | House Rent Allowance - $650.00
10 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_overwrite_and_check.convo.txt:
--------------------------------------------------------------------------------
1 | overwrite and check
2 |
3 | #me
4 | this is a variable: VARVALUE1
5 |
6 | #bot
7 | this is a variable: $myvar
8 |
9 | #me
10 | this is a variable: VARVALUE2
11 |
12 | #bot
13 | this is a variable: $myvar
14 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_overwritten_by_begin.convo.txt:
--------------------------------------------------------------------------------
1 | overwritten_by_begin
2 |
3 | This is overwritten just if global defines it
4 |
5 | #begin
6 | SET_SCRIPTING_MEMORY created_by_global|created_by_global_from_begin
7 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_overwritten_by_convo.convo.txt:
--------------------------------------------------------------------------------
1 | overwritten_by_convo
2 | #begin
3 | SET_SCRIPTING_MEMORY overwritten_by_convo|overwritten_by_convo_from_begin
4 |
5 | #me
6 | this is a variable: $overwritten_by_convo
7 |
8 | #bot
9 | this is a variable: $overwritten_by_convo
10 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_overwritten_by_logic_hook.convo.txt:
--------------------------------------------------------------------------------
1 | overwritten_by_logic_hook
2 | #begin
3 | SET_SCRIPTING_MEMORY overwritten_by_logic_hook|overwritten_by_logic_hook_from_begin
4 |
5 | #me
6 | SET_SCRIPTING_MEMORY overwritten_by_logic_hook|overwritten_by_logic_hook_from_logic_hook
7 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_progress.convo.txt:
--------------------------------------------------------------------------------
1 | scripting_memory_progress
2 |
3 | #begin
4 | SET_SCRIPTING_MEMORY input|INPUT1
5 |
6 | #me
7 | sending input: $input
8 |
9 | #bot
10 | sending input: $input
11 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/scripting_memory_reserved_word.convo.txt:
--------------------------------------------------------------------------------
1 | reserved_word
2 | #begin
3 | SET_SCRIPTING_MEMORY year|2012
4 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/update_custom_me_msg_begin.convo.txt:
--------------------------------------------------------------------------------
1 | update_context_me_msg
2 |
3 | #begin
4 | UPDATE_CUSTOM simpleField|new message from begin
5 |
6 | #me
7 | HI
8 |
9 | #bot
10 | new message from begin
11 |
12 | #me
13 | one more step
14 |
15 | #bot
16 | new message from begin
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/update_custom_me_msg_depth2.convo.txt:
--------------------------------------------------------------------------------
1 | update_context_me_msg
2 | updating the me-message.
3 |
4 | #me
5 | HI
6 | UPDATE_CUSTOM depth1Field|depth2Field|new message
7 |
8 | #bot
9 | new message
10 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/update_custom_me_msg_global_simple.convo.txt:
--------------------------------------------------------------------------------
1 | update_context_global_me_msg
2 |
3 | #me
4 | HI
5 |
6 | #bot
7 | new message
8 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/update_custom_me_msg_json.convo.txt:
--------------------------------------------------------------------------------
1 | update_context_me_msg
2 | updating the me-message.
3 |
4 | #me
5 | HI
6 | UPDATE_CUSTOM aJsonField|{"msg": "new message"}
7 |
8 | #bot
9 | new message
10 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/update_custom_me_msg_mixed_struct.convo.txt:
--------------------------------------------------------------------------------
1 | update_context_me_msg
2 |
3 | #me
4 | update with scalar
5 | UPDATE_CUSTOM custom|scalar1
6 | UPDATE_CUSTOM custom|scalar2
7 | UPDATE_CUSTOM custom|scalar3
8 |
9 | #bot
10 |
11 | #me
12 | update with fields
13 | UPDATE_CUSTOM custom|field1|value1
14 | UPDATE_CUSTOM custom|field2|value2
15 |
16 | #bot
17 |
18 | #me
19 | add scalar to object
20 | UPDATE_CUSTOM custom|field1|value1
21 | UPDATE_CUSTOM custom|scalar1
22 |
23 | #bot
24 |
25 | #me
26 | add object to scalar
27 | UPDATE_CUSTOM custom|scalar1
28 | UPDATE_CUSTOM custom|field1|value1
29 |
30 | #bot
31 |
32 | #me
33 | add object to array
34 | UPDATE_CUSTOM custom|scalar1
35 | UPDATE_CUSTOM custom|scalar2
36 | UPDATE_CUSTOM custom|field1|value1
37 |
38 | #bot
39 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/update_custom_me_msg_simple.convo.txt:
--------------------------------------------------------------------------------
1 | update_context_me_msg
2 | updating the me-message.
3 |
4 | #me
5 | HI
6 | UPDATE_CUSTOM simpleField|new message 1
7 |
8 | #bot
9 | new message
10 |
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/update_custom_with_partial/update_custom.pconvo.txt:
--------------------------------------------------------------------------------
1 | update_custom_partial
2 |
3 | #me
4 | partial hi
5 |
6 | #bot
7 | new message from begin
--------------------------------------------------------------------------------
/test/scripting/logichooks/convos/update_custom_with_partial/update_custom_me_msg_begin.convo.txt:
--------------------------------------------------------------------------------
1 | update_custom_me_msg
2 |
3 | #begin
4 | UPDATE_CUSTOM simpleField|new message from begin
5 |
6 | #me
7 | HI
8 |
9 | #bot
10 | new message from begin
11 |
12 | #me
13 | INCLUDE update_custom_partial
14 |
--------------------------------------------------------------------------------
/test/scripting/matching/convos/regex.convo.txt:
--------------------------------------------------------------------------------
1 | 1 step
2 |
3 | #me
4 | my account balance is $15000.
5 |
6 | #bot
7 | my account balance is \$\d+.
8 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosAssertion/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | $productName $customer
5 |
6 | #bot
7 | $productName $customer
8 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosAssertion/product.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | |$productName |$customer
2 | product1|forcereplace1 |forcereplace2
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosCoverageAsserters/buy.convo.txt:
--------------------------------------------------------------------------------
1 | asserters
2 | should update asserter arguments
3 |
4 | #begin
5 |
6 | #me
7 | hello meatbag!
8 |
9 | #bot
10 | BUTTONS $productName
11 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosCoverageAsserters/product.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosCoverageAsserters/product.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosLogicHookCollision/buy.convo.txt:
--------------------------------------------------------------------------------
1 | logic hook collision
2 |
3 | #begin
4 | SET_SCRIPTING_MEMORY productName|productNameFormBegin
5 |
6 | #me
7 | $productName
8 |
9 | #bot
10 | You said: Wiener Schnitzel
11 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosLogicHookCollision/product.scriptingmemory.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosLogicHookCollision/product.scriptingmemory.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemory/convos/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | What can I order from you?
5 |
6 | #bot
7 | You can order $available_products
8 |
9 | #me
10 | Ok, then send me some $productName
11 |
12 | #bot
13 | Added $productName to the shopping cart
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemory/memory1/available.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $available_products
2 | product1| Bread, Beer, Eggs
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemory/memory1/products.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $productName
2 | product1| Bread
3 | product2| Beer
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryCaseNameCollision/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | What can I order from you?
5 |
6 | #bot
7 | You can order $available_products
8 |
9 | #me
10 | Ok, then send me some $productName
11 |
12 | #bot
13 | Added $productName to the shopping cart
14 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryCaseNameCollision/products1.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $productName
2 | product1 | Bread
3 | product2 | Beer
4 | product3 | Everything Else
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryCaseNameCollision/products2.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $productName
2 | product1| Hamburger
3 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryDifferent/available.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $available_products
2 | available1| Bread, Beer, Eggs
3 | available2| Foo, Bar
4 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryDifferent/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | What can I order from you?
5 |
6 | #bot
7 | You can order $available_products
8 |
9 | #me
10 | Ok, then send me some $productName
11 |
12 | #bot
13 | Added $productName to the shopping cart
14 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryDifferent/products.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $productName
2 | product1| Bread
3 | product2| Beer
4 | product3| Everything Else
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryIntersection/available.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $available_products
2 | available1| Bread, Beer, Eggs
3 | available2| Foo, Bar
4 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryIntersection/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | What can I order from you?
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryIntersection/products_and_available.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $productName | $available_products
2 | product1| Bread | Bread, Cheese
3 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryIntersection/somethingelse.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $somethingelse
2 | somethingelse1 | somethingelse1Val
3 | somethingelse2 | somethingelse2Val
4 | somethingelse3 | somethingelse3Val
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryNoName/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | What can I order from you?
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryNoName/products.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $productName
2 | | Bread
3 | product2 | Beer
4 | product3 | Everything Else
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryNoVariable/available.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $available_products
2 | available1| Bread, Beer, Eggs
3 | available2| Foo, Bar
4 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryNoVariable/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | What can I order from you?
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryNoVariable/products.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 |
2 | product1
3 | product2
4 | product3
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryNoVariableName/available.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $available_products
2 | available1| Bread, Beer, Eggs
3 | available2| Foo, Bar
4 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryNoVariableName/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | What can I order from you?
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemoryNoVariableName/products.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | |
2 | product1 | Bread
3 | product2 | Beer
4 | product3 | Everything Else
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemorySame/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | Ok, then send me some $productName
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemorySame/products1.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $productName
2 | productBread | Bread
3 | productBeer | Beer
4 | productEE | Everything Else
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemorySame/products2.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | $productName
2 | productHamburger | Hamburger
3 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemorySameCols/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #me
4 | Ok, then send me some $productName
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemorySameCols/products1.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | productBread | productBeer | productEE
2 | $productName | Bread | Beer | Everything Else
3 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosMultiMemorySameCols/products2.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | | productHamburger
2 | $productName | Hamburger
3 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosNoIntersection/buy.convo.txt:
--------------------------------------------------------------------------------
1 | no intersection
2 | If scripting memory has no variable from convo, then convo shold not multiplied
3 |
4 | #begin
5 |
6 | #me
7 | $notInScriptingMemory
8 |
9 | #bot
10 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosNoIntersection/product.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosNoIntersection/product.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosOneTable/buy.convo.txt:
--------------------------------------------------------------------------------
1 | one table
2 |
3 | #me
4 | buy $productName as $customerName
5 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosOneTable/cases.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosOneTable/cases.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosPartial/buy.convo.txt:
--------------------------------------------------------------------------------
1 | buy
2 |
3 | #begin
4 | INCLUDE sub1
5 |
6 | #include sub2
7 |
8 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosPartial/product.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | |$productName |$customer
2 | product1|schnitzel |attila
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosPartial/sub1.pconvo.txt:
--------------------------------------------------------------------------------
1 | sub1
2 |
3 | #me
4 | schnitzel
5 |
6 | #bot
7 | JSON_PATH $.request|$productName
8 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosPartial/sub2.pconvo.txt:
--------------------------------------------------------------------------------
1 | sub2
2 |
3 | #me
4 | attila
5 |
6 | #bot
7 | JSON_PATH $.request|$customer
8 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosReservedWord/buy.convo.txt:
--------------------------------------------------------------------------------
1 | value optional
2 |
3 | #me
4 | buy $productName as $customerName year $year
5 |
6 | #me
7 | buy $productName as $customerName year $year
8 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosReservedWord/cases.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosReservedWord/cases.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosSimple/buy.convo.txt:
--------------------------------------------------------------------------------
1 | simple
2 |
3 | #begin
4 |
5 | #me
6 | $productName
7 |
8 | #bot
9 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosSimple/product.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosSimple/product.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosSimpleCols/buy.convo.txt:
--------------------------------------------------------------------------------
1 | simple text
2 |
3 | #begin
4 |
5 | #me
6 | $productName $customer
7 |
8 | #bot
9 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosSimpleCols/product.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | |product1
2 | $productName |Wiener Schnitzel
3 | $customer |Joe
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosSimpleText/buy.convo.txt:
--------------------------------------------------------------------------------
1 | simple text
2 |
3 | #begin
4 |
5 | #me
6 | $productName $customer
7 |
8 | #bot
9 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosSimpleText/product.scriptingmemory.txt:
--------------------------------------------------------------------------------
1 | |$productName |$customer
2 | product1|Wiener Schnitzel|Joe
3 |
4 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosTwoTables/buy.convo.txt:
--------------------------------------------------------------------------------
1 | two table
2 |
3 | #me
4 | buy $productName as $customerName
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosTwoTables/customer.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosTwoTables/customer.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosTwoTables/product.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosTwoTables/product.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosTwoTablesCols/buy.convo.txt:
--------------------------------------------------------------------------------
1 | two table
2 |
3 | #me
4 | buy $productName as $customerName
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosTwoTablesCols/customer.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosTwoTablesCols/customer.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosTwoTablesCols/product.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosTwoTablesCols/product.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosValueOptional/buy.convo.txt:
--------------------------------------------------------------------------------
1 | value optional
2 |
3 | #me
4 | buy $productName as $customerName
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/convosValueOptional/cases.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/scriptingmemory/convosValueOptional/cases.xlsx
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/extractregexp/regexp.convo.txt:
--------------------------------------------------------------------------------
1 | regexp
2 |
3 | #me
4 | Hi John Doe! I'm a Chatbot. Type **Help**.
5 |
6 | #bot
7 | Hi John Doe! I'm a .*
8 |
9 | #me
10 | I found 7 documents matching your criteria.
11 |
12 | #bot
13 | I found $count documents matching your criteria.
14 |
15 | #me
16 | the number is $count
17 |
18 | #bot
19 | the number is 7
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/quoteregexp/regexp.convo.txt:
--------------------------------------------------------------------------------
1 | regexp
2 |
3 | #me
4 | Hi John Doe! I'm a Chatbot. Type **Help**.
5 |
6 | #bot
7 | Hi John Doe! I'm a .* Type \*\*Help\*\*\.
8 |
9 | #me
10 | I found 7 documents matching your criteria.
11 |
12 | #bot
13 | I found [0-9]+ documents matching your criteria.
--------------------------------------------------------------------------------
/test/scripting/scriptingmemory/scriptingVariablesSeveralEntries/buy.convo.txt:
--------------------------------------------------------------------------------
1 | scripting variables several entries
2 |
3 | #begin
4 | SET_SCRIPTING_MEMORY productName|Schnitzel
5 |
6 | #me
7 | What would you like to eat?
8 |
9 | #bot
10 | I'd like to have a $productName and one more $productName
--------------------------------------------------------------------------------
/test/scripting/skipconvos/SKIP.convo.convo.txt:
--------------------------------------------------------------------------------
1 | SKIP.convo
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/skipconvos/Skip-convo.convo.txt:
--------------------------------------------------------------------------------
1 | Skip-convo
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/skipconvos/convo-to-skip.convo.txt:
--------------------------------------------------------------------------------
1 | skip_convo
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/skipconvos/skipnotskipt.convo.txt:
--------------------------------------------------------------------------------
1 | skipnotskip
2 |
3 | #me
4 | hi
5 |
6 | #bot
7 |
--------------------------------------------------------------------------------
/test/scripting/skipconvos/sub/skip_it_no_header.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | hi
3 |
4 | #bot
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/botium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/userinputs/convos/botium.png
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/button.convo.txt:
--------------------------------------------------------------------------------
1 | button
2 |
3 | #me
4 | BUTTON ButtonPayload
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/buttonNoArg.convo.txt:
--------------------------------------------------------------------------------
1 | button
2 |
3 | #me
4 | BUTTON
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/buttonScript.convo.txt:
--------------------------------------------------------------------------------
1 | button
2 |
3 | #me
4 | hello world
5 |
6 | #bot
7 | $hello $world
8 |
9 | #me
10 | BUTTON Button: $hello $world
11 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/buttonTwoArgs.convo.txt:
--------------------------------------------------------------------------------
1 | button
2 |
3 | #me
4 | BUTTON ButtonPayload|ButtonText
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/files/botium0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/userinputs/convos/files/botium0.png
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/files/botium1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/userinputs/convos/files/botium1.png
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/files/botium2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/userinputs/convos/files/botium2.png
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/media.convo.txt:
--------------------------------------------------------------------------------
1 | media
2 |
3 | #me
4 | MEDIA botium.png
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/mediaNoArg.convo.txt:
--------------------------------------------------------------------------------
1 | media
2 |
3 | #me
4 | MEDIA
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/mediaOutOfBasedir.convo.txt:
--------------------------------------------------------------------------------
1 | mediaoutofbasedir
2 |
3 | #me
4 | MEDIA ../*.png
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/mediaOutOfConvoDir.convo.txt:
--------------------------------------------------------------------------------
1 | mediaoutofconvodir
2 |
3 | #me
4 | MEDIA ../botium.png
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/medialist.convo.txt:
--------------------------------------------------------------------------------
1 | medialist
2 |
3 | #me
4 | MEDIA test1.jpg|test2.jpg|test3.jpg
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/medias.convo.txt:
--------------------------------------------------------------------------------
1 | medias
2 |
3 | #me
4 | MEDIA test1.jpg
5 | MEDIA test2.jpg
6 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/mediawc.convo.txt:
--------------------------------------------------------------------------------
1 | mediawc
2 |
3 | #me
4 | MEDIA files/*.png
5 |
--------------------------------------------------------------------------------
/test/scripting/userinputs/convos/mediawcbasedir.convo.txt:
--------------------------------------------------------------------------------
1 | mediawcbasedir
2 |
3 | #me
4 | MEDIA *.png
5 |
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/convos/associate_utterances_by_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "convos": [
3 | {
4 | "name": "goodbye",
5 | "description": "desc of convo goodbye",
6 | "steps": [
7 | {
8 | "me": "UTT_GREETING"
9 | },
10 | {
11 | "bot": "hello"
12 | },
13 | {
14 | "me": "UTT_GOODBYE"
15 | },
16 | {
17 | "bot": "goodbye"
18 | }
19 | ]
20 | }
21 | ],
22 | "utterances": {
23 | "UTT_GREETING": [
24 | "hi",
25 | "hello!",
26 | "hey!"
27 | ],
28 | "UTT_GOODBYE": [
29 | "bye!",
30 | "goodbye!"
31 | ]
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/convos/media.convo.txt:
--------------------------------------------------------------------------------
1 | mediawc
2 |
3 | #me
4 | MEDIA files/step0*.wav
5 |
6 | #bot
7 | hello
8 |
9 | #me
10 | MEDIA files/step1*.wav
11 |
12 | #bot
13 | ok
14 |
15 | #me
16 | MEDIA files/step2*.wav
17 |
18 | #bot
19 | goodbye!
20 |
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step0voice0.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step0voice0.wav
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step0voice1.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step0voice1.wav
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step0voice2.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step0voice2.wav
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step1voice0.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step1voice0.wav
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step2voice0.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step2voice0.wav
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step2voice1.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step2voice1.wav
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step2voice2.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step2voice2.wav
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step2voice4.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step2voice4.wav
--------------------------------------------------------------------------------
/test/scripting/utteranceexpansion/files/step2voice5.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforequity-at/botium-core/8f2e19564d0c2c70761526ce7c06099031d1b9c7/test/scripting/utteranceexpansion/files/step2voice5.wav
--------------------------------------------------------------------------------
/test/security/convos/dummy.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | Hello
3 |
4 | #bot
5 | Hello
6 |
--------------------------------------------------------------------------------
/test/security/convos/media.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | MEDIA botium.png
3 |
--------------------------------------------------------------------------------
/test/security/convos/mediaasfile.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | MEDIA file://botium.png
3 |
--------------------------------------------------------------------------------
/test/security/convos/mediawildcard.convo.txt:
--------------------------------------------------------------------------------
1 | #me
2 | MEDIA *
3 |
--------------------------------------------------------------------------------
/test/security/resources/botium-asserter-as-file.js:
--------------------------------------------------------------------------------
1 | module.exports = class CustomAsserter {
2 | constructor (context, caps, globalArgs) {
3 | this.context = context
4 | this.caps = caps
5 | this.globalArgs = globalArgs
6 | }
7 |
8 | assertConvoBegin ({ convo, args, isGlobal }) {
9 | return Promise.resolve()
10 | }
11 |
12 | assertConvoStep ({ convo, convoStep, args, isGlobal, botMsg }) {
13 | return Promise.resolve()
14 | }
15 |
16 | assertConvoEnd ({ convo, transcript, args, isGlobal }) {
17 | return Promise.resolve()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/test/security/resources/botium-connector-as-file.js:
--------------------------------------------------------------------------------
1 | class ConnectorAsFile {
2 | constructor ({ queueBotSays }) {
3 | this.queueBotSays = queueBotSays
4 | }
5 |
6 | UserSays (msg) {
7 | const botMsg = { messageText: msg.messageText }
8 | setTimeout(() => this.queueBotSays(botMsg), 0)
9 | }
10 | }
11 |
12 | module.exports = {
13 | PluginVersion: 1,
14 | PluginClass: ConnectorAsFile
15 | }
16 |
--------------------------------------------------------------------------------
/test/security/resources/hook-as-file.js:
--------------------------------------------------------------------------------
1 | module.exports = () => null
2 |
--------------------------------------------------------------------------------