I had downloaded the botium luis connector sample code from github and trying out in botium cli with one of my bot . see the folder to see the files that here.and in package.json i have given a name from the brand Luis entity and in my convo file i have a question and answer from the entity products. i tried to run the npm install and npm test from the folder spec in cmd ,

I am getting an error says assertion failed ,but in actual scenario those question and answer are working good in bot. Please see the error E:\Botium_workspace\botium-connector-luis-master\botium-connector-luis-master\samples\Connector Test\spec>npm test

E:\Botium_workspace\botium-connector-luis-master\botium-connector-luis-master\samples\Connector Test\spec>npm test

[email protected] test E:\Botium_workspace\botium-connector-luis-master\botium-connector-luis-master\samples\Connector Test mocha spec

EdgewellBrandLuis-Dev 1) composite entities

0 passing (2s) 1 failing

1) EdgewellBrandLuis-Dev composite entities: Error: composite entities/Line 6: Expected bot response (on Line 3: #me - What are the materials of the handle?) "undefined" to match one of "The handle is made up of Synthetic Rubber and aluminum plating. The Travel Case is made up of polypropylene. It does not contain other commonly questioned products such as latex, fragrances, whey, gluten, or animal products."

ASSERTION FAILED in TextMatchAsserter - Expected: ["The handle is made up of Synthetic Rubber and aluminum plating. The Travel Case is made up of polypropylene. It does not contain other commonly questioned products such as latex, fragrances, whey, gluten, or animal products."] - Actual: empty INPUT: What are the materials of the handle?

npm ERR! Test failed. See above for more details.

please see the screenshot.

Is there anything that I had to do other than doing the below steps 1)wrote a botium.json file with all the Capabilities and (the name of the project should be the name of the Luis App right ?) 2)write the test cases 3)set the package .json as

4)npm install

5)npm test

6)also tried running botium cli run from the spec folder path

1

There are 1 answers

3
Florian Treml On

The Botium LUIS Connector does not work with plain text - LUIS is only for intent and entity resolution. There won't be any plain text answers to assert in your test cases, but you have to use the INTENT and ENTITY asserters instead:

composite entities

#me
want to buy 2 business ticket

#bot
INTENT buy_ticket
ENTITIES TestCompositeEntity.builtin.number|TestCompositeEntity.TravelClass
ENTITY_VALUES 2|Business

2020-04-08: Updated for more details

So you have a LUIS workspace with intents, entities and entity synonyms. My suggestions are:

  1. Use Botium Scripting Memory to list all synonyms for a product you want to test:
     |$product          
Utt1 |Sense Shave cream
Utt2 |Sense cream
Utt3 |Hydro shave cream

Scripting Memory has to be enabled separately, see Botium Wiki link above

  1. For all user examples for an intent you want to test, use utterances lists - you can use the synonym list here:
UTT_ABOUT_PRODUCT
tell me about $product
about the $product
i am interested in $product
can you tell me something about $product
  1. A convo file (the test case) uses the utterances and the Botium NLP Asserters for NLP verification:
TC01_ABOUT_PRODUCT

#me
UTT_ABOUT_PRODUCT

#bot
INTENT AboutProduct
INTENT_CONFIDENCE 70
ENTITIES Products

It checks for * the correct intent * a baseline intent confidence * an entity has been recognized

You can also use YAML instead of plain text:

convos:
  - name: TC01_ABOUT_PRODUCT
    steps:
      - me:
          - UTT_ABOUT_PRODUCT
      - bot:
          - INTENT AboutProduct
          - INTENT_CONFIDENCE 70
          - ENTITIES Products
utterances:
  UTT_ABOUT_PRODUCT:
    - tell me about $product
    - about the $product
    - i am interested in $product
    - can you tell me something about $product