0

I am running botium test for Google Dialogflow using Mocha as a test runner. Due to some reporting requirements, I forked botium-binding, but I am unable to retrieve the bot message.

Are there any hooks to retrieve the bot message while the test runs?

I am aware of the below construct, but it doesn't look like this code is called while Mocha runs the test.

WaitBotSays (...args) {
    if (this.container) {
        return this.container.WaitBotSays(...args)
    } else {
        return Promise.reject(new Error('Botium Initialization failed. Please see error messages above (enable debug logging).'))
    }
}

I also tried to call WaitBotSays from this.compiler.convos.forEach((convo) => {...} but it seems to wait for the bot to respond and not proceed with the next step in the conversation.

namchedev
  • 35
  • 4

1 Answers1

0

Maybe there is a way to do this without forking.

You could add your own Logic Hook to Botium to intercept the bot responses, see here for a sample. Or this one. Also there is a sample in the Botium Wiki.

Or you could inject your own logic with the custom hooks interface.

Florian Treml
  • 1,315
  • 2
  • 7
  • 10
  • Thanks! I will take a look and get back with my findings. I do have custom asserters that use the bot message, but didn't find a way to export it to out for reporting. The perfecto example looks like what I need to do. – namchedev Jun 12 '20 at 17:35