This repository is no longer actively maintained, please see
See the codeThis repository is no longer actively maintained, please see https://github.com/for-GET/katt

KATT (Klarna API Testing Tool) is an HTTP-based API testing tool for Erlang.
Use for shooting HTTP requests in a sequential order and verifying the response. Any relevant difference between expected and actual responses will cause a failure.
The builtin validator supports basic text validation and more advanced validation of HTTP headers and JSON structures.
The validator makes use of a few tags with special meaning:
"{{_}}"
Match anything (i.e. no real validation, only check existence).
"{{unexpected}}"
Match nothing (i.e. no real validation, only check lack of existence)
"{{>key}}"
Store value of the whole string (key must be unique within testcase)
"{{<key}}"
Recall stored value.
The "{{_}}" tag can also be used as a JSON object's property in order to
validate any other additional properties.
By default, the builtin validator will allow additional properties in an object
structure, or additional items in an array structure. To counteract that
default, one can do {..., "{{_}}": "{{unexpected}}"} or
[..., "{{unexpected}}"], effectively making a rule that no properties/items
are expected beyond the ones defined.
A simple example that will make requests to a third party server:
ERL_LIBS=deps erl -pa ebin -noshell -eval '
ok = ssl:start(),
ok = lhttpc:start(),
BlueprintFile = "./doc/example-httpbin.apib",
Params = [{hostname, "httpbin.org"}, {my_name, "Joe"}, {your_name, "Mike"}],
io:format("~p~n", [katt:run(BlueprintFile, Params)]).
' -s init stop
... or run the code passed to -eval from the Erlang shell (assuming that you
have started the Erlang shell from the repo's root directory with ERL_LIBS=deps erl -pa ebin).
katt:run to be called with
filenameparams (optional)
protocolhostnameportrequest_timeoutscenario_timeoutcallbacks (optional)
recall to be called with syntax, text, params, callbacksparse to be called with headers, body, params, callbacksrequest to be called with request, params, callbacksvalidate to be called with expected, actual, params, callbacksA pull-request is most welcome. Please make sure that the following criteria are fulfilled before making your pull-request:
Erlang
98.0%
Makefile
2.0%
This repository is no longer actively maintained, please see
See the codeThis repository is no longer actively maintained, please see https://github.com/for-GET/katt

KATT (Klarna API Testing Tool) is an HTTP-based API testing tool for Erlang.
Use for shooting HTTP requests in a sequential order and verifying the response. Any relevant difference between expected and actual responses will cause a failure.
The builtin validator supports basic text validation and more advanced validation of HTTP headers and JSON structures.
The validator makes use of a few tags with special meaning:
"{{_}}"
Match anything (i.e. no real validation, only check existence).
"{{unexpected}}"
Match nothing (i.e. no real validation, only check lack of existence)
"{{>key}}"
Store value of the whole string (key must be unique within testcase)
"{{<key}}"
Recall stored value.
The "{{_}}" tag can also be used as a JSON object's property in order to
validate any other additional properties.
By default, the builtin validator will allow additional properties in an object
structure, or additional items in an array structure. To counteract that
default, one can do {..., "{{_}}": "{{unexpected}}"} or
[..., "{{unexpected}}"], effectively making a rule that no properties/items
are expected beyond the ones defined.
A simple example that will make requests to a third party server:
ERL_LIBS=deps erl -pa ebin -noshell -eval '
ok = ssl:start(),
ok = lhttpc:start(),
BlueprintFile = "./doc/example-httpbin.apib",
Params = [{hostname, "httpbin.org"}, {my_name, "Joe"}, {your_name, "Mike"}],
io:format("~p~n", [katt:run(BlueprintFile, Params)]).
' -s init stop
... or run the code passed to -eval from the Erlang shell (assuming that you
have started the Erlang shell from the repo's root directory with ERL_LIBS=deps erl -pa ebin).
katt:run to be called with
filenameparams (optional)
protocolhostnameportrequest_timeoutscenario_timeoutcallbacks (optional)
recall to be called with syntax, text, params, callbacksparse to be called with headers, body, params, callbacksrequest to be called with request, params, callbacksvalidate to be called with expected, actual, params, callbacksA pull-request is most welcome. Please make sure that the following criteria are fulfilled before making your pull-request:
Erlang
98.0%
Makefile
2.0%