如何 运行 针对 watson 的简单 botium 测试

How to run a simple botium test against watson

我正在尝试 botium 测试 wiki 之后的 watson 助手。

运行:

一步一步我做了什么:

这是我的 package.json:

{
  "name": "botium",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "emulator": "botium-cli emulator console --convos ./spec/convos --config ./botium.json",
    "emulatorBrowser": "botium-cli emulator browser --convos ./spec/convos --config ./botium.json"
  },
  "author": "",
  "license": "ISC"
}

这是我的 botium.json:

{
    "botium": {
      "Capabilities": {
        "PROJECTNAME": "botium-sample1",
        "CONTAINERMODE": "watsonconversation",
        "WATSON_URL": "https://gateway-fra.watsonplatform.net/assistant/api",
        "WATSON_USER": "<WATSON_USER_ID>",
        "WATSON_PASSWORD": "<WATSON_PASSWORD",
        "WATSON_WORKSPACE_ID": "<WATSON_WORKSPACE_ID>"
      },
      "Sources": {},
      "Envs": {
        "NODE_TLS_REJECT_UNAUTHORIZED": 0
      }
    }
}

预期行为:

当我执行 npm run emulator 时,我希望 botium 将 spec/convos/captain.convo.txt 中指定的话语发送给 watson,并将其与指定的测试进行比较。

实际行为:

Error: Loading Botium plugin failed
    at Validate.Validate.then (/Users/user/workspace/testing/botium/node_modules/botium-cli/node_modules/botium-core/src/containers/PluginConnectorContainer.js:56:15)
    at <anonymous>

CONTAINERMODE 功能应设置为 "watson":

{
    "botium": {
      "Capabilities": {
        ...
        "CONTAINERMODE": "watson",
        ...
    },
    ...
}

对于以前版本的 Botium,容器模式 "watsonconversation" 没问题,但这已被更改。仍然有一些使用旧容器模式的示例,它们将不再工作。

有关支持的功能的详细信息,请参阅 Botium Wiki