To make an HTTP request, just specify any valid HTTP method and a
target host.
Welcome to the Smokex documentation
Here you can find a collection of example code goodies to create your workflows
Overview
Smokex overview
Smokex provide a quick and easy way to create and automate HTTP requests to create smoke tests. These smoke tests can be used to validate deployment of a release, uptime, etc...
Main concepts
A workflow is a YAML content that defines a set of configured requests. Those requests will be executed either manually or automatically using a cron sentence.
A workflow supports asserting data from the responses of the requests and storing information in variables for further use.
Each execution sends the requests of a workflow and asserts the response using the defined specs.
It is possible to save data from a response into variables and reuse it on other requests. This is handy if you want to call an authentication endpoint and use the session token in subsequent requests.
Help us to be better
We keep improving Smokex and this documentation so if you have any feedback, got an idea, have any problem or suggestion you can contact us by email or using this form.
Examples
HTTP requests
Simple request
- get:
host: "https://smokex.io"
Headers
- get:
host: "https://smokex.io"
headers:
content-type: "application/json"
Query params
- get:
host: "https://smokex.io"
query:
search: "my-query-search"
filter: "all"
Adding a request body
- post:
host: "https://smokex.io"
body:
name: "Michael"
last-name: "Jordan"
number: 23
Request options
Set a request timeout
- get:
host: "https://smokex.io"
options:
timeout: 2000
Retry a failed request connection
- get:
host: "https://smokex.io"
options:
retries: 5
Follow server redirections
- get:
host: "http://smokex.io"
options:
follow_redirects: true
Expects
Status code
- post:
host: "https://smokex.io"
body:
name: "Michael"
last-name: "Jordan"
number: 23
expect:
status_code: 200
Headers
- post:
host: "https://smokex.io"
body:
name: "Michael"
last-name: "Jordan"
number: 23
expect:
headers:
content-type: "application/json"
Response body as JSON
- get:
host: "https://smokex.io"
query:
id: 23
expect:
json:
available: true
status: "healthy"
stats:
points: 734
rebounds: 458
Response body as string
- get:
host: "https://smokex.io"
query:
id: 23
expect:
string: "{ \"available\": true, \"status\": \"healthy\", \"stats\": { \"points\": 723, \"rebounds\": 458 } }"
Response body HTML
- get:
host: "https://smokex.io"
query:
id: 23
expect:
html:
- path: "a.button:nth-child(2)"
equal: "Sign up"
- path: "ul.is-size-7:nth-child(2) > li:nth-child(5) > a:nth-child(1)"
equal: "Blog"
Variables
Save data from response
- post:
host: "https://smokex.io"
body:
name: "Michael"
last-name: "Jordan"
number: 23
save_from_response:
- variable_name: "current_points"
json_path: "stats.points"
- put:
host: "https://smokex.io/players/23"
body:
points: ${current_points}