A node is the basic building block of an Apibot test. Every node has a different function which is determined by node’s parent graph.
Every node in Apibot is an instance of either a builtin graph such as the HTTP request or a user made graph (e.g. a graph made by you!).
A node’s behavior is determined by the node’s parent. If node A
’s parent is B
we say that node A
is an instance of graph B
.
Every node in Apibot is a function that takes a scope as input and returns a scope. The function can be anything, from making an HTTP request and appending the HTTP request/response to the scope, to a function that appends some values to the scope.
Every graph can be re-used in other graphs by creating instances of the graph. The following screenshots illustrate this point.
Graph #1
contains two nodes. The first one makes an HTTP request the second one makes an assertion.
Graph #2
contains an instance of Graph #1
. This is a very simple yet powerful way to achieve reusability. If Graph #1
were a very common operation in your business (e.g. authentication), you can use this technique to simplify your Apibot graphs.