Module katt

Klarna API Testing Tool.

Copyright © 2012- Klarna AB, AUTHORS

Description

Klarna API Testing Tool

Use for shooting http requests in a sequential order and verifying the response.

Data Types

callbacks()

callbacks() = [{atom(), function()}]

details()

details() = any()

http_header()

http_header() = {string(), string()}

katt_blueprint()

katt_blueprint() = #katt_blueprint{filename = file:filename() | null, name = utf8_string() | null, description = utf8_string() | null, transactions = [#katt_transaction{description = utf8_string() | null, params = katt_transaction_params(), request = #katt_request{method = string(), url = string(), headers = [http_header()], body = binary() | null}, response = #katt_response{status = integer(), headers = [http_header()], body = binary() | null, parsed_body = any()}}], footer = utf8_string() | null}

katt_transaction_param_name()

katt_transaction_param_name() = string()

katt_transaction_param_value()

katt_transaction_param_value() = atom() | integer() | float() | string() | binary()

katt_transaction_params()

katt_transaction_params() = [{katt_transaction_param_name(), katt_transaction_param_value()}]

param_name()

param_name() = string() | atom()

param_value()

param_value() = atom() | integer() | float() | string() | binary()

params()

params() = [{param_name(), param_value()}]

reason()

reason() = atom()

run_error()

run_error() = {error, reason(), details()}

run_result()

run_result() = run_error() | scenario_result()

scenario()

scenario() = file:filename() | katt_blueprint()

scenario_result()

scenario_result() = {pass | fail, file:filename(), params(), params(), [transaction_result()]}

transaction_result()

transaction_result() = {string(), params(), #katt_request{method = string(), url = string(), headers = [http_header()], body = binary() | null}, #katt_response{status = integer(), headers = [http_header()], body = binary() | null, parsed_body = any()}, validation_result()}

utf8_string()

utf8_string() = unicode:unicode_binary()

validation_failure()

validation_failure() = {reason(), details()}

validation_result()

validation_result() = pass | {fail, [validation_failure()]}

Function Index

main/1Run from CLI with arguments.
run/1Run test scenario.
run/2Run test scenario.
run/3Run test scenario.

Function Details

main/1

main(Args::[string()]) -> ok | {error, katt_bare_mode}

Run from CLI with arguments.

run/1

run(Scenario::scenario()) -> run_result()

Run test scenario. Argument is the full path to the scenario file, a KATT Blueprint file, or the KATT Blueprint itself.

run/2

run(Scenario::scenario(), Params::params()) -> run_result()

Run test scenario. Argument is the full path to the scenario file, a KATT Blueprint file, or the KATT Blueprint itself.

run/3

run(Scenario::scenario(), ScenarioParams::params(), ScenarioCallbacks::callbacks()) -> run_result()

Run test scenario. First argument is the full path to the scenario file, a KATT Blueprint file, or the KATT Blueprint itself. Second argument is a key-value list of parameters, such as hostname, port. You can also pass custom variable names (atoms) and values (strings). Third argument is a key-value list of custom callbacks such as a custom parser to use instead of the built-in default parser (maybe_parse_body).


Generated by EDoc