Giter Site home page Giter Site logo

amazon-lex-bot-test's Introduction

amazon-lex-bot-test

This is an example script to demonstrate how one can regression test an Amazon Lex bot. It relies on the AWS SDK and the Amazon Lex Runtime Service API.

The user must have IAM permissions to invoke the API functions (e.g., AmazonLexReadOnly).

To install

# git clone ...
# npm install

To use

$ node testlexbot.js <TestConfigFile>
# examples:
# node testlexbot.js test/CoffeeBot-main.json
# node testlexbot.js test/CoffeeBot-main.json 2>&1 > results.txt
# node testlexbot.js test/CoffeeBot-main.json 2>&1 > results.txt && ./bin/summarizeResults.sh results.txt

License

This sample code is made available under the MIT-0 license. See the LICENSE file.

amazon-lex-bot-test's People

Contributors

hyandell avatar jpeddicord avatar markatwood avatar nhira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

amazon-lex-bot-test's Issues

NotFoundException thrown for BotAlias name

Hi,

I used the teslexbot.js file from here to test our chatbot with modified tests in json file. But I get the Notfoundexception.

-----------------------test.json file below---------------------------------------------

{
"name": "KotahiBot-main",
"description": "Regression tests for the Kotahi bot",
"botName": "KotahiChatbot_Redo",
"botAlias": "BETA",
"waitBetweenRequestsMillis": 0,
"sequences": [{
"name": "Hello_Kotahi",
"description": "Greetings from Kotahi Chatbot",
"sequence": [{
"utterance": "Hi",
"postConditions": {
"message": ["Hi! I'm your Kotahi chatbotassistant!"]
}
},
{
"utterance": "where is my container",
"postConditions": {
"message": ["Sure! What is your case number\?"]
}
},
{
"utterance": "00000102",
"postConditions": {
"message": ["I'm sorry. Unexpected problem occurred while I was searching for your case. Please call our service center."]
}
}
]
}]
}
-----------------------------See the error log here..--------------------------------

$ node testlexbot.js test/test1.json
I Running test cases from test/test1.json for KotahiChatbot_Redo:TERMINATOR - KotahiBot-main
I Test sequence 1 / 1 - Hello_Kotahi
botAlias: TERMINATOR

  • Sequence [undefined] FAILED! ~ {"message":"postText call failed with NotFoundException: There is no alias named TERMINATOR for the bot named K
    otahiChatbot_Redo. Choose another alias.","requestId":null,"sequence":{"utterance":"Hi","postConditions":{"message":["Hi! I'm your Kotahi chatbot
    assistant!"]}},"params":{"botAlias":"TERMINATOR","botName":"KotahiChatbot_Redo","userId":"KotahiChatbot_Redo-Hello_Kotahi-1526512000361","session
    Attributes":{},"inputText":"Hi"},"lexResponse":null}
    { NotFoundException: There is no alias named TERMINATOR for the bot named KotahiChatbot_Redo. Choose another alias.
    at Object.extractError (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\protocol\json.js:48:27)
    at Request.extractError (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\protocol\rest_json.js:52:8)
    at Request.callListeners (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\sequential_executor.js:105:20)
    at Request.emit (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\sequential_executor.js:77:10)
    at Request.emit (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\request.js:683:14)
    at Request.transition (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\state_machine.js:14:12)
    at C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\state_machine.js:26:10
    at Request. (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\request.js:38:9)
    at Request. (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\request.js:685:12)
    message: 'There is no alias named TERMINATOR for the bot named KotahiChatbot_Redo. Choose another alias.',
    code: 'NotFoundException',
    time: 2018-05-16T23:06:41.223Z,
    requestId: 'cb3419c5-595d-11e8-8caa-ebda79e2c29f',
    statusCode: 404,
    retryable: false,
    retryDelay: 83.07497330243108 } 'NotFoundException: There is no alias named TERMINATOR for the bot named KotahiChatbot_Redo. Choose another ali
    as.\n at Object.extractError (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\protocol\json.js:48:27)\n at Request.extractErr
    or (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\protocol\rest_json.js:52:8)\n at Request.callListeners (C:\Alexa\Hive\kot
    ahi_chatbot\node_modules\aws-sdk\lib\sequential_executor.js:105:20)\n at Request.emit (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-
    sdk\lib\sequential_executor.js:77:10)\n at Request.emit (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\request.js:683:14)\n
    at Request.transition (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\request.js:22:10)\n at AcceptorStateMachine.runTo (C:\A
    lexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\state_machine.js:14:12)\n at C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\l
    ib\state_machine.js:26:10\n at Request. (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\request.js:38:9)\n at Req
    uest. (C:\Alexa\Hive\kotahi_chatbot\node_modules\aws-sdk\lib\request.js:685:12)'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.