codeforequity-at / botium-core

The Selenium for Chatbots - Bots Testing Bots
https://www.botium.ai
MIT License
229 stars 64 forks source link

Expected bot response "" to match one of "" #102

Closed ptedeschi closed 5 years ago

ptedeschi commented 6 years ago

When botium-cli tries to match an empty property from json data in convos, it fails:

Expected bot response "" to match one of ""

It happens when a bot shows only cards and carrousels but no text. Ex.:

...
...
"from": {
    "id": "mybot-channel-reg",
    "name": "mybot"
  },
  "conversation": {
    "id": "(.*?)"
  },
  "text":"",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.hero",
      "content": {
...
...

Tested with the following config file:

{
  "botium": {
    "Capabilities": {
      "PROJECTNAME": "mybot",
      "CONTAINERMODE": "directline3",
      "SCRIPTING_MATCHING_MODE": "regexp",
      "DIRECTLINE3_SECRET": "mysecret",
      "DIRECTLINE3_WEBSOCKET": true,
      "DIRECTLINE3_POLLINGINTERVAL": 1000
    }
  }
}
codeforequity-at commented 6 years ago

For validating attachments, it's possible to add a JSON structure to the convo scripts, which is matched to the message received (https://github.com/codeforequity-at/botium-core/wiki/Botium-Scripting#structured-messages). Is this what you are looking for ?

DipaliK9 commented 6 years ago

I am also facing the same issue. However, I think it is not about convo file. Bot Response is not getting captured. Bot response says undefined, if it consists of button or image.

codeforequity-at commented 6 years ago

The best way to get forward on this is to enable debug mode (see https://github.com/codeforequity-at/botium-core/wiki/Troubleshooting) to actually see the traffic happening between Botium and your Bot. Can you please do this and attach the log output here.

codeforequity-at commented 6 years ago

From the Logfile I can see that the traffic is actually happening - by the way, the original question was about directline connector, you are using the fbdirect connector.

The problem is most likely that the convo file doesn't reflect what's actually happening in the bot, that's why it fails. Botium is not yet that strong when it comes to rich messages with attachments and pictures.

codeforequity-at commented 6 years ago

I deleted your post with the logfile above, as the attached file contained your facebook password.

DipaliK9 commented 6 years ago

Thank you so much.. I really appreciate it. I mistakenly missed to delete it.

codeforequity-at commented 5 years ago

this has been fixed with the latest build.