Currenly i am using single botium.json file to run my chatbot test suite. Is there any way where can i specify multiple botium.json file to run my test suite in one by one and multiple test suite same like I can change my convo directory using spec file. if so Please help. I have tried below 2 options
1。我已经创建了insuranceBotium.json文件以及其他botium configuratino文件。如何编写代码以使用所有配置文件执行所有测试套件
const BotiumBindings = require('botium-bindings')
const BotDriver = require('botium-core').BotDriver
const Capabilities = require('botium-core').Capabilities
const Source = require('botium-core').Source
const driver = new BotDriver()
.setCapability(Capabilities.PROJECTNAME, 'core-CreateNewConversation')
.setCapability(Capabilities.CONTAINERMODE , 'watson')
.setCapability(Capabilities.WATSON_APIKEY, '')
.setCapability(Capabilities.WATSON_WORKSPACE_ID, '')
.setCapability(Capabilities.WATSON_URL, 'https://gateway-lon.watsonplatform.net/assistant/api')
.setCapability(Capabilities.WATSON_COPY_WORKSPACE, false)
const bb = new BotiumBindings({botiumConfig:driver , convodirs: [ './spec/convo/Insurance' ]})
BotiumBindings.helper.mocha().setupMochaTestSuite({ bb })
答案 0 :(得分:0)
最简单的解决方案是在botium.spec.js中设置BOTIUM_CONFIG环境变量:
const BotiumBindings = require('botium-bindings')
process.env.BOTIUM_CONFIG='./botium-1.json'
const bb = new BotiumBindings({convodirs: ['./spec/convo/Insurance' ]})
BotiumBindings.helper.mocha().setupMochaTestSuite({ bb })
您可以有多个* .spec.js文件,每个文件都指向另一个botium.json和另一组convo文件。