Botium is the Selenium for chatbots. Botium CLI is the swiss army knife of Botium.
IF YOU LIKE WHAT YOU SEE, PLEASE CONSIDER GIVING US A STAR ON GITHUB!
- Read the Botium in a Nutshell series
- If you think you found a bug in Botium, please use the Github issue tracker.
- The documentation on a very technical level can be found in the Botium Wiki.
- For asking questions please use Stackoverflow - we are monitoring and answering questions there.
- For our VIP users, there is also a Slack workspace available (coming soon).
> npm install -g botium-cli
See below to see instructions how to use the Botium CLI docker image
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!
Prepare and run a simple Botium test case:
> botium-cli init
> botium-cli run
Got get help on the command line options:
> botium-cli help
The chatbot capabilities are described in a configuration file. By default, the file named "botium.json" in the current directory is used, but it can be specified with the "--config" command line parameter. The configuration file holds capabilities, envs and sources. Configuration via environment variables is supported as well.
{
"botium": {
"Capabilities": {
"PROJECTNAME": "botium-sample1",
....
},
"Sources: {
....
},
"Envs": {
"NODE_TLS_REJECT_UNAUTHORIZED": 0,
....
}
}
}
Prepare a directory for Botium usage:
- Adds a simple botium.json
- Adds a sample convo file
Setup a development project for Botium asserters or logic hooks in the current directory:
- Adds a Javascript source file with the skeleton code
- Adds a botium.json with asserter/logic hook registration
- Adds a sample convo file
Automatically run all your scripted conversations against your chatbot and output a test report
Import conversation scripts or utterances from some source (for example, from IBM Watson workspace)
Especially with structured messages, it can become uncomfortable to write conversation files manually. Botium contains two emulators to support you with browsing and writing your conversation files:
The Botium Browser Emulator provides a simple browser interface to record and organize your test cases, and to interact with your Chatbot.
Running it is simple:
$ botium-cli emulator browser
To specify directory holding your convo files and to specify the configuration file:
$ botium-cli emulator browser --convos=./spec/convo --config=./spec/botium.json
The Botium Console Emulator is a basic command line interface to your chatbot running within Botium. You can record and save your conversation files.
Running it is simple:
$ botium-cli emulator console
Instead of installing the NPM package, you can use the Botium CLI docker image instead:
$ docker run --rm -v $(pwd):/app/workdir botium/botium-cli
You can use all commands as described above. Special considerations:
- You cannot use absolute pathes, but all pathes should be given relative to the current working directory. The current working directory is mapped to the docker container with the -v switch (above this is mapped to the current working directory)
- For running the console emulator, you will have to add the -it flag to the docker command to enable terminal interactions:
$ docker run --rm -v $(pwd):/app/workdir -it botium/botium-cli emulator browser
- For running the browser emulator, you will have to expose the emulator port from the docker container by adding the -p 3000:3000 switch:
$ docker run --rm -v $(pwd):/app/workdir -p 3000:3000 botium/botium-cli emulator browser