Skip to content

hunkimForks/botium-cli

 
 

Repository files navigation

Botium CLI - The Selenium for Chatbots

NPM

Codeship Status for codeforequity-at/botium-cli npm version license

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!

How do I get help ?

  • 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).

Installation

> npm install -g botium-cli

See below to see instructions how to use the Botium CLI docker image

Usage

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

Botium Capabilities configuration

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,
      ....
    }
  }
}

Commands

botium-cli init

Prepare a directory for Botium usage:

  • Adds a simple botium.json
  • Adds a sample convo file

botium-cli init-dev [asserter|logichook]

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

botium-cli run

Automatically run all your scripted conversations against your chatbot and output a test report

botium-cli *import

Import conversation scripts or utterances from some source (for example, from IBM Watson workspace)

botium-cli emulator

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:

Browser Emulator

The Botium Browser Emulator provides a simple browser interface to record and organize your test cases, and to interact with your Chatbot.

Botium Browser Emulator

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

Console Emulator

The Botium Console Emulator is a basic command line interface to your chatbot running within Botium. You can record and save your conversation files.

Botium Console Emulator

Running it is simple:

$ botium-cli emulator console

Using the Botium CLI docker image

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

About

Botium CLI - The Selenium for Chatbots

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 77.7%
  • HTML 19.3%
  • CSS 1.6%
  • Dockerfile 1.4%