To process flows you have to create a controller object by execution of WSTester.Controller function with dictionary as an argument. The dictionary may contain the following fields:
flows – array of flows (each flow is an array or a dictionary with unit objects). Required property.
server – URL of WebSockets server. Required property.
waiting_time – waiting time before current unit fails if there is no appropriate message found. Default value: 2000 (2 seconds).
delay – amount of time before between end of one unit and beginning of another. Default value: 0.
split – if set, each flow gets a new WebSockets connection. Default value: false.
add – function for output, have the following arguments: string for output and an integer number, type of the output. The type may be: 0 (general info), 1 (content of sent and received messages), 2 (good news), and 3 (bad news, errors).
work_begin – function that is called every time new WebSocket connection established. Therefore, depending on the value of split, the function may be called on the start of first or each flow. It takes no arguments.
work_end – function that is called after completion of all the flows. It takes these numbers as arguments: count of passed flows, count of failed flows, and total number of the flows.