简体   繁体   English

如何指定我想要在 Botium Box 中的字符串之间完全匹配(Watson 助手)

[英]How to specify that I want an exact match between strings in Botium Box (Watson Assistant)

I am having the following issue while testing the dialogues of my Watson Assistant skill in Botium Box: it looks like some test cases pass with success even though there is not an exact match between the expected response and the actual response of the bot.在 Botium Box 中测试我的 Watson Assistant 技能的对话时,我遇到了以下问题:即使预期响应与机器人的实际响应之间没有完全匹配,一些测试用例似乎也成功通过了。 It seems that a test case passes successfully if the expected text is a substring in the actual answer from the bot.如果预期文本是机器人实际答案中的子字符串,则测试用例似乎成功通过。

Is there a way to specify that I want a exact match?有没有办法指定我想要完全匹配?

Example: If the expected response is: "Hello my name is John, how can help you?"示例:如果预期的响应是: “你好,我叫约翰,有什么可以帮助你的?” but the actual response is: "Hello my name is John, how can help you today?"但实际的回应是: “你好,我叫约翰,今天有什么可以帮助你的吗?”

botium box will mark this test cased as passed. botium box 会将此测试用例标记为通过。

Is there a way to specify that I want an exact match between the two strings?有没有办法指定我想要两个字符串之间的完全匹配?

The default matching mode in Botium is wildcardIgnoreCase , which is a kind of simple regular expression mode (* matches everything) - more in the Botium Wiki . Botium 中的默认匹配模式是wildcardIgnoreCase ,这是一种简单的正则表达式模式(* 匹配所有内容) - 更多信息请参见 Botium Wiki This mode does substring matching as well, but you can change it in the Advanced Scripting Settings of Botium Box.此模式也进行子字符串匹配,但您可以在 Botium Box 的高级脚本设置中更改它。

Instead of configuring the matching mode globally, you can also decide to use on of the text asserters , so the test case would look like this:除了全局配置匹配模式之外,您还可以决定使用文本 asserters 中的一个,因此测试用例将如下所示:

asserter

#me
hello

#bot
TEXT_CONTAINS_ALL_IC hello|my name is john

I prepared a repl.it as demo.我准备了一个repl.it作为演示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM