1

Would like to know if there is anyway to perform a card button click use the Botium framework - https://github.com/codeforequity-at/botium-core.

For example i have a bot that returns a carousel of cards, each card has a load of buttons attached to it, i want to be able to trigger a click of that button within the conversation spec.

Here is example processed response being given back to Botium framework:

  "cards":[
  {
     "text":"Card 1",
     "buttons":[
        {
           "text":"Learn more",
           "payload":"a custom payload"
        },
        {
           "text":"Other button",
           "payload":"a custom other payload"
        }
     ]
  },
  {
     "text":"Card 2",
     "buttons":[
        {
           "text":"More Stuff,
           "payload":"a custom payload for card 2"
        }
     ]
  }
 ]

And below is example of the spec test file.

#me
Hello

#bot
CARDS Card 1 | Card 2
BUTTONS Learn More | Other button | More Stuff

#me
BUTTON Learn More

My expectation from this test above is that when the #me user send BUTTON click for 'Learn More' it will take the payload from the button attached to 'Card 1' with the title 'Learn More' and send that to the bot over api.

So in this case it would send: {"text":"Learn more", "payload":"a custom payload"}

Is this possible ?

Also i understand that i could just specify the payload like so within the spec file

#me
BUTTON Learn More|a custom payload

But i don't want to do this as it's not fully testing the bot, i want to be sure that my bot payloads are configured correctly and not supply the payloads as that would defeat the purpose of the test entirely.

1 Answers1

0

Right now, this is not supported in Botium, but it makes totally sense.

It would be possible to plug in a custom component to do what you described - see Botium Wiki for an introduction.

Florian Treml
  • 1,315
  • 2
  • 7
  • 10
  • I have looked into custom asserters, problem i had with those is that the only event that receives a transcript of conversation is assertConvoEnd, here im looking to use the transcript not at the end but on a assertConvoStep. From digging around in core code it would be great if when defining your own custom user input that the call to setUserInput in Convo.js passes in the current transcript so that all user-input asserts have option to crawl transcripts bot messages to collect correct payload etc. – Cameron Newby Apr 29 '20 at 12:53