DirectLine-Jabber focusses on automated integration testing for the Microsoft BotFramework. Using your BotFramework emulator transcript files it will check if your bot responds as it is supposed to respond.
It tests your conversations by authenticating and sending the activities over Direct Line.
- node.js v10+
- a deployed bot instance
- a Direct Line channel
Command | Flag | Description | Remarks |
---|---|---|---|
--files |
transcript file(s) to test. | Comma seperate for multiple | |
--dirs |
directory or directories with transcript files to test | Comma seperate for multiple | |
--preprocess |
activities to process prior to the actual conversation file | ||
--userid |
-u |
replaces user id in activities | |
--useridprefix |
prefixes userId in activities | ||
--secret |
directline secret for authentication | Mutually exclusive with endpoint |
|
--endpoint |
endpoint to retrieve directline token | Mutually exclusive with secret |
|
--recursive |
-r |
recursivly scanning for files in directory' | defaults to true |
--verbose |
-v |
enables verbose logging | defaults to false |
You can use the secret key that comes with your Direct Line channel in your Azure bot channels registration.
If your bot exposes a token endpoint that generates a token from the directlineSecret you can use that. Your token endpoint response response should be a token object {token: ''}
, a token string or a stringified token string. Click here for a demo implementation.
Install the dependencies and start the app.
$ cd directline-jabber
$ npm install
Run examples:
$ node app test --files <filePath,...> --secret [directLineSecret]
$ node app test --dirs <directory,...> --endpoint [tokenEndpoint]
$ npm test
There is a complete tutorial available: https://github.com/jvanderbiest/directline-jabber-demo
In case you need to execute other activities prior to your conversation activities, you can use the preproccess flag to specify the activities file. This could be used to send custom events before your tests are executing.
You could use a fixed user id in activities or use a prefix for each user id.
There is a task available on the Visual Studio Marketplace to use for automated testing. Pipeline source can be found here
DirectLine-Jabber is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the application. But you always need to state that this repository is the original author of this application.