That's a very simple CLI that executes requests in order and make assertions against results. It loads the workflow from a yaml file
workflow:
- request: Access httpbin
method: GET
url: https://httpbin.org/get
retry_period: 2
assertion:
name: Expect code 200
expectedcode: 200
onfailure: retry
- request: Access google
method: GET
url: https://google.com
retry_period: 2
assertion:
name: Expect code 200
expectedcode: 200
onfailure: retry
- request: Post a message to httpbin
method: POST
url: https://httpbin.org/post
body: '{"message": "hello world"}'
retry_period: 2
assertion:
name: Expect code 200
expectedcode: 200
onfailure: retry
Within the root folder, execute the command bellow
go run cmd/main.go < sample/workflow.yml
(Optional) You can also run it from the latest docker image
docker run -i victoraldir/http_workflow < workflow-edge.yml