我正在尝试使用以下设置连接到直线:
botium_directline.json:
{
"botium": {
"Capabilities": {
"PROJECTNAME": "botium-sample1",
"CONTAINERMODE": "directline3",
"DIRECTLINE3_SECRET": "<BOTIUM_SECRET>",
"DIRECTLINE3_WEBSOCKET": true
},
"Sources": {},
"Envs": {
"NODE_TLS_REJECT_UNAUTHORIZED": 0
}
}
}
文件夹结构:
如果我跑步:
botium-cli emulator browser --convos ./spec/convos --config ./botium_directline.json
在新的对话中,我可以与机器人进行通信。
如果我想运行准备的测试,则会收到以下超时信息:
botium-cli run --convos ./spec/convos/ --config ./botium_directline.json
user @ /Users/username/workspace/testing/botium
~~ npm test
> botium@1.0.0 test /Users/username/workspace/testing/botium
> botium-cli run --convos ./spec/convos/ --config ./botium_directline.json
Botium Test-Suite
1) Test One
2) Test Two
0 passing (4s)
2 failing
1) Botium Test-Suite
Test One:
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
2) Botium Test-Suite
Test Two:
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
该错误与标准的Mocha超时错误类似,但我不知道将 .js 文件放在哪里以增加beforeEach中的超时。
我试图将BOTIUM_TIMEOUT或TIMEOUT属性都添加到botium_directline.json
中,但这没做任何事情。
任何想法如何增加超时时间?
答案 0 :(得分:1)
Botium自动化测试的默认超时为60000毫秒,但是您可以通过在CLI命令末尾传递--timeout标志来对其进行自定义。
要执行此操作,只需添加标志--timeout,然后添加您要为其设置的时间(以毫秒为单位)。例如,对于100000毫秒,您的命令应如下所示:botium-cli emulator browser --convos ./spec/convos --config ./botium_directline.json --timeout 100000
答案 1 :(得分:0)
“ BOTIUM_TIMEOUT”功能是正确的选择,或者您可以对botium-cli使用“ --timeout”命令行开关。仅在某些日子以来,此功能才可用,其中涉及一个has been fixed的错误。请获取botium-cli的内部版本0.0.34:
npm install botium-cli@0.0.34