Git Product home page Git Product logo

directline-jabber's Introduction

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

Directline Jabber

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.

directline-jabber's People

Contributors

jvanderbiest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

directline-jabber's Issues

Use fixed userId or userId prefix

When sending out activities to the bot, we might want to replace the userid in the transcript by a fixed userId or prefix the existing userId with a value.

Support events

Support for custom events to send out prior to the conversation

mimic emulator behavior

Try to have an emulator channelId that is used with the emulator too. It might have different results with bots.

Support Chatdown input folder

Instead of supporting only files, let the user have the option to specify a folder that contains all the Chatdown files.

Support attachments by file

When specifying the attachment option in Chatdown, the image gets embedded if it's a local URL. This embedded image will fail when sending to DirectLine because of a 300K character limit. We should be able to somehow host it and send it with the request.

Support DirectLine token instead of DirectLine secret

We don't expect users to have access to the DirectLine secret directly. As a best practice the DirectLine secret should never be exposed but instead an access token is generated by an API call and send back to the user.

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.