自动测试Microsoft Bot Framework [英] Auto testing for Microsoft Bot Framework

查看:97
本文介绍了自动测试Microsoft Bot Framework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在使用Microsoft Bot Framework和ASP.NET开发第一个机器人.

I'm working now on my first bot with Microsoft Bot Framework, with ASP.NET.

在使用机器人模拟器进行手动测试之后,我正在寻找为机器人创建自动测试的最佳方法.

After manually testing with the bot emulator, I'm looking for the best method to create automatic testing for the bot.

考虑两个问题:

  1. 自动执行此类测试的最佳工具是什么?
  2. 测试可以向同一输入返回不同答案的对话框的最佳方法是什么?

推荐答案

一种替代方法是使用DirectLine进行功能测试.需要注意的是,该机器人需要托管,但功能强大.查看 AzureBot测试项目,以了解其工作原理.

One alternative is doing functional tests using DirectLine. The caveat is that the bot needs to be hosted but it's powerfull. Check out the AzureBot tests project to see how this works.

另一种替代方法是执行BotFramework团队对其某些单元测试所做的工作.

Another alternative, is doing what the BotFramework team is doing for some of their unit tests.

如果使用的是对话框,则可以查看

If you are using Dialogs, you can take a look to the EchoBot unit tests as they are simple to follow.

如果您使用的是Chain,请看看它们如何使用AssertScriptAsync方法.

If you are using Chain, then take a look to how their are using the AssertScriptAsync method.

https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Builder.Tests/ChainTests.cs#L538

如果您正在寻找一种模拟Luis Service的方法,请参见

If you are looking for a way to mock up Luis Service, see this.

这篇关于自动测试Microsoft Bot Framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆