Carla Test Helper v0.1.14 CarlaTestHelper View Source

Carla test helper

Link to this section Summary

Functions

Macro to help easily define a set a list of assertions to test against the bot. carlatest will accept a name and a list of assertion functions and return a new function with the given name that accepts 2 parameters

Get the adapter based on the bot version

Get the adapter specified in the config file

Link to this section Functions

Link to this macro carlatest(name, list) View Source (macro)

Macro to help easily define a set a list of assertions to test against the bot. carlatest will accept a name and a list of assertion functions and return a new function with the given name that accepts 2 parameters.

The resulting function’s parameters:

  • uuid - The uuid of the user to use when testing the list of assertions.
  • state (defaults to %{}) - The state to setup for the user before running tests.

The macro’s assertions argument is a expected to be a list of assertion functions. This macro will take the list of functions and iterate through each one and call them. This allows the user of the macro to define a conversation test case like so:

carlatest "request details optima", do: [
  message("optima", "request.details.optima"),
  quick_reply("Build & Price", "build:_optima"),
]
Link to this function get_adapter() View Source
get_adapter() :: module()

Get the adapter based on the bot version

Link to this function get_bot_version() View Source
get_bot_version() :: atom()

Get the adapter specified in the config file

Returns a Response object.