directline-jabber
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

npm Build Status Coverage Status

DirectLine Jabber

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.

Prerequisites

  • node.js v10+
  • a deployed bot instance
  • a Direct Line channel

Commandline arguments

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

Authentication

Secret

You can use the secret key that comes with your Direct Line channel in your Azure bot channels registration.

Token

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.

Installation

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] 

Testing

$ npm test

Sample

There is a complete tutorial available: https://github.com/jvanderbiest/directline-jabber-demo

Preprocessing

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.

UserId

You could use a fixed user id in activities or use a prefix for each user id.

Azure Devops Pipeline Task

There is a task available on the Visual Studio Marketplace to use for automated testing. Pipeline source can be found here

License

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.

Package Sidebar

Install

npm i directline-jabber

Weekly Downloads

3

Version

2.0.1

License

MIT

Unpacked Size

208 kB

Total Files

71

Last publish

Collaborators

  • jvanderbiest