Bot Testing Framework

Using this frame work we can be able to generate test flows using web UI or Command Line Interface and we can be able to test these flow using flowId.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

The things you need to install the software and how to install them

Node Modules used in this project

Flow of Diagram of Bot testing

Installing

copy this module in root folder of your project.

lets assume your project folder is $myProject i will be refferring it later

you can configure following files according to your project


1. configuring testConf

$myProject/botTesting/conf/testConf.js


2. Entry point for starting web test Server (where you can generate and test flows)

$myProject/botTesting/src/test.js


3. you can edit what to test in responses from bot

$myProject/botTesting/src/fb_test/fbTest.js

4. Starting testWebServer


Generation Of testData and testing of testData from web UI

start the testServer as explained above and head to http://127.0.0.1:8888/web

The web UI

The above page showing welcome messages and some buttons in left side

creating a new flow

In order to create new flow by clicking on Create New Flow button as shown below

fill the required information to create a flowDetails

appId, senderId and pageId are required fields

flowId and flowDetails are optional fields

once done with it click on Create Flow Details

you will get a chatwindow as shown below where you can send messages to generate test Data

once you completed the chat you can save the testData by clicking save Active Flow

viewing saved flow details and testing

Inorder to view a particular flow click on flowId in left side as shown below

Then to test this flow click on Test Flow

It will start testing flow showing the test status for each messages in flow as shown below

finally after ending of test it will shows the passed and faield test count as show below

Response for Each Message tested

for each messages tested we will get following JSON containing fields which is self explanatory.

{
  "title": "Testing Flow => <flow_1513768580988, message {3}>",
  "responseTime": 588,
  "timedOut": false,
  "duration": 4,
  "state": "passed",
  "speed": "fast",
  "flowId": "flow_1513768580988",
  "messageId": "3",
  "info": {
    "function": "checkEachMessage",
    "clientMessageFormat": {
      "type": "text",
      "text": "bye",
      "senderId": "1",
      "pageId": "2",
      "appId": "2"
    },
    "timeoutSet": 30000,
    "timeoutSet_": "bot may respond late so at max timeout 30 second and we are also noting responsetime",
    "responseTime": 588,
    "response": [
      {
        "recipient": {
          "id": "1"
        },
        "message": {
          "text": "Bye."
        }
      }
    ],
    "savedResponse": [
      {
        "recipient": {
          "id": "1"
        },
        "message": {
          "text": "Till next time!"
        }
      }
    ]
  }
}

Deployment

follow installation steps

Contributing

Contribute to make it more reliable and usefull for testing…

Authors