Botium Connector for Botkit
npm install botium-connector-botkit


![license]()
This is a Botium connector for testing your Botkit chatbot.
__Did you read the Botium in a Nutshell articles ? Be warned, without prior knowledge of Botium you won't be able to properly use this library!__
This connector calls the webhook URL of botkit.
This webhook can be there even if your chatbot uses Websocket. You can set it in Botkit constructor:
```
const controller = new Botkit({
webhook_uri: '/api/messages',
...
})
There was a major change in Botkit. Botkit Anywhere is deprecated, and core lib version is changed from 0.7 to 4.0.
Botium supports officially __Botkit Core version 0.7 with Botkit Anywhere__ or
__Botkit Core version 4.0 with Botkit App created by Yeoman generator__,
but may work with __Botkit Core version 4.0 with Botkit Anywhere__.
You can set your Botkit environment using __BOTKIT_VERSION__ capability.
__Botium Botkit Connector 0.0.3 and below works just with the old Botkit stack!!!__
It can be used as any other Botium connector with all Botium Stack components:
* Botium CLI
* Botium Bindings
* Botium Box
* __Node.js and NPM__
* a __Botkit Anywhere Server__, or __Botkit server created by Yeoman generator__
* a __project directory__ on your workstation to hold test cases and Botium configuration
When using __Botium CLI__:
``
> npm install -g botium-cli
> npm install -g botium-connector-botkit
> botium-cli init
> botium-cli run
When using __Botium Bindings__:
``
> npm install -g botium-bindings
> npm install -g botium-connector-botkit
> botium-bindings init mocha
> npm install && npm run mocha
When using __Botium Box__:
_Already integrated into Botium Box, no setup required_
Open the file _botium.json_ in your working directory and add the Botkit chatbot connection settings.
``
{
"botium": {
"Capabilities": {
"PROJECTNAME": "
"CONTAINERMODE": "botkit",
"BOTKIT_VERSION": "BOTKIT_4_0",
"BOTKIT_URL": "..."
}
}
}
Botium setup is ready, you can begin to write your BotiumScript files.
Set the capability __CONTAINERMODE__ to __botkit__ to activate this connector.
`ANYWHERE_AND_BOTKIT_0_7_AND_BELOW`
Botkit stack. Set it to `BOTKIT_4_0`` to use the new.
The two versions are using different capabilities, see below.
Botkit server webhook URL. The only required capability using the new stack
You can use all other _Generic HTTP(S)/JSON Connector_ capabilities.
For example via __BOTKIT_4_0_HEADERS_TEMPLATE__ you can use __SIMPLEREST_HEADERS_TEMPLATE__ capability to customize the HTTP header.
The Botkit server url (without any path, just http/https, servername, port)
If set, this userId will be used. Otherwise, for each convo a new userId is generated.