alixt 0.5.0

A command line http API testing utility with TOML configuration
Documentation
# Run 1: A full suite of passing tests
[[runs]]
name = "Full Passing Suite"
url = "0.0.0.0"
port = 7878

headers = { "Content-Type" = "application/json" }


  [[runs.requests]]
  name = "Add testuser1"
  method = "Post"
  target = "/accounts"
  body = '''{ "username": "testuser1", "role": "User" }'''
  [runs.requests.assert]
  status = 200
  breaking = true

  [[runs.requests]]
  name = "Add testuser2"
  method = "Post"
  target = "/accounts"
  body = '''{ "username": "testuser2", "role": "User" }'''
  [runs.requests.assert]
  status = 200
  breaking = true

  [[runs.requests]]
  name = "Add testuser3"
  method = "Post"
  target = "/accounts"
  body = '''{ "username": "testuser3", "role": "User" }'''
  [runs.requests.assert]
  status = 200
  breaking = true

  [[runs.requests]]
  name = "Add testuser4"
  method = "Post"
  target = "/accounts"
  body = '''{ "username": "testuser4", "role": "User" }'''
  [runs.requests.assert]
  status = 200
  breaking = true

  [[runs.requests]]
  name = "Remove third account"
  method = "Delete"
  target = "/accounts/3"
  [runs.requests.assert]
  status = 204 # Correct status for successful delete
  breaking = true

  [[runs.requests]]
  name = "Get list after delete"
  method = "Get"
  target = "/accounts"
  [runs.requests.assert]
  status = 200
  breaking = true
  body = '''
  [
    {"id": 1, "username": "testuser1", "role": "User"},
    {"id": 2, "username": "testuser2", "role": "User"},
    {"id": 4, "username": "testuser4", "role": "User"}
  ]
  '''

  [[runs.requests]]
  name = "Add testuser5 (Admin)"
  method = "Post"
  target = "/accounts"
  body = '''{ "username": "testuser5", "role": "Admin" }'''
  [runs.requests.assert]
  status = 200
  breaking = true

  [[runs.requests]]
  name = "Get final list"
  method = "Get"
  target = "/accounts"
  [runs.requests.assert]
  status = 200
  breaking = true
  body = '''
  [
    {"id": 1, "username": "testuser1", "role": "User"},
    {"id": 2, "username": "testuser2", "role": "User"},
    {"id": 4, "username": "testuser4", "role": "User"},
    {"id": 5, "username": "testuser5", "role": "Admin"}
  ]
  '''

# Run 2: A run with a non-breaking failure
[[runs]]
name = "Non-Breaking Failure Test"
url = "0.0.0.0"
port = 7878

  [[runs.requests]]
  name = "Get account 1 (fail)"
  method = "Get"
  target = "/accounts/1"
  [runs.requests.assert]
  status = 404 # Intentionally wrong status
  breaking = false

  [[runs.requests]]
  name = "Get account 2 (should run)"
  method = "Get"
  target = "/accounts/2"
  [runs.requests.assert]
  status = 200
  breaking = true

# Run 3: A run with a breaking failure
[[runs]]
name = "Breaking Failure Test"
url = "0.0.0.0"
port = 7878

  [[runs.requests]]
  name = "Get account 4 (fail)"
  method = "Get"
  target = "/accounts/4"
  [runs.requests.assert]
  status = 404 # Intentionally wrong status
  breaking = true

  [[runs.requests]]
  name = "Get account 5 (should NOT run)"
  method = "Get"
  target = "/accounts/5"
  [runs.requests.assert]
  status = 200
  breaking = true