Skip to main content

Yet Another Testing Language

Project description

YATL — Yet Another Testing Language

Python License GitHub stars

YATL is a declarative, YAML‑based testing language for API testing. If you know HTTP and YAML, you know YATL.

Quick start

pip install yatl-testing

Create your first test file ping.yatl.yaml:

name: ping
base_url: google.com

steps:
  - name: simple_test
    request:
      method: GET
    expect:
      status: 200

Run it:

yatl .

That’s it!


Consider another example, let's try to test a simple POST request:

We will use FastAPI to create a simple API:

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class User(BaseModel):
    name: str
    age: int

db = [
    User(name="John", age=30),
    User(name="Jane", age=25),
]

@app.post("/users", status_code=201)
def create_user(user: User):
    db.append(user)
    return {"status": "ok"}

Create a test file users.yatl.yaml:

name: User API
base_url: https://localhost:8000

steps:
  - name: create_user
    description: Create a new user with name=John and age=30
    request:
      method: POST
      url: /users
      body:
        json:
          name: John
          age: 30
    expect:
      status: 201
      body:
        json:
          status: ok

Run it:

yatl .

That’s it!

Why YATL?

Writing API tests in code is cumbersome. YATL turns tests into pure data — declarative, readable, and accessible to every team member.

The Problem

  • You have to write code – even for a simple GET request
  • High entry barrier – need to know programming languages well
  • Complex dependencies – chaining requests becomes spaghetti code
  • Hard to maintain – tests become unreadable over time

The Solution

YATL is a domain‑specific language that lets you describe API tests in clean YAML. No imperative code, no hidden magic.

If you know HTTP and YAML, you know YATL.

Key Features

  • Declarative syntax – describe what to test, not how
  • Data extraction & templating – use Jinja2 to reuse response data
  • Multiple data formats – JSON, XML, form data, multipart files
  • Parallel execution – run tests in parallel with --workers
  • Skip tests & steps – disable tests without deleting them
  • Advanced validation – validate with rules like gt, regex, type

Example

name: User API
base_url: https://api.example.com

steps:
  - name: login
    request:
      method: POST
      url: /auth/login
      body:
        json:
          username: "test"
          password: "secret"
    expect:
      status: 200
    extract:
      token: "response.access_token"

  - name: get_profile
    request:
      method: GET
      url: /profile
      headers:
        Authorization: "Bearer {{ token }}"
    expect:
      status: 200

Usage

Running Tests

# Run all `.yatl.yaml` files in a directory
yatl .


# Run with 5 parallel workers on `tests/` directory
yatl tests/ --workers 5

Writing Tests

Every YATL test is a YAML file with a .yatl.yaml extension. The structure is simple:

name: Test Suite Name
base_url: https://api.example.com

steps:
  - name: step_one
    request:
      method: GET
      url: /endpoint
    expect:
      status: 200
      body:
        json:
          field: "expected_value"

See the full documentation for all available options.

Documentation

Full documentation is available in the docs/ directory:

CI/CD Integration

YATL fits seamlessly into CI pipelines. Example GitHub Actions workflow:

testing_api:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - name: Setup Python
      uses: actions/setup-python@v4
      with:
        python-version: 3.14

    - name: install yatl
      run: pip install yatl-testing

    - name: run tests
      run: yatl ./api_tests

If you find this project useful, please star it on GitHub. It really motivates me! ⭐️

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yatl_testing-0.1.4.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yatl_testing-0.1.4-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file yatl_testing-0.1.4.tar.gz.

File metadata

  • Download URL: yatl_testing-0.1.4.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.14.4 Darwin/24.5.0

File hashes

Hashes for yatl_testing-0.1.4.tar.gz
Algorithm Hash digest
SHA256 63f3a878becc9f51dce9d67848a47e7941abb38edce1bc8ba722f1e60018dbf4
MD5 837d239bf8521950c402c2cf0b766dee
BLAKE2b-256 e2d3897643688ec8f8478485b41dc96b735cd06d75e3a163aaba0c2f4a5d91a9

See more details on using hashes here.

File details

Details for the file yatl_testing-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: yatl_testing-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.14.4 Darwin/24.5.0

File hashes

Hashes for yatl_testing-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 71bcb0b471ab07334248a9d28ae6b9aca04ffc6babcb867d5d546f4175c66a7f
MD5 50f54cf258dbf952c0e8b92bf3c6b4a4
BLAKE2b-256 e885d0140ba2f7fbceaa478793ecf2312ba7cb7097472801e878126e50a20050

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page