DSL – Test Definition Syntax

Axotly uses a simple, readable DSL to describe HTTP tests.
A test is defined as a block, starting with TEST and ending with END.

This document explains how a test is structured, how requests are defined, and how Axotly interprets each part.


Basic Test Structure

TEST <test name>
  <METHOD> <URL>
  <HEADERS>

  BODY
  <REQUEST BODY>
  BODYEND
END

TEST Block

Syntax

TEST <test name>

Description

  • TEST starts a new test block
  • <test name> is a free-form string
  • The test name is used for:

    • Test reporting
    • CLI output
    • Error messages

Example

TEST POST create a resource

HTTP Request Line

Syntax

<METHOD> <URL>

Description

  • Must appear immediately after the TEST line
  • Defines the HTTP request to execute

METHOD

Supported HTTP methods:

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE
  • HEAD
  • OPTIONS

URL

  • Must be a valid absolute URL
  • Query parameters should be included directly in the URL

Example

POST https://httpbin.org/post

Headers

Syntax

Header-Name: Header-Value

Description

  • Headers are written one per line
  • Appear after the request line
  • Continue until another block keyword is found (BODY, EXPECT, or END)
  • Header names are case-insensitive

Example

Content-Type: application/json
Authorization: Bearer my-token

Headers are optional. If no headers are provided, the request is sent without headers.


Request Body

Syntax

BODY
<raw body content>
BODYEND

Description

  • BODY marks the start of the request body
  • BODYEND marks the end of the request body
  • Everything between them is sent exactly as written
  • Axotly does not transform or validate the body content

Common body formats include:

  • JSON
  • XML
  • Plain text

Example

BODY
{
  "name": "Axotly",
  "role": "tester"
}
BODYEND

Notes

  • The body is optional
  • Commonly used with POST, PUT, and PATCH
  • The body format should match the Content-Type header

END Keyword

Syntax

END

Description

  • Marks the end of the test block
  • Required for every test
  • Axotly will not execute a test without a closing END

Full Example

TEST POST create a resource
  POST https://httpbin.org/post
  Content-Type: application/json

  BODY
  {
    "name": "Axotly",
    "role": "tester"
  }
  BODYEND

  EXPECT status == 200
  EXPECT body.json.name == "Axotly"
  EXPECT body.json.role == "tester"
END

The EXPECT section is documented separately.


Parsing Rules Summary

Element Required Notes
TEST Yes Starts a test block
Test name Yes Free-form string
HTTP method Yes Must be valid
URL Yes Must be absolute
Headers No One per line
BODY / BODYEND No Raw request body
END Yes Closes the test